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; } } }