Esempio n. 1
0
 void OnHit(Thing thing)
 {
     thing.TakeDamage(damage, owner);
     if (gainBuff != null)
     {
         thing.AddBuff(Instantiate(gainBuff));
     }
     Destroy(gameObject);
 }
Esempio n. 2
0
 void Do()
 {
     Collider2D[] cols = Physics2D.OverlapCircleAll(transform.position, radius, layerMask);
     foreach (Collider2D col in cols)
     {
         Thing thing = col.GetComponent <Thing>();
         if (thing != null && thing.team != owner.team)
         {
             thing.TakeDamage(damage, owner);
             if (buff != null)
             {
                 thing.AddBuff(Instantiate(buff));
             }
         }
     }
     Destroy(gameObject);
 }
Esempio n. 3
0
 void Scan()
 {
     Collider2D[] cols = Physics2D.OverlapCircleAll(owner.transform.position, owner.col.radius * 4f, Utility.Instance.thingLayer);
     foreach (Collider2D col in cols)
     {
         Thing thing = col.GetComponent <Thing>();
         if (thing != null && thing.team != owner.team && !hitList.Contains(thing))
         {
             thing.TakeDamage(damage, owner);
             if (gainBuff != null)
             {
                 thing.AddBuff(Instantiate(gainBuff));
             }
             hitList.Add(thing);
         }
     }
 }