public void Damage() { if (buildStatus < buildMax) { buildStatus = 0; gameObject.layer = unbuiltLayer; animator.SetInteger("buildState", buildStatus); animator.SetTrigger("death"); CameraDirector.ScreenShake(0.5f); } else { CameraDirector.Danger(transform.position.y); CameraDirector.ScreenShake(0.5f); if (damageState) { Kill(); } else { damageState = true; animator.SetTrigger("damage"); } } }