Files
beyond/Assets/ThirdParty/PlayMaker/Actions/Math/SetFloatValue.cs
2024-11-20 15:21:28 +01:00

36 lines
724 B
C#

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Sets the value of a Float Variable.")]
public class SetFloatValue : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat floatVariable;
[RequiredField]
public FsmFloat floatValue;
public bool everyFrame;
public override void Reset()
{
floatVariable = null;
floatValue = null;
everyFrame = false;
}
public override void OnEnter()
{
floatVariable.Value = floatValue.Value;
if (!everyFrame)
Finish();
}
public override void OnUpdate()
{
floatVariable.Value = floatValue.Value;
}
}
}