コード例 #1
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.tag == "Cowboy")
     {
         GunSpawn.RemoveIndicator(myTransform);
         Destroy(gameObject);
     }
 }
コード例 #2
0
 private void DestroyAllGuns()
 {
     GameObject[] guns = GameObject.FindGameObjectsWithTag("Gun");
     for (int i = 0; i < guns.Length; i++)
     {
         Destroy(guns[i]);
         GunSpawn.RemoveIndicator(guns[i].GetComponent <GunPickupDestroyer>().myTransform);
     }
 }