コード例 #1
0
        // Update is called once per frame
        void Update()
        {
            velocityl = lefthand.GetComponent <VelocityEstimator>().speed;
            velocityr = righthand.GetComponent <VelocityEstimator>().speed;

            if (triggerButton.GetPressDown())
            {
                if (!bassState)
                {
                    GameObject.FindWithTag("27").GetComponent <Renderer> ().material = Light;
                    temp1        = GameObject.FindWithTag("27").GetComponent <AudioSource> ();
                    temp1.volume = 0.3f;
                    temp1.Play();
                    bassState = true;
                    Invoke("goBack", 0.1f);
                }
            }
            if (triggerButton.GetPressUp())
            {
                bassState = false;
            }

            if (triggerButton2.GetPressDown())
            {
                if (!bassStateStrong)
                {
                    GameObject.FindWithTag("27").GetComponent <Renderer> ().material = Light;
                    temp2        = GameObject.FindWithTag("27").GetComponent <AudioSource> ();
                    temp2.volume = 1.0f;
                    temp2.Play();
                    bassStateStrong = true;
                    Invoke("goBack", 0.1f);
                }
            }
            if (triggerButton2.GetPressUp())
            {
                bassStateStrong = false;
            }
        }