Exemplo n.º 1
0
 void ActiveComplete()
 {
     if (FirstPersonControl.VR)
     {
         hero.HandUp();
         StartCoroutine(SelectSword(1F));
     }
     else
     {
         //StartCoroutine (SelectSword (15F));
     }
 }
Exemplo n.º 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;
                        }
                    }
                }
            }
        }
    }