Exemplo n.º 1
0
 void OnTriggerStay(Collider other)
 {
     if (IsDestroyOnCollision && other.attachedRigidbody && (other.gameObject.layer != gameObject.layer))
     {
         //apply damage here
         DamageData.ApplyDamage(other.attachedRigidbody.gameObject, DamageQty, Dir);
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
        public static void ApplyDamage(GameObject _obj, float _quantity, Vector2 _force = default(Vector2), eDmgType _type = eDmgType.NORMAL)
        {
            DamageData damageData = new DamageData()
            {
                Quantity = _quantity, Force = _force, Type = _type
            };

            damageData.ApplyDamage(_obj);
        }
Exemplo n.º 3
0
 public static void ApplyDamage( GameObject _obj, float _quantity, Vector2 _force = default(Vector2), eDmgType _type = eDmgType.NORMAL )
 {
     DamageData damageData = new DamageData(){ Quantity = _quantity, Force = _force, Type = _type };
     damageData.ApplyDamage( _obj );
 }