Create a gist now

Instantly share code, notes, and snippets.

@YutaKaseda /Main
Last active Sep 12, 2016

public partial class Main{
public class State{
public State();
public void Action();
}
public State doState;
//どこかから呼ばれる
void Update(){
CheckState();
doState.Action();
}
CheckState(){
if(何か){
doState = new State1();
}
if(何か){
doState = new State2();
}
}
}
public partial class Main{
public class State1 : State{
public State1();
public override void Action();
}
}
public partial class Main{
public class State2 : State{
public State2();
public override void Action();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment