LMQT/Assets/Scripts/gujin.cs
2024-12-10 09:03:45 +08:00

55 lines
997 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class gujin : MonoBehaviour
{
public Animator animator;
private int middle;
// Start is called before the first frame update
void Start()
{
middle = 2;
}
public void Front()
{
if(middle == 1)
{
animator.Play("gj1-3");
middle = 3;
}
else if(middle == 2)
{
animator.Play("gj1-2");
middle = 1;
}
else if(middle == 3)
{
animator.Play("gj1-1");
middle = 2;
}
}
public void Back()
{
if (middle == 1)
{
animator.Play("gj2-2");
middle = 2;
}
else if (middle == 2)
{
animator.Play("gj2-1");
middle = 3;
}
else if (middle == 3)
{
animator.Play("gj2-3");
middle = 1;
}
}
}