Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if (leftHand == true)
        {
            handInt = 0;
            hand    = SteamVR_Input_Sources.LeftHand;
        }
        else
        {
            handInt = 1;
            hand    = SteamVR_Input_Sources.RightHand;
        }

        GameObject musicGo = GameObject.FindWithTag("Music");

        if (musicGo != null)
        {
            musicControl    = musicGo.GetComponent <MainGameMusicScript>();
            musicVolControl = musicGo.GetComponent <MusicVolumeControl>();
        }

        triggerBox   = GameObject.Find("MP3Trigger").GetComponent <MP3TriggerBox>();
        mp3Transform = triggerBox.transform.Find("MP3Player");
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        handTport[0] = GameObject.Find("[CameraRig]").transform.Find("Controller (left)").GetComponent <TeleportControl>();
        handTport[1] = GameObject.Find("[CameraRig]").transform.Find("Controller (right)").GetComponent <TeleportControl>();

        // Set up all buttons
        for (int i = 0; i < domHandButtons.Length; i++)
        {
            domHandButtons[i].Start();
        }

        // Get the default hand
        if (PlayerPrefs.GetInt("DomHand") == 1)
        {
            domHandButtons[0].Select();
        }
        else
        {
            domHandButtons[1].Select();
        }

        // Get the volume (Music always starts at 10 and PlayerPrefs give a - offset)
        musicVol  += PlayerPrefs.GetInt("MusicVol");
        prevVolVal = musicVol;

        // Set up the volume wheel
        if (prevVolVal == 0)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, -90);
        }
        if (prevVolVal == 1)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, -65);
        }
        if (prevVolVal == 2)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, -50);
        }
        if (prevVolVal == 3)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, -32);
        }
        if (prevVolVal == 4)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, -15);
        }
        if (prevVolVal == 5)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 0);
        }
        if (prevVolVal == 6)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 15);
        }
        if (prevVolVal == 7)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 32);
        }
        if (prevVolVal == 8)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 50);
        }
        if (prevVolVal == 9)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 65);
        }
        if (prevVolVal == 10)
        {
            volumeWheel.transform.localEulerAngles = new Vector3(0, 0, 90);
        }
        //musicVolText.text = musicVol.ToString();

        volControl = GameObject.Find("MainMenuMusic").GetComponent <MusicVolumeControl>();

        //calorieCounterButton.Start();
        // Turn on cal counter button if its has been told to be on in the past
        //int useCalCounterInt = PlayerPrefs.GetInt("UseCalorieCounter");
        //if (useCalCounterInt == 1)
        //	calorieCounterButton.SelectHighLight();

        //// Set up buttons for snapTele
        //for (int i = 0; i < weightUpDown.Length; i++)
        //	weightUpDown[i].Start();
    }