예제 #1
0
파일: PopupBox.cs 프로젝트: suminc7/project
 void ActiveComplete()
 {
     if (FirstPersonControl.VR)
     {
         hero.HandUp();
         StartCoroutine(SelectSword(1F));
     }
     else
     {
         //StartCoroutine (SelectSword (15F));
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (FirstPersonControl.VR)
        {
            return;
        }

        if (!eyeCursor)
        {
            return;
        }

        if (!isSelected)
        {
            eyeCursor.Deactive();

            RaycastHit hit;
            if (Physics.Raycast(centerEyes.transform.position, centerEyes.transform.forward, out hit, 100))
            {
                if (hit.collider.gameObject.tag == "SelectWeponBox")
                {
                    eyeCursor.Active();

                    if (weponBox && hit.collider.gameObject != weponBox.gameObject)
                    {
                        weponBox.DeActiveWepon();
                        eyeCursor.fillAmount = 0f;
                    }

                    weponBox = hit.collider.gameObject.GetComponent <SelectWeponBox> ();
                    weponBox.ActiveWepon();

                    if (eyeCursor.fillAmount == 1f)
                    {
                        hero.HandUp();

                        if (eyeCursor.gameObject)
                        {
                            StartCoroutine(HandUpComplete(1f));
                            Destroy(eyeCursor.gameObject);
                            eyeCursor = null;
                        }
                    }
                }
            }
        }
    }