public override bool Update() { bool result = true; switch (this.step) { case AdventureState.Step.INIT: this.Initialize(); this.step = AdventureState.Step.RUN; break; case AdventureState.Step.RUN: ClassSingleton <AdventureSceneData> .Instance.adventureScriptEngine.RunScript(); if (ClassSingleton <AdventureSceneData> .Instance.adventureScriptEngine.GetState() != AdventureScriptEngine.ScriptState.RUN) { this.step = AdventureState.Step.END; } break; case AdventureState.Step.END: this.resultCode = ResultCode.SUCCESS; result = false; break; default: this.resultCode = ResultCode.ERROR; result = false; break; } return(result); }
public AdventureState() { this.step = AdventureState.Step.INIT; }