void Awake() { DontDestroyOnLoad(this); if (playerInstance == null) { playerInstance = this; } else { DestroyObject(gameObject); } }
void Start() { //Debug.Log(transition.name); if (SceneManager.GetActiveScene().buildIndex == 0) { startSUT.onClick.AddListener(GoToSimulationSUT); startNonSUT.onClick.AddListener(GoToSimulationNonSUT); } if (SceneManager.GetActiveScene().buildIndex == 1 || SceneManager.GetActiveScene().buildIndex == 2) { valueHolder = GameObject.FindGameObjectWithTag("valueHolder").GetComponent <ValueHolderScript>(); globalTimer = GameObject.FindGameObjectWithTag("globalTimer").GetComponent <GlobalTimerScript>(); } }
// Start is called before the first frame update void Start() { values = GameObject.FindGameObjectWithTag("valueHolder").GetComponent <ValueHolderScript>(); }