Example #1
0
 private void Awake()
 {
     birdSensor = transform.root.GetComponentInChildren <BirdSensor>();
     RandomizePipeHeights();
     pipePassedEventChannel = GameObject.FindWithTag(Tags.GameController)
                              .GetComponent <PipePassedEventChannel>();
 }
Example #2
0
    private void Awake()
    {
        birdSensor             = transform.root.GetComponentInChildren <BirdSensor>();
        pipePassedEventChannel = GameObject.FindGameObjectWithTag(Tags.GameController).
                                 GetComponent <PipePassedEventChannel>();

        if (upperPipe == null)
        {
            Debug.Log("Could not find the upper pipe!");
        }
        if (lowerPipe == null)
        {
            Debug.Log("Could not find the lower pipe!");
        }
        if (birdSensor == null)
        {
            Debug.Log("Could not find the birdSensor component!");
        }
        if (pipePassedEventChannel == null)
        {
            Debug.Log("PipePassedEventChannel or GameController not found!");
        }

        RandomizePipeHeights();
        RandomizePipeWidths(upperPipe);
        RandomizePipeWidths(lowerPipe);
    }
Example #3
0
    private void Awake()
    {
        RandomizePipes();

        birdSensor = transform.root.GetComponentInChildren <BirdSensor>();
    }