Inheritance: MonoBehaviour
Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        //Set inspector defined text
        title.text = bountyName;
        info.text = description;
        counter.text = 0 + "/" + (completeAmount);

        //Bounty controller reference
        bountyConch = transform.parent.transform.parent.GetComponent<BountyController> ();

        //Ensure bounty is properly initialized in inspector, all these fields must have values
        if(bountyName == "" || completeAmount == 0 || bountyNumber == -1 || description == "") {
            Debug.LogError(gameObject.name + " has missing values.");
        }
    }
Beispiel #2
0
    void Start()
    {
        bountyConch = GameObject.Find ("BountyCanvas").GetComponent<BountyController> ();

        shaker = transform.parent.GetComponent<CameraShake>();
        AudioListener.volume = PlayerPrefs.GetFloat ("volume");
        unmuteVolume = PlayerPrefs.GetFloat ("volume");
        player = GameObject.Find ("Player");
        //Set volume sliders to saved Pref
        pSlide = GameObject.Find ("pSlider");
        dSlide = GameObject.Find ("dSlider");
        pMute = GameObject.Find ("pMuteButton");
        dMute = GameObject.Find ("dMuteButton");

        pSlide.GetComponent<Slider> ().value = PlayerPrefs.GetFloat ("volume");
        dSlide.GetComponent<Slider> ().value = PlayerPrefs.GetFloat ("volume");

        //Find references to the pause and death menus, then disable them
        pauseMenu = GameObject.Find ("Pause");
        pauseMenu.SetActive(false);
        paused = false;
        deathMenu = GameObject.Find ("Death");
        deathMenu.SetActive(false);
        Time.timeScale = 1;
        Cursor.visible = false;
    }