Set Bool#
Set / Set Bool
Description#
Sets a Boolean value
Parameters#
| Name | Description |
|---|---|
| Set | Where the value is stored |
| Value | The value to store |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Set Bool")]
[Image(typeof(IconToggleOn), ColorTheme.Type.Red)]
[Description("Sets a Boolean value")]
[Category("Set/Set Boolean")]
[Parameter("Set", "Where the value is stored")]
[Parameter("Value", "The value to store")]
[Keywords("Set", "Change", "Modify", "Assign")]
[Serializable]
public class InstructionCoreSetBool : Instruction
{
[SerializeField] private SetBool m_Set = new SetBool();
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source) => $"{this.m_Set} = {this.m_Value}";
protected override Awaitable Run(Args args)
{
bool value = this.m_Value.Get(args);
this.m_Set.Set(value, args);
return Done;
}
}
}