---
tags:
    - "Value"
    - "Constant"
---

# Scene by Index

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

A Scene identified by an Index value from the Build Settings

## Code

```cs
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;
    }
}
```

