50 lines
1.0 KiB
C#
50 lines
1.0 KiB
C#
using Cal;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using XNode;
|
|
|
|
[NodeWidth(150)]
|
|
public class SkillEventConditionNode : SkillNode
|
|
{
|
|
|
|
// Use this for initialization
|
|
protected override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
}
|
|
[LabelText("Root")]
|
|
[BsonIgnore]
|
|
[Input] public float input;
|
|
[HideLabel]
|
|
[PropertySpace(10)]
|
|
public SkillEventCondition condition;
|
|
[LabelText("操作")]
|
|
[BsonIgnore]
|
|
[Output] public float result;
|
|
|
|
// GetValue should be overridden to return a value for any specified output port
|
|
public override object GetValue(NodePort port)
|
|
{
|
|
return null;
|
|
}
|
|
public override void OnCreateConnection(NodePort from, NodePort to)
|
|
{
|
|
if (to.node == this)
|
|
{
|
|
if (!(from.node is RootNode))
|
|
{
|
|
from.Disconnect(to);
|
|
}
|
|
}
|
|
else
|
|
if (!(to.node is SkillOptionBase))
|
|
{
|
|
from.Disconnect(to);
|
|
}
|
|
}
|
|
|
|
|
|
}
|