Added Observation Scene to show the Replay
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class FillDopdownWithScenes : MonoBehaviour
|
||||
{
|
||||
public TMP_Dropdown dropdown;
|
||||
private void Awake()
|
||||
{
|
||||
PopulateWithScenes();
|
||||
}
|
||||
|
||||
void PopulateWithScenes()
|
||||
{
|
||||
dropdown.ClearOptions();
|
||||
|
||||
List<string> sceneNames = new List<string>();
|
||||
|
||||
for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++)
|
||||
{
|
||||
string path = SceneUtility.GetScenePathByBuildIndex(i);
|
||||
string name = System.IO.Path.GetFileNameWithoutExtension(path);
|
||||
sceneNames.Add(name);
|
||||
}
|
||||
|
||||
dropdown.AddOptions(sceneNames);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user