Canvas Renderer Get Pop Material#
Rendering / Canvas Renderer / Canvas Renderer Get Pop Material
Description#
Compares the Get Pop Material method of Canvas Renderer component to another value
Parameters#
| Name | Description |
|---|---|
| Canvas Renderer | |
| Index | |
| 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.Rendering;
namespace VisualScript.Runtime
{
[Title("Canvas Renderer Get Pop Material")]
[Category("Rendering/Canvas Renderer/Get Pop Material")]
[Description("Compares the Get Pop Material method of Canvas Renderer component to another value")]
[Image(typeof(IconEye), ColorTheme.Type.TextLight)]
[Parameter("Canvas Renderer")]
[Parameter("Index")]
[Parameter("Value")]
[Serializable]
public class GenConditionMaterial_CanvasRenderer_CheckGetPopMaterial_1 : Condition
{
[SerializeField] private GetGameObject m_CanvasRenderer = new GetGameObject(
new GenTypeGameObject_CanvasRenderer()
);
[SerializeField] private GetMaterial m_Value = new GetMaterial();
[SerializeField] private GetInteger m_Index = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Pop Material");
string parameters = $"({this.m_Index})";
return $"{this.m_CanvasRenderer} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
CanvasRenderer component = this.m_CanvasRenderer.Get<CanvasRenderer>(args);
if (component == null) return false;
Material value = component.GetPopMaterial(
(int) this.m_Index.Get(args)
);
return value == this.m_Value.Get(args) as Material;
}
}
}