void Start() { audioManager = AudioManager.instance; Assert.IsNotNull(audioManager); playerLives = PlayerLives.instance; Assert.IsNotNull(playerLives); playerStateMachine = GameObject.Find("PlayerManager").gameObject.GetComponent <PlayerStateMachine>(); Assert.IsNotNull(playerStateMachine); weaponManager = GameObject.Find("WeaponUIManager").gameObject.GetComponent <WeaponManager>(); Assert.IsNotNull(weaponManager); }
private void Awake() { //singleton if (instance != null) { if (instance != this) { Destroy(gameObject); } } else { instance = this; DontDestroyOnLoad(this); } audioManager = AudioManager.instance; }