Toggle Graphic#
UI / Interaction / Toggle / Toggle Graphic
Description#
Compares the Graphic field of Toggle component to another value
Parameters#
| Name | Description |
|---|---|
| Toggle | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;
namespace VisualScript.Runtime
{
[Title("Toggle Graphic")]
[Category("UI/Interaction/Toggle/Graphic")]
[Description("Compares the Graphic field of Toggle component to another value")]
[Image(typeof(IconToggleOn), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface, Checkbox")]
[Parameter("Toggle")]
[Parameter("Value")]
[Serializable]
public class GenConditionGameObject_Toggle_CheckGraphic : Condition
{
[SerializeField] private GetGameObject m_Toggle = new GetGameObject(
new GenTypeGameObject_Toggle()
);
[SerializeField] private GetGameObject m_Value = new GetGameObject();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Graphic");
return $"{this.m_Toggle} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Toggle component = this.m_Toggle.Get<Toggle>(args);
if (component == null) return false;
return component.graphic == this.m_Value.Get<Graphic>(args);
}
}
}