void Start() { pManager = FindObjectOfType <PlayerManager>(); korentoRB = GetComponent <Rigidbody2D>(); animator = GetComponentInChildren <Animator>(); state = KorentoState.Idle; scale = transform.localScale; currentFlightPoint = flightPoints[4]; }
IEnumerator Idle() { idleRunning = true; yield return(new WaitForSeconds(idleTime)); idleRunning = false; ChooseFlightPoint(); state = KorentoState.Dashing; }
void KorentoDash() { Vector3 korentoPos = korentoRB.position; korentoRB.position = Vector2.Lerp(korentoRB.position, currentFlightPoint.transform.position, dashSpeed * Time.deltaTime); var distance = Vector2.Distance(korentoPos, currentFlightPoint.transform.position); if (distance <= 0.2f) { state = KorentoState.Idle; } }
IEnumerator TakingDamage() { yield return(new WaitForSeconds(takingDMGTime)); state = KorentoState.Idle; }