Game Object is Static#
Game Object / Game Object is Static
Can Read
Cannot Write
Description#
Returns true if the game object has any Static flags enabled
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Game Object is Static")]
[Category("Game Object/Is Static")]
[Description("Returns true if the game object has any Static flags enabled")]
[Image(typeof(IconAnchor), ColorTheme.Type.TextLight)]
[Serializable]
public class TypeBoolGameObjectIsStatic : TypeBool
{
[SerializeField] private GetGameObject m_GameObject = new GetGameObject();
public override bool GetPreview(GameObject source)
{
GameObject gameObject = this.m_GameObject.GetPreview(source);
return gameObject != null && gameObject.isStatic;
}
public override bool Get(Args args)
{
GameObject gameObject = this.m_GameObject.Get(args);
return gameObject != null && gameObject.isStatic;
}
public override string ToString()
{
return $"{this.m_GameObject} is Static";
}
protected override SubscriptionMode Subscription => SubscriptionMode.None;
}
}