void Awake()
 {
     oxyTracker       = GameObject.Find("OxygenTracker");
     oxyTrackerScript = oxyTracker.GetComponent <OxygenTrackerScript> ();
     rect             = this.gameObject.GetComponent <RectTransform> ();
     maxXAnchor       = rect.anchorMax.x;
     minXAnchor       = rect.anchorMin.x;
 }
예제 #2
0
    void Awake()           //initialize variables from other scripts and objects
    {
        paused    = false; //game not paused and pause menu not visible
        pauseMenu = GameObject.Find("PauseMenu");
        pauseMenu.SetActive(paused);

        oxyTracker       = GameObject.Find("OxygenTracker");  //get object and component
        oxyTrackerScript = oxyTracker.GetComponent <OxygenTrackerScript> ();
        oxyTrackerScript.resetOxygen();                       //set oxygen to inital oxygen

        terrScript = terrain.GetComponent <TerrainScript> (); //get terrain
        StartCoroutine(beginGame());                          //start coroutine that sets the game area up properly
    }
    //volumeControl

    //grabOxygenPercentage

    // Use this for initialization

    /*
     * music effects will all be based on pitch
     *
     * if in the upper 70% range there will be no changes to audio
     *
     *
     * at 70% the pitch will raise; and it will quicken significantly
     *
     * at 50% the pitch will be slooowed down significantly
     *
     *
     * at 30%:
     *    pitch will rise and fall gradually
     *
     * 20:
     *
     * random pitch back and forth / frantic / chaotic
     *
     *
     * 10%:
     *
     * really slow, in right direction, and then in reverse direction; switching back and forth
     *
     *
     *
     *
     *
     *
     */


    void Awake()
    {
        source           = GetComponent <AudioSource>();
        oxyTracker       = GameObject.Find("OxygenTracker");
        oxyTrackerScript = oxyTracker.GetComponent <OxygenTrackerScript> ();
    }