void Start() { //Find references toolbox = FindObjectOfType <Core_Toolbox>(); if (toolbox == null) { Debug.LogError("toolbox not found!!!"); } em = toolbox.GetComponent <Core_EventManager>(); gameManager = toolbox.GetComponent <Core_GameManager>(); Transform respawnPointHolder = transform. GetComponentInChildren <Core_RespawnPointHolderTag>().transform; foreach (Transform child in respawnPointHolder) { respawnPoints.Add(child); } //Find globalVariableLibrary and get variables from it lib = toolbox.GetComponent <Core_GlobalVariableLibrary>(); GetStats(); //Send respawnPoint list to GameManager and broadcast NewSceneLoaded gameManager.SetRespawnPoints(respawnPoints); em.BroadcastNewSceneLoaded(mySceneIndex); }
void Start() { toolbox = FindObjectOfType <Core_Toolbox>(); if (toolbox == null) { Debug.LogError("toolbox not found!!!"); } em = toolbox.GetComponent <Core_EventManager>(); lib = toolbox.GetComponent <Core_GlobalVariableLibrary>(); GetStats(); em.BroadcastNewSceneLoaded(mySceneIndex); }