public override void TriggerTile(Lemming lemming) { if (GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Level>().DidVolcanoErupt[transform.position]) { return; } Instantiate(explosion, transform.position, transform.rotation); GetComponent <AudioSource>().PlayOneShot(GetComponent <AudioSource>().clip); lemming.Health -= directDamage; GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Level>().DidVolcanoErupt[transform.position] = true; foreach (GameObject collateralDamage in GameObject.FindGameObjectsWithTag("Lemming")) { if ((collateralDamage.transform.position - transform.position).magnitude < 2.1) { collateralDamage.GetComponent <Lemming>().Health -= indirectDamage; } } }
public override void TriggerTile(Lemming lemming) { GetComponent<AudioSource>().PlayOneShot(GetComponent<AudioSource>().clip); lemming.Health -= damage; }
public virtual void TriggerTile(Lemming lemming) { }