using UnityEngine;

public class PlayerAnimator : MonoBehaviour {
    public ColorMgr playerColorMgr;
    public Animator animator;
    public Transform mirrorTransform;

    public void SetRunning(bool isRunning) {
        animator.SetBool("Running", isRunning);
    }

    public void SetCanDash(bool canDash) {
        if(canDash) {
            playerColorMgr.SetDark();
        } else {
            playerColorMgr.SetLight();
        }
    }

    public void SetInAir(bool inAir) {
        animator.SetBool("InAir", inAir);
    }

    public void SetFallingFast(bool fallingFast) {
        animator.SetBool("FallingFast", fallingFast);
    }

    public void TriggerJump() {
        animator.SetTrigger("Jump");
    }

    public void ResetDashing() {
        animator.SetBool("DashRight", false);
        animator.SetBool("DashUpRight", false);
    }

    public void StartDashUp() {
        animator.SetBool("DashUpRight", true);
    }
    public void StartDashRight() {
        animator.SetBool("DashRight", true);
    }
    public void StartDashUpRight() {
        animator.SetBool("DashUpRight", true);
    }
    public void StartDashDown() {
        // InAir
    }
    public void StartDashDownRight() {
        // InAir
    }

    public void SetIsLookRight(bool lookRight) {
        mirrorTransform.localScale = new Vector3(lookRight?1:-1, 1, 1);
    }

    public void TriggerIntroLookUp() {
        animator.SetTrigger("IntroLookUp");
    }
}