Ejemplo n.º 1
0
 private void DropItem()
 {
     if (Physics.Raycast(ray, out hit, Mathf.Infinity) && hit.collider.gameObject.tag == "ground")
     {
         hand.DropItem(hit.point);
     }
 }
    public void ToggleActiveGestures()
    {
        switch (hand.getState())
        {
        case HandState.Holding:
        {
            //Drop what you are holding at the hands location
            hand.DropItem(Camera.main.transform.position + HandGestureUtils.handOffset());
            break;
        }

        default:    //Only allow to use magic when not holding something or Idle
        {
            foreach (MonoBehaviour c in components)
            {
                c.enabled = !c.enabled;
            }

            //Toggle magic
            magic = !magic;

            //Toggle the Magic Particles on the MagicCamera
            if (magic && particles != null)
            {
                ActivateBorder();
            }
            else
            {
                DeactivateBorder();
            }
            break;
        }
        }
    }