public static timerManager GetInstance() { if (instance == null) { GameObject go = new GameObject("timerManager"); instance = go.AddComponent(typeof(timerManager)) as timerManager; DontDestroyOnLoad(go); } return(instance); }
private void Start() { _beatsPlayer = GetComponent <BeatsPlayer>(); _rythmInputManager = GetComponent <RythmInputManager>(); _playerController = player.GetComponent <PlayerController>(); _healthManager = GetComponent <HealthManager>(); _timerManager = GetComponent <timerManager>(); _beatsPlayer.InvokePlaySound(beatRate); _playerController.setCallback(this); _timerManager.setCallback(this); gamePlayCanvas.SetActive(true); endGameCanvas.SetActive(false); }