using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class State1 : MonoBehaviour {
enum State
{
state1,
state2,
state3
}
State nowState = State.state1;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
switch (nowState)
{
case State.state1:
Fun1("1111");
break;
case State.state2:
Fun1("2222");
break;
case State.state3:
Fun1("3333");
break;
}
if (Input.GetKey(KeyCode.Q))
{
nowState = State.state1;
}
if (Input.GetKey(KeyCode.W))
{
nowState = State.state2;
}
if (Input.GetKey(KeyCode.E))
{
nowState = State.state3;
}
}
void Fun1(string st)
{
Debug.Log(st);
}
}