Sprite Mask Is Custom Range Active#
Miscellaneous / Sprite Mask / Sprite Mask Is Custom Range Active
Can Read
Can Write
Description#
The Is Custom Range Active property of the Sprite 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;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Sprite Mask Is Custom Range Active")]
[Category("Miscellaneous/Sprite Mask/Is Custom Range Active")]
[Description("The Is Custom Range Active property of the Sprite Mask component")]
[Image(typeof(IconSprite), ColorTheme.Type.Purple, typeof(BadgeMinus))]
[Serializable]
public class GenTypeBool_SpriteMask_IsCustomRangeActive : TypeBool
{
[SerializeField] private GetGameObject m_SpriteMask = new GetGameObject(
new GenTypeGameObject_SpriteMask()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_SpriteMask.GetPreview(source);
if (instance == null) return default;
SpriteMask component = instance.GetComponent<SpriteMask>();
return component != null ? component.isCustomRangeActive : default;
}
public override bool Get(Args args)
{
SpriteMask instance = this.m_SpriteMask.Get<SpriteMask>(args);
return instance != null
? instance.isCustomRangeActive
: default;
}
public override void Set(bool value, Args args)
{
SpriteMask component = this.m_SpriteMask.Get<SpriteMask>(args);
if (component != null) component.isCustomRangeActive = (bool) value;
}
public override string ToString()
{
return $"{this.m_SpriteMask} Is Custom Range Active";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}