CORE dashboard + a lot of changes
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
/// Extend this to make custom effect that can be used by <see cref="StatusDefinitionSO"/>.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Effect
|
||||
public abstract class BaseEffect
|
||||
{
|
||||
public BaseObject obj { get; internal set; }
|
||||
public Status status { get; internal set; }
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Effects
|
||||
{
|
||||
public class NotControllableEffect : Effect
|
||||
public class NotControllableEffect : BaseEffect
|
||||
{
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ using RPGCore.ObjectModules.EventObjectModule;
|
||||
namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Executed when <see cref="Status"/> ends normally - by timer or by <see cref="Effect"/>.
|
||||
/// Executed when <see cref="Status"/> ends normally - by timer or by <see cref="BaseEffect"/>.
|
||||
/// </summary>
|
||||
public class StatusEndEvent : BaseEvent<BaseObject>
|
||||
{
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ using RPGCore.ObjectModules.EventObjectModule;
|
||||
namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Executed when <see cref="Status"/> ends forcefully - by something else than timer or <see cref="Effect"/>.
|
||||
/// Executed when <see cref="Status"/> ends forcefully - by something else than timer or <see cref="BaseEffect"/>.
|
||||
/// </summary>
|
||||
public class StatusRemoveEvent : BaseEvent<BaseObject>
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
public StatusModule statusModule { get; private set; }
|
||||
|
||||
public float timeRemaining { get; private set; }
|
||||
public List<Effect> effects { get; private set; }
|
||||
public List<BaseEffect> effects { get; private set; }
|
||||
|
||||
internal Status(StatusDefinitionSO definition, StatusModule statusModule)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
timeRemaining = definition.time;
|
||||
effects = definition.effects.Select(e =>
|
||||
{
|
||||
var copy = JsonUtility.FromJson<Effect>(JsonUtility.ToJson(e));
|
||||
var copy = JsonUtility.FromJson<BaseEffect>(JsonUtility.ToJson(e));
|
||||
copy.obj = statusModule.parent;
|
||||
copy.status = this;
|
||||
return copy;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RPGCore.Core.Objects;
|
||||
using RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Effects;
|
||||
using RPGCoreCommon.DynamicValues;
|
||||
using RPGCoreCommon.Helpers.CustomTypes;
|
||||
using UnityEngine;
|
||||
@@ -26,7 +25,7 @@ namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
[Min(0)] public float time;
|
||||
|
||||
[Header("Effects")]
|
||||
[SerializeReference] public List<Effect> effects = new();
|
||||
[SerializeReference] public List<BaseEffect> effects = new();
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RPGCore.Core;
|
||||
using RPGCore.Core.Objects;
|
||||
using RPGCore.ObjectModules.EventObjectModule;
|
||||
using RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Effects;
|
||||
using RPGCore.StatusEffect.ObjectModules.StatusObjectModule.Events;
|
||||
using UnityEngine;
|
||||
@@ -11,7 +10,12 @@ using UnityEngine;
|
||||
namespace RPGCore.StatusEffect.ObjectModules.StatusObjectModule
|
||||
{
|
||||
[Serializable]
|
||||
[RequireComponent(typeof(BaseObject))]
|
||||
[ObjectModule(
|
||||
name: "[Status] Status",
|
||||
description: "Attached to any implementation of <b>BaseObject</b>. Manages statuses and their effects. " +
|
||||
"Create scriptable object <b>"+nameof(StatusDefinitionSO)+"</b> to make new status. " +
|
||||
"For new effect create new implementation of <b>"+nameof(BaseEffect)+"</b>."
|
||||
)]
|
||||
public class StatusModule : ObjectModule<BaseObject>
|
||||
{
|
||||
internal List<Status> statuses { get; private set; } = new();
|
||||
|
||||
Reference in New Issue
Block a user