Skip to content

Commit 3baeee6

Browse files
committed
Fixed #4 - Adding BuildIndex getter.
1 parent e719c8c commit 3baeee6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Assets/DevLocker/Utils/SceneReference.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ public string ScenePath
8484
/// </summary>
8585
public string SceneName => Path.GetFileNameWithoutExtension(ScenePath);
8686

87+
/// <summary>
88+
/// Is scene actually set to this instance?
89+
/// </summary>
8790
public bool IsEmpty => string.IsNullOrEmpty(ScenePath);
8891

92+
/// <summary>
93+
/// Get the index of the scene in the build settings.
94+
/// </summary>
95+
public int BuildIndex => UnityEngine.SceneManagement.SceneUtility.GetBuildIndexByScenePath(ScenePath);
96+
8997
public SceneReference() { }
9098

9199
public SceneReference(string scenePath)

0 commit comments

Comments
 (0)