//감속 풀림 IEnumerator SlowPTime(float DelayTime) { yield return(new WaitForSeconds(DelayTime)); t_player_move player_move = GameObject.FindGameObjectWithTag("Player").GetComponent <t_player_move>(); float originSpeed = player_move.Speed; originSpeed = originSpeed + loseSpeed; player_move.getSpeed(originSpeed); slow = true; }
public float slowTime = 1f; //감속 지속시간 //감속 걸림 private void actSlow() { t_player_move player_move = GameObject.FindGameObjectWithTag("Player").GetComponent <t_player_move>(); float originSpeed = player_move.Speed; if (slow == true) { loseSpeed = originSpeed * slowRate; originSpeed *= (1 - slowRate); Debug.Log(originSpeed); player_move.getSpeed(originSpeed); slow = false; } else { } }