Example #1
0
 void Start()
 {
     pManager           = FindObjectOfType <PlayerManager>();
     korentoRB          = GetComponent <Rigidbody2D>();
     animator           = GetComponentInChildren <Animator>();
     state              = KorentoState.Idle;
     scale              = transform.localScale;
     currentFlightPoint = flightPoints[4];
 }
Example #2
0
    IEnumerator Idle()
    {
        idleRunning = true;
        yield return(new WaitForSeconds(idleTime));

        idleRunning = false;
        ChooseFlightPoint();
        state = KorentoState.Dashing;
    }
Example #3
0
    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;
        }
    }
Example #4
0
    IEnumerator TakingDamage()
    {
        yield return(new WaitForSeconds(takingDMGTime));

        state = KorentoState.Idle;
    }