Mask Graphic#
UI / Mask / Mask / Mask Graphic
Can Read
Cannot Write
Description#
The Graphic property of the Mask component
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
{
[Get]
[Title("Mask Graphic")]
[Category("UI/Mask/Mask/Graphic")]
[Description("The Graphic property of the Mask component")]
[Image(typeof(IconMask), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeGameObject_Mask_Graphic : TypeGameObject
{
[SerializeField] private GetGameObject m_Mask = new GetGameObject(
new GenTypeGameObject_Mask()
);
public override GameObject GetPreview(GameObject source)
{
GameObject instance = this.m_Mask.GetPreview(source);
if (instance == null) return default;
Mask component = instance.GetComponent<Mask>();
return component != null ? component.graphic.gameObject : default;
}
public override GameObject Get(Args args)
{
Mask instance = this.m_Mask.Get<Mask>(args);
return instance != null
? instance.graphic.gameObject
: default;
}
public override U Get<U>(Args args)
{
if (typeof(U) == typeof(Mask))
{
Mask instance = this.m_Mask.Get<Mask>(args);
return instance != null
? instance.graphic as U
: default;
}
return base.Get<U>(args);
}
public override string ToString()
{
return $"{this.m_Mask} Graphic";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}