Invert#
Math / Invert
Can Read
Cannot Write
Description#
Returns True if the value is False and vice versa
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Invert")]
[Category("Math/Invert")]
[Description("Returns True if the value is False and vice versa")]
[Image(typeof(IconToggleOff), ColorTheme.Type.Yellow, typeof(BadgeArrowLeft))]
[Keywords("Not", "!")]
[Serializable]
public class TypeBoolMathInvert : TypeBool
{
[SerializeField] private GetBool m_Value = new GetBool();
public override bool GetPreview(GameObject source) => !this.m_Value.GetPreview(source);
public override bool Get(Args args) => !this.m_Value.Get(args);
public override string ToString()
{
return $"Invert {this.m_Value}";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}