3 using System.Collections.Generic;
 
    8 [Script(ScriptRole.Logic)]
 
   17     void OnOutgoingHit(GameObject hitObject, 
HitInfo hit)
 
   25         foreach (var tag 
in Tags)
 
   27             if (hitObject.collider.CompareTag(tag))
 
   35     void OnCollisionEnter(Collision collision)
 
   37         if (collision.collider.GetComponent<
Vitals>() == null)
 
   45             foreach (var tag 
in Tags)
 
   47                 if (collision.collider.CompareTag(tag))
 
   56     void OnTriggerEnter(Collider other)
 
   58         if (!collider.isTrigger)
 
   61         if (other.collider.GetComponent<
Vitals>() == null)
 
   69             foreach (var tag 
in Tags)
 
   71                 if (other.collider.CompareTag(tag))
 
static void Despawn(GameObject go)
Despawn the given object. 
 
An object that should despawn when it collider with others. 
 
Describes a hit on an object. 
 
Manages the "vitals" of an object (health, regeneration, damage). 
 
List< string > Tags
A list of Tags. The object will only despawn if the collided object has one of these tags...
 
This class server two main functions: 1) As a MonoBehaviour, it allows for network synchronization of...