On Material Change#
Bindings / On Material Change
Description#
Executes when the Material bound changes its value
Parameters#
| Name | Description |
|---|---|
| Initial Emit | Emits the event immediately when the component is enabled or not |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("On Material Change")]
[Image(typeof(IconMaterial), ColorTheme.Type.Blue, typeof(BadgeLink))]
[Description("Executes when the Material bound changes its value")]
[Category("Bindings/On Material Change")]
[Serializable]
public class TriggerCoreBindMaterial : TriggerCoreBindBase
{
[SerializeField] private GetMaterial m_Material = new GetMaterial();
// PROPERTIES: ----------------------------------------------------------------------------
protected override string GetTitle(GameObject source) => $"change {this.m_Material}";
protected override ISubscription Subscription => this.m_Material;
}
}