public void DestroyGameObject() { if (!player.HasPower()) { animator.SetBool("death", true); Destroy(gameObject, animationDeathTime); } }
/** On button click, set power true or false, depending on current boolean state**/ public void OnPointerClick(PointerEventData data) { if (player.HasPower()) { player.SetPower(false); } else { player.SetPower(true); } }