void Equip_Gun(GameObject Gun)
 {
     if (Gun_Equipped == null)
     {
         Gun_Equipped                = Gun.GetComponent <MoveCrossHair>();
         Gun.transform.parent        = Hand.transform;
         Gun_Equipped.is_equipped    = true;
         Gun.transform.localPosition = new Vector2(0, 0);
     }
 }
예제 #2
0
 void ThrowLeft()
 {
     if (LeftGun_object != null)
     {
         if (this.gameObject.CompareTag("TopPlayer"))
         {
             LeftGun_object.pass_the_gun(1);
             LeftGun_object = null;
         }
         else
         {
             LeftGun_object.pass_the_gun(0);
             LeftGun_object = null;
         }
     }
 }
예제 #3
0
 void ThrowRight()
 {
     if (RightGun_object != null)
     {
         if (this.gameObject.CompareTag("TopPlayer"))
         {
             RightGun_object.pass_the_gun(1);
             RightGun_object = null;
         }
         else
         {
             RightGun_object.pass_the_gun(0);
             RightGun_object = null;
         }
     }
 }
예제 #4
0
    void Equip_Gun(GameObject Gun)
    {
        if (RightGun_object == null)
        {
            RightGun_object             = Gun.GetComponent <MoveCrossHair>();
            Gun.transform.parent        = Right_hand.transform;
            RightGun_object.is_equipped = true;
            Gun.transform.localPosition = new Vector2(0, 0);
        }

        else if (LeftGun_object == null)
        {
            LeftGun_object              = Gun.GetComponent <MoveCrossHair>();
            Gun.transform.parent        = left_hand.transform;
            LeftGun_object.is_equipped  = true;
            Gun.transform.localPosition = new Vector2(0, 0);
        }
    }