📅  最后修改于: 2022-03-11 14:48:41.329000             🧑  作者: Mango
sealed class CodeState {
public string stateName;
public CodeState(string stateName) {
this.stateName = stateName;
}
}
public static class VarsNStuff {
public static List states = new List() {new CodeState("Finished"),
new CodeState("Incomplete");
}
}
private class Test : MonoBehaviour {
private CodeState state = VarsNStuff.states[1];
public override void Update() {
if (this.state != VarsNStuff.states[0]{
//Do code.
foreach (dynamic state in VarsNStuff.states) {
if (this.state != state) {
this.state = state;
break;
} }
}
}
}