65 lines
1.9 KiB
C#
65 lines
1.9 KiB
C#
|
|
using ET;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using Sirenix.OdinInspector;
|
|
#if UNITY_EDITOR
|
|
using UnityEngine;
|
|
using XNode;
|
|
#endif
|
|
|
|
namespace Cal
|
|
{
|
|
[GUIColor(0.8f, 0.9f, 0.2f)]
|
|
[System.Serializable]
|
|
[BsonIgnoreExtraElements]
|
|
|
|
public class SkillOption_延迟操作 : SkillOptionBase
|
|
{
|
|
public override SkillOptionType optionType => SkillOptionType.延迟操作;
|
|
|
|
[BoxGroup("$optionType", CenterLabel = true)]
|
|
[LabelText("延迟时间")]
|
|
#if UNITY
|
|
[SerializeField]
|
|
#endif
|
|
public SkillParam time;
|
|
|
|
[HideInInspector]
|
|
public SkillOptionBase[] value;
|
|
#if UNITY
|
|
[LabelText("操作")]
|
|
[BsonIgnore]
|
|
[Output] public float options;
|
|
public override NodePort GetNodePort(string fieldName)
|
|
{
|
|
if (fieldName == nameof(value))
|
|
{
|
|
return GetOutputPort("options");
|
|
}
|
|
return null;
|
|
}
|
|
public override void Serilize(SkillOptionBase skillOption)
|
|
{
|
|
var succeed = GetOutputPort("options");
|
|
if (succeed.IsConnected)
|
|
{
|
|
var targetArr = new SkillOptionBase[0];
|
|
foreach (var port in succeed.GetConnections())
|
|
{
|
|
SkillOptionBase _skillOption = System.Activator.CreateInstance(port.node.GetType()) as SkillOptionBase;
|
|
port.node.As<SkillOptionBase>().DeepClone(_skillOption);
|
|
port.node.As<SkillOptionBase>().Clear();
|
|
UnityEditor.ArrayUtility.Add(ref targetArr, _skillOption);
|
|
_skillOption.Serilize(_skillOption);
|
|
}
|
|
skillOption.As<SkillOption_延迟操作>().value = targetArr;
|
|
}
|
|
}
|
|
internal override void Clear()
|
|
{
|
|
value = null;
|
|
}
|
|
#endif
|
|
}
|
|
}
|