Class ScenePathAttribute
Marks the target string field as a scene path, and automatically provides a dropdown in the inspector listing all scenes contained within the project. If the scene has not yet been added to build settings, an inspector warning is displayed with the ability to add it immediately
Inheritance
System.Object
System.Attribute
UnityEngine.PropertyAttribute
ScenePathAttribute
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
UnityEngine.PropertyAttribute.order
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class ScenePathAttribute : PropertyAttribute, _Attribute
Examples
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Atlas.Examples
{
public sealed class Example_ScenePathAttribute : MonoBehaviour
{
// displays dropdown of scene names in inspector
[SerializeField, ScenePath] private string m_scenePath;
private void LoadScene()
{
// editor automatically prepares string for use with LoadScene
SceneManager.LoadScene( m_scenePath );
}
}
}
Implements
System.Runtime.InteropServices._Attribute