Пример #1
0
    void Start()
    {
        FoVSlider         = GameObject.Find("FoV Slider");
        sfxVolumeSlider   = GameObject.Find("SFX Volume Slider");
        musicVolumeSlider = GameObject.Find("Music Volume Slider");
        rB = GameObject.FindGameObjectWithTag("respawnBrain").GetComponent <RespawnBrain>();

        FoVSlider.GetComponent <Slider>().value         = rB.height;
        sfxVolumeSlider.GetComponent <Slider>().value   = rB.sfxVolume;
        musicVolumeSlider.GetComponent <Slider>().value = rB.musicVolume;

        //SetVolume(volume);
        //SetFoV();

        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();

        int currResolutionIndex = 0;

        for (int i = 0; i < resolutions.Length; i++)
        {
            string option = resolutions[i].width + "x" + resolutions[i].height;
            options.Add(option);

            if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
            {
                currResolutionIndex = i;
            }
        }
        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currResolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }
Пример #2
0
    void Awake()//define volume e fov e guarda alterações q o player fizer -- verifica se já não existe um brain
    {
        height      = 10;
        sfxVolume   = 0;
        musicVolume = 0;

        //if (_instance != null && _instance != this)
        //{
        //    Destroy(this.gameObject);
        //}
        //else
        //{
        //    _instance = this;
        //}

        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(instance);
        }
        else
        {
            Destroy(gameObject);
        }
    }
Пример #3
0
 // Start is called before the first frame update
 void Start()//Places player in the last checkpoint
 {
     rB         = GameObject.FindGameObjectWithTag("respawnBrain").GetComponent <RespawnBrain>();
     cC.enabled = false;
     //player.transform.position = rB.lastCheckpointPos;
     pC.Teleport(rB.lastCheckpointPos);
     cC.enabled = true;
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     rB = GameObject.FindGameObjectWithTag("respawnBrain").GetComponent <RespawnBrain>();
     if (SceneManager.GetActiveScene().buildIndex == 1)
     {
         height = rB.height;
     }
     else if (SceneManager.GetActiveScene().buildIndex == 2)
     {
         height = rB.height * 2.5f;
     }
 }
Пример #5
0
 // Start is called before the first frame update
 void Start()//pega checkpoint e vida inicial do jogador
 {
     rB             = GameObject.FindGameObjectWithTag("respawnBrain").GetComponent <RespawnBrain>();
     checkpointHeal = playCon.HP;
 }