Inheritance: MonoBehaviour
Exemple #1
0
 public static GrabbingHand GrabbingHand()
 {
     if (grabbingHand == null)
     {
         grabbingHand = GameObject.Find("[CameraRig]").GetComponentInChildren <GrabbingHand>();
     }
     return(grabbingHand);
 }
    //총알을 복제해서 손바닥에서 나가게 하는 코드
    void FirePoint()
    {
        gh = GameObject.Find("LRigidHand(Clone)").GetComponentInChildren <GrabbingHand>();
        v  = GameObject.Find("LRigidHand(Clone)").GetComponentsInChildren <Transform>();

        foreach (Transform child in v)
        {
            delayTimer += Time.deltaTime;
            if (child.name.Contains("palm") && gh.GetPinchState().Equals(GrabbingHand.PinchState.kPinched) && delayTimer > shootDelayTime)
            {
                cloneBullet = (GameObject)Instantiate(bullet, child.position, Quaternion.LookRotation(Vector3.forward));
                delayTimer  = 0f;
            }
        }
    }