private void Awake() { this.birdPhysics = birdPhysics ?? transform.root.GetComponentInChildren <BirdPhysics>(); this.collisionSensor = transform.root.GetComponentInChildren <CollisionSensor>(); this.playerDiedEventChannel = GameObject.FindGameObjectWithTag(Tags.GameController). GetComponent <PlayerDiedEventChannel>(); if (birdPhysics == null) { SayToLog("BirdPhysics component not found!"); } if (collisionSensor == null) { SayToLog("CollisionSensor component not found!"); } }
private void Awake() { mainController = GameObject.FindGameObjectWithTag(Tags.MainController). GetComponent <MainController>(); pipePassedEventChannel = GetComponent <PipePassedEventChannel>(); playerDiedEventChannel = GetComponent <PlayerDiedEventChannel>(); if (mainController == null) { Debug.Log("MainController GameObject or component not found!"); } if (pipePassedEventChannel == null) { Debug.Log("PipePassedEventChannel component not found!"); } if (playerDiedEventChannel == null) { Debug.Log("PlayerDiedEventChannel component not found!"); } }