private void CrowdControlCheck() { bool isPoison = false; ccArray = GetComponents <CrowdControl>(); if (ccArray.Length != 0) { float movespdFactor = 1f; float jumpspdFactor = 1f; foreach (CrowdControl cc in ccArray) { if (cc.Tag == poisonTag) { isPoison = true; } movespdFactor *= cc.movespdMultiplier; jumpspdFactor *= cc.jumpspdMultiplier; } NowSpeed = NowSpeed * movespdFactor; jumpSpeed = jumpSpeed * jumpspdFactor; } if (isPoison) { cm.ChangeLose(); } else { cm.ChangeIdle(); } }
public IEnumerator DeadAnimarter() { simpleButton.enabled = false; playerAnimator.SetBool("IsDead", true); playerCm.ChangeLose(); playerController.moveSpeed = 0f;//! Death = true; yield return(new WaitForSeconds(1.5f)); Death = false; simpleButton.enabled = true; playerAnimator.SetBool("IsDead", false); //playerController.moveSpeed = 45f;//! playerCm.ChangeIdle(); }