NOR#
Math / NOR
Can Read
Cannot Write
Description#
Returns True only when both value 1 and value 2 are False
Parameters#
| Name | Description |
|---|---|
| Value 1 | The first value of the operation |
| Value 2 | The second value of the operation |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("NOR")]
[Category("Math/NOR")]
[Description("Returns True only when both value 1 and value 2 are False")]
[Image(typeof(IconNOR), ColorTheme.Type.Yellow)]
[Parameter("Value 1", "The first value of the operation")]
[Parameter("Value 2", "The second value of the operation")]
[Keywords("Not", "Or", "Neither", "None", "Invert", "Logic")]
[Serializable]
public class TypeBoolMathNOR : TypeBool
{
[SerializeField] private GetBool m_Value1 = new GetBool();
[SerializeField] private GetBool m_Value2 = new GetBool();
public override bool GetPreview(GameObject source)
{
return !(this.m_Value1.GetPreview(source) || this.m_Value2.GetPreview(source));
}
public override bool Get(Args args)
{
return !(this.m_Value1.Get(args) || this.m_Value2.Get(args));
}
public override string ToString()
{
return $"{this.m_Value1} NOR {this.m_Value2}";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}