private void Awake()
    {
        //Find the windArrow child.
        windArrow = GetComponentInChildren <WindArrow>();
        if (windArrow == null)
        {
            Debug.LogError("You need a Wind Arrow as a child to the game manager!");
        }

        //Find Wind handler in the world. If found, randomize the wind direction.
        windHandler = FindObjectOfType <WindHandler>();
        if (windHandler == null)
        {
            Debug.LogError("You need a Wind Handler in the game!");
        }
        else
        {
            ChangeWind();
        }

        //Check if theres a spawn group. If so, get the spawn points.
        if (spawnPointGroup == null)
        {
            Debug.LogError("You need to assign a spawn point group!");
        }
        else
        {
            spawnPoints = spawnPointGroup.GetComponentsInChildren <SpawnPoint>();
        }
    }
Example #2
0
 private void Awake()
 {
     //Find the Wind handler in the world. If found, add physics object to the wind handler.
     windHandler = FindObjectOfType <WindHandler>();
     if (windHandler == null)
     {
         Debug.LogError("You need a wind handler in the world!");
     }
     else
     {
         windHandler.AddPhysicsObjectToList(this);
     }
 }