void Start() { playerAnimator = GetComponent <Animator>(); playerRigidBody = GetComponent <Rigidbody2D>(); playerIK2D = GetComponent <UnityEngine.U2D.IK.IKManager2D>(); almostDeadBleed = GetComponent <AlmostDeadBleed>(); pause = FindObjectOfType <Pause>(); slomoController = FindObjectOfType <SlomoController>(); cinemachineSwitcher = FindObjectOfType <CinemachineSwitcher>(); win = FindObjectOfType <Win>(); parallax = FindObjectOfType <Parallax>(); }
public void PlayerDamage(float damage) { if (alive && !win.levelClear) { playerAnimator.SetTrigger("TakingDamage"); health -= damage; if (health <= almostDeadhealth) { almostDeadBleed = FindObjectOfType <AlmostDeadBleed>(); almostDeadBleed.AlmostDeadBleeding(); } if (health <= 0) { Die(); } } }