Ejemplo n.º 1
0
        public void OnCollisionEnter(Collision col)
        {
            if (explodeOnContact)
            {
                Damagable dam = col.gameObject.GetComponent <Damagable>();

                if (dam)
                {
                    onHitTarget(dam);
                }
                if (aoe != -1)
                {
                    damageArea(transform.position, aoe);
                }
                {
                    removeMe();
                }
            }
        }
Ejemplo n.º 2
0
 public void Start()
 {
     m_controller = gameObject.GetComponentInChildren <CharacterController>();
     m_guns       = gameObject.GetComponentsInChildren <Weapon>();
     m_damagable  = gameObject.GetComponent <Damagable>();
 }
Ejemplo n.º 3
0
 public virtual void Start()
 {
     m_damagable = transform.GetComponent <Damagable>();
 }