private Boolean SetNextState(CSIState newState) { bool success = false; if (newState != null) { CSIState _previousState = _currentState; // Old state gets notified it is changing out. if (_previousState != null) { //AppI_Debug.ShowMsg("setNextState Old:" + _previousState.ToString()); _previousState.Exit(); } //AppI_Debug.ShowMsg("setNextState Current: " + newState.ToString()); _currentState = newState; _nextState = null; if (_currentState != null) { //Note the time at which we entered this state. _enteredStateTime = TimeHelp.GetCurrentMS(); _currentState.Enter(this); success = true; } } else { AppI_Debug.ShowMsg("setNextState: ERROR:NULL STATE!"); success = false; } return(success); }
protected void thisEnter() { AppI_Debug.ShowMsg("BaseAct Controller proc_Main thisEnter"); MainRoot.GetUIMgr().HudCamPegs.gameObject.SetActive(true); MainRoot.GetUIMgr().HudQuads.gameObject.SetActive(true); MainRoot.GetUIMgr().HUDSpares.gameObject.SetActive(true); }
public CSIProc getProc(string name) { //handlers when the Procs returned here trying to be accessed are null if (controllerProcs.ContainsKey(name)) { return(controllerProcs[name] as CSIProc); } AppI_Debug.ShowMsg("ERROR! " + getCurrentProcessName() + " NO Controller for Proc: " + name); //bad proc return(null); }
protected void thisEnter() { AppI_Debug.ShowMsg("BaseAct Controller proc_Boot thisEnter"); SceneManager.sceneUnloaded += OnPlanetSceneUnloaded; ((BaseActController)actBase).planeObj.SetActive(true); ((BaseActController)actBase).terrainObj.SetActive(true); ((BaseActController)actBase).sunObj.SetActive(false); SceneManager.UnloadSceneAsync(MainRoot.GetAppConf().homeToLoad); }
public string getProcessName(CSIProc proc) { if (proc == null) { //AppI_Debug.ShowMsg("getProcessName: ERROR: PROC NULL!"); return("NULL"); } foreach (KeyValuePair <string, CSIProc> dictEntry in controllerProcs) { if (controllerProcs[dictEntry.Key] == proc) { return(dictEntry.Key); } } AppI_Debug.ShowMsg("getProcessName: ERROR: NOT FOUND! " + proc.GetProcessStateName()); return("NoControllerProc"); }
public CSIState GetState(string name) { //handlers when the states returned here trying to be accessed are null if (machineStates.ContainsKey(name)) { CSIState retState = machineStates[name] as CSIState; if (retState == null) { //error condition AppI_Debug.ShowMsg("getState: " + name + " ERROR: NULL!"); return(null); } return(retState); } //error condition AppI_Debug.ShowMsg("getState: " + name + " ERROR:NOT FOUND!"); return(null); }
//forced to by pass the queue public Boolean setNextProcNamed(string name) { Boolean retVal = false; CSIProc newProc = getProc(name); retVal = setNextProcess(newProc); if (newProc != null) { _currentProc.StopProcess(); newProc.StartProcess(); _currentProc = newProc; retVal = true; } if (retVal == false) { AppI_Debug.ShowMsg("Process Not Found Warning: " + name); } return(retVal); }
public bool EvaluateController() { bool retVal = true; if (_currentState != null) { _currentState.Evaluate(); if ((_currentState != _nextState) && (_nextState != null)) { SetNextState(_nextState); } //AppI_Debug.ShowMsg("Evaluate _currentState Parent: " + parentName + " Machine: " + machineName); } else { AppI_Debug.ShowMsg(string.Format("NULL _currentState evaluateController! Parent: {0} Machine: {1} State: {2}", parentName, machineName, GetCurrentStateName())); retVal = false; } //AppI_Debug.ShowMsg("Evaluate _currentState State : " + getCurrentStateName() + " Last : " + getPreviousStateName()); return(retVal); }
protected void thisEnter() { AppI_Debug.ShowMsg("BaseAct Controller proc_Exit thisEnter"); }