2024-02-03 11:42:50 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class PlayerAnimationHandler : MonoBehaviour
|
|
|
|
{
|
2024-02-04 05:40:23 +01:00
|
|
|
public Animator animator;
|
2024-02-03 20:04:50 +01:00
|
|
|
|
2024-02-03 11:42:50 +01:00
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
animator = GetComponentInChildren<Animator>();
|
2024-02-03 20:04:50 +01:00
|
|
|
}
|
2024-02-03 11:42:50 +01:00
|
|
|
|
2024-02-03 13:07:46 +01:00
|
|
|
public void Idle()
|
2024-02-03 11:42:50 +01:00
|
|
|
{
|
2024-02-03 13:07:46 +01:00
|
|
|
animator.SetTrigger("Idle");
|
2024-02-03 11:42:50 +01:00
|
|
|
}
|
2024-02-04 02:56:12 +01:00
|
|
|
public void Run(bool state)
|
2024-02-03 11:42:50 +01:00
|
|
|
{
|
2024-02-04 02:56:12 +01:00
|
|
|
animator.SetBool("IsRunning", state);
|
2024-02-03 11:42:50 +01:00
|
|
|
}
|
2024-02-04 05:40:23 +01:00
|
|
|
public void Swing(bool state)
|
2024-02-03 11:42:50 +01:00
|
|
|
{
|
2024-02-04 05:40:23 +01:00
|
|
|
animator.SetBool("IsSwinging", state);
|
2024-02-03 11:42:50 +01:00
|
|
|
}
|
2024-02-03 13:07:46 +01:00
|
|
|
public void Mop()
|
2024-02-03 11:42:50 +01:00
|
|
|
{
|
2024-02-03 13:07:46 +01:00
|
|
|
animator.SetTrigger("Mop");
|
2024-02-03 12:21:41 +01:00
|
|
|
}
|
2024-02-03 13:07:46 +01:00
|
|
|
public void RunMop()
|
2024-02-03 12:21:41 +01:00
|
|
|
{
|
2024-02-03 13:07:46 +01:00
|
|
|
animator.SetTrigger("RunMop");
|
2024-02-03 11:42:50 +01:00
|
|
|
}
|
|
|
|
}
|