Ejemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     Debug.Log("Hit:" + col.gameObject.name);
     if (col.gameObject != Source)
     {
         LivingThing livingThing = col.gameObject.GetComponent <LivingThing>();
         if (livingThing != null)
         {
             livingThing.Die(); // OOF
         }
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     Debug.Log("Hit:" + col.gameObject.name);
     if (col.gameObject != Source)
     {
         LivingThing livingThing = col.gameObject.GetComponent <LivingThing>();
         if (livingThing != null)
         {
             livingThing.Die(); // OOF
             Destroy(gameObject);
         }
         FireBall fb = col.gameObject.GetComponent <FireBall>();
         if (fb != null)
         {
             LivedTime -= LifeTime * (2 * (GrowthSpeed - 1));
             gameObject.transform.localScale *= GrowthSpeed;
         }
     }
 }
Ejemplo n.º 3
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (Source != null)
     {
         Debug.Log("Hit:" + col.gameObject.name);
         if (col.gameObject != Source && col.GetComponent <Scatter>() == null)
         {
             LivingThing livingThing = col.gameObject.GetComponent <LivingThing>();
             if (livingThing != null)
             {
                 livingThing.Die(); // OOF
             }
             Destroy(gameObject);
         }
     }
     else
     {
         Debug.Log("Source was null.....");
     }
 }