示例#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();
                }
            }
        }
示例#2
0
 public void Start()
 {
     m_controller = gameObject.GetComponentInChildren <CharacterController>();
     m_guns       = gameObject.GetComponentsInChildren <Weapon>();
     m_damagable  = gameObject.GetComponent <Damagable>();
 }
示例#3
0
 public virtual void Start()
 {
     m_damagable = transform.GetComponent <Damagable>();
 }