Example #1
0
    // Use this for initialization
    void Start()
    {
        GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

        colorBlindSetting = mainCamera.GetComponent <Colorblind>();
        GameObject[] spawns = GameObject.FindGameObjectsWithTag("SpawnPoint");
        int          i      = 0;

        foreach (GameObject spawn in spawns) //assign spawn transforms to spawnPoints array
        {
            spawnPoints[i] = spawn.transform;
            i++;
        }

        sound = mainCamera.GetComponent <AudioSource>();
        SpawnApples(spawnPoints);
        ripeApples      = GameObject.FindGameObjectsWithTag("RipeApple").Length;
        collectedApples = 0;
        StartGame();
    }
Example #2
0
    //public bool isEnabled;
    //UnityEvent toggleEvent;

    // Use this for initialization
    void Start()
    {
        ppProfile = GetComponent <PostProcessingBehaviour>().profile;
        cbProfile = GetComponent <Colorblind>();
    }