using UnityEngine; using UnityEngine.SceneManagement; public class LevelBehavior : MonoBehaviour { [SerializeField] GameObject eFie; [SerializeField] GameObject eSilv; [SerializeField] GameObject eHai; FieScript fie; private void Awake() { fie = eFie.GetComponent(); } void Start() { // Create a temporary reference to the current scene. Scene currentScene = SceneManager.GetActiveScene(); // Retrieve the name of this scene. string sceneName = currentScene.name; if (sceneName == "Day2") { fie.stateTime = 5; // Do something... } else if (sceneName == "Day6") { fie.stateTime = 3; // Do something... } // Retrieve the index of the scene in the project's build settings. int buildIndex = currentScene.buildIndex; //// Check the scene name as a conditional. //switch (buildIndex) //{ // case 0: // // Do something... // break; // case 1: // // Do something... // break; //} } void Update() { } }