Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

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;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.