示例#1
0
 public override void Highlight()
 {
     Highlighted = !Highlighted;
     HighlightBorder.SetActive(Highlighted);
     UpArrow.SetActive(Highlighted);
     DownArrow.SetActive(Highlighted);
 }
示例#2
0
 private void Awake()
 {
     Highlighted = false;
     HighlightBorder.SetActive(false);
     UpArrow.SetActive(false);
     DownArrow.SetActive(false);
 }
 public void Highlight()
 {
     Highlighted = !Highlighted;
     HighlightBorder.SetActive(Highlighted);
     UpArrow.SetActive(Highlighted);
     DownArrow.SetActive(Highlighted);
     FinishIndicator.SetActive(Highlighted);
 }
示例#4
0
    // Update is called once per frame
    void Update()
    {
        if (!end)
        {
            if (!GlobalAudioSrc.Instance.audioSrc.isPlaying)
            {
                time += Time.deltaTime;
                if (time >= MsgInterval)
                {
                    PlayVoice();
                }
            }
            else
            {
                time = 0;
            }

            if (Vr_Player.transform.localPosition.z > 0.5f && !FrontPoint)
            {
                FrontPoint = true;
                time       = 0;
                UpArrow.SetActive(false);
                DownArrow.SetActive(true);
            }

            if (FrontPoint && !BackPoint && Vr_Player.transform.localPosition.z == 0)
            {
                BackPoint = true;
                time      = 0;
                DownArrow.SetActive(false);
            }



            if (Input.GetAxisRaw("Vertical") > 0)
            {
                time = 0;
                StopVoice();
                Rocker.localRotation = Quaternion.Euler(new Vector3(0, 0, -15));
                Vr_Player.transform.localPosition += new Vector3(0, 0, Time.deltaTime);
                Vr_Player.transform.localPosition  = new Vector3(Vr_Player.transform.localPosition.x, Vr_Player.transform.localPosition.y, Mathf.Clamp(Vr_Player.transform.localPosition.z, 0, 5));
            }
            else if (Input.GetAxisRaw("Vertical") < 0)
            {
                time = 0;
                StopVoice();
                Rocker.localRotation = Quaternion.Euler(new Vector3(0, 0, 15));
                Vr_Player.transform.localPosition -= new Vector3(0, 0, Time.deltaTime);
                Vr_Player.transform.localPosition  = new Vector3(Vr_Player.transform.localPosition.x, Vr_Player.transform.localPosition.y, Mathf.Clamp(Vr_Player.transform.localPosition.z, 0, 5));
            }
            else
            {
                Rocker.localRotation = Quaternion.Euler(new Vector3(0, 0, 0));
            }

            if (FrontPoint == true && BackPoint == true)
            {
                time = 0;
                Rocker.localRotation = Quaternion.Euler(new Vector3(0, 0, 0));
                anim.enabled         = true;
                anim.SetTrigger("WellDone");
                end = true;
            }
        }
    }