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

Scene by Index#

  • Can Read

  • Cannot Write

Description#

A Scene identified by an Index value from the Build Settings

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Scene by Index")]
    [Category("Scene by Index")]
    
    [Description("A Scene identified by an Index value from the Build Settings")]
    [Image(typeof(IconUnity), ColorTheme.Type.Gray)]
    
    [Keywords("Value", "Constant")]
    
    [Serializable]
    public class TypeSceneByIndex : TypeScene
    {
        [SerializeField] private GetInteger m_Index;

        public override int GetPreview(GameObject source) => (int) this.m_Index.GetPreview(source);

        public TypeSceneByIndex() : this(0)
        {
            this.m_Index = new GetInteger();
        }
        
        public TypeSceneByIndex(int index)
        {
            this.m_Index = new GetInteger(index);
        }

        public override int Get(Args args)
        {
            return (int) this.m_Index.Get(args);
        }

        public override string ToString()
        {
            return this.m_Index.ToString();
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.