Prefab#
Can Read
Cannot Write
Description#
A prefab Game Object
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Inline(nameof(m_Value), typeof(GameObject), false)]
[Title("Prefab")]
[Category("Prefab")]
[Description("A prefab Game Object")]
[Image(typeof(IconCubeSolid), ColorTheme.Type.Blue)]
[Keywords("Value", "Reference", "Object", "Prefab", "Component")]
[Serializable]
public class TypeGameObjectPrefab : TypeGameObject
{
[SerializeField] private GameObject m_Value;
public override GameObject GetPreview(GameObject source) => this.m_Value;
public TypeGameObjectPrefab()
{
this.m_Value = null;
}
public TypeGameObjectPrefab(GameObject prefab)
{
this.m_Value = prefab;
}
public override GameObject Get(Args args)
{
return this.m_Value;
}
public override string ToString()
{
return TextUtils.Name(this.m_Value);
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
}
}