Canvas Sorting Layer Name#
UI / Layout / Canvas / Canvas Sorting Layer Name
Description#
Compares the Sorting Layer Name property of Canvas component to another value
Parameters#
| Name | Description |
|---|---|
| Canvas | |
| 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("Canvas Sorting Layer Name")]
[Category("UI/Layout/Canvas/Sorting Layer Name")]
[Description("Compares the Sorting Layer Name property of Canvas component to another value")]
[Image(typeof(IconCanvas), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Parameter("Canvas")]
[Parameter("Value")]
[Serializable]
public class GenConditionString_Canvas_CheckSortingLayerName : Condition
{
[SerializeField] private GetGameObject m_Canvas = new GetGameObject(
new GenTypeGameObject_Canvas()
);
[SerializeField] private GetString m_Value = new GetString();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Sorting Layer Name");
return $"{this.m_Canvas} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Canvas component = this.m_Canvas.Get<Canvas>(args);
if (component == null) return false;
return component.sortingLayerName == (string) this.m_Value.Get(args);
}
}
}