Пример #1
0
 void Start()
 {
     jumperTrans = GetComponent <Transform>();
     jumperRigi  = GetComponent <Rigidbody2D>();
     jumperPupp  = GetComponent <PuppetManip>();
     jumperAnim  = GetComponent <Animator>();
     jumpColl    = GetComponent <BoxCollider2D>();
 }
Пример #2
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         PuppetManip mnIp = other.GetComponent <PuppetManip>();     // Gets the exited object's puppit manip.
         mnIp.kill("fall");
     }
 }
Пример #3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player"))                          // if collided with a player.
     {
         PuppetManip mnIp = other.GetComponent <PuppetManip>();          //gets the collided players puppit manip.
         for (int i = 0; i < mnIp.guns.Length; ++i)
         {
             mnIp.guns[i].SetActive(false);                                  //sets all the guns in guns[] to inactive.
         }
         mnIp.guns[weaponIndex - 1].SetActive(true);                         //sets weaponindex as active weapon.
         Destroy(gameObject);
     }
 }