This repository has been archived on 2025-06-25. You can view files and clone it, but cannot push or open issues or pull requests.
Net.Like.Xue.Tokyo/Assets/Plugins/ParadoxNotion/NodeCanvas/Tasks/Actions/Blackboard/SetBooleanRandom.cs

26 lines
644 B
C#

using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Blackboard")]
[Description("Set a blackboard boolean variable at random between min and max value")]
public class SetBooleanRandom : ActionTask
{
[BlackboardOnly]
public BBParameter<bool> boolVariable;
protected override string info {
get { return "Set " + boolVariable + " Random"; }
}
protected override void OnExecute() {
boolVariable.value = Random.Range(0, 2) == 0 ? false : true;
EndAction();
}
}
}