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

26 lines
509 B
C#

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip("Sets a Bool Variable to True or False randomly.")]
public class RandomBool : FsmStateAction
{
[UIHint(UIHint.Variable)]
public FsmBool storeResult;
public override void Reset()
{
storeResult = null;
}
public override void OnEnter()
{
storeResult.Value = Random.Range(0, 100) < 50;
Finish();
}
}
}