public void revivePlayer() { PlayerAnimate pa = this.GetComponent <PlayerAnimate>(); playermovement pm = this.GetComponent <playermovement>(); rotateToCursor rot = this.GetComponent <rotateToCursor>(); WeaponAttack wa = this.GetComponent <WeaponAttack>(); LegsDirection legDir = this.GetComponentInChildren <LegsDirection>(); wa.dropWeapon(); pa.legs.enabled = true; legDir.enabled = true; pa.enabled = true; rot.enabled = true; wa.enabled = true; pm.enabled = true; dead = false; }
void KillPlayer() { if (this.GetComponent <PlayerAnimate>().enabled == true) { PlayerAnimate pa = this.GetComponent <PlayerAnimate>(); playermovement pm = this.GetComponent <playermovement>(); rotateToCursor rot = this.GetComponent <rotateToCursor>(); WeaponAttack wa = this.GetComponent <WeaponAttack>(); LegsDirection legDir = this.GetComponentInChildren <LegsDirection>(); wa.dropWeapon(); pa.legs.sprite = null; pa.legs.enabled = false; legDir.enabled = false; pa.torso.sprite = deadSpr; pa.enabled = false; rot.enabled = false; wa.enabled = false; pm.enabled = false; BoxCollider2D col = this.GetComponent <BoxCollider2D>(); col.enabled = false; } }