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); } }
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; } } }
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....."); } }