mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
36 lines
596 B
C#
36 lines
596 B
C#
using BehaviorDesigner.Runtime;
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
namespace MoleMole
|
|
{
|
|
[TaskCategory("Basic/SharedVariable")]
|
|
public class SharedFloatLogic : Action
|
|
{
|
|
public enum LogicType
|
|
{
|
|
Add = 0,
|
|
Multiple = 1
|
|
}
|
|
|
|
public SharedFloat BaseValue;
|
|
|
|
public LogicType Logic;
|
|
|
|
public SharedFloat ParamValue;
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
switch (Logic)
|
|
{
|
|
case LogicType.Add:
|
|
BaseValue.Value += ParamValue.Value;
|
|
break;
|
|
case LogicType.Multiple:
|
|
BaseValue.Value *= ParamValue.Value;
|
|
break;
|
|
}
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
}
|