void OnTargetLost(ImageTargetBaseBehaviour behaviour) { ARModal arModal = ARModal.Instance(); WKStaticFunction.WKMessageLog("Lost " + arModal.GetNameObjectFound + " : " + Target.Id); HideObjects(transform); }
public void PerformTransition(TRANSITION transition) { if (transition == TRANSITION.NullTransition) { WKStaticFunction.WKMessageError("the transition is null"); return; } STATE_ID stateID = _CurrentState.GetState(transition); if (stateID == STATE_ID.NullStateID) { WKStaticFunction.WKMessageError("the state of transition is null ::" + _CurrentState.ID.ToString() + transition.ToString()); return; } _CurrentStateID = stateID; STATE_ID previousState = _CurrentState.ID; foreach (FSMState state in _States) { if (state.ID == _CurrentStateID) { _CurrentState.OnLeave(); _CurrentState = state; _CurrentState._PreviousState = previousState; _CurrentState.OnEnter(); break; } } }
public void AddState(FSMState stateToAdd) { if (stateToAdd == null) { WKStaticFunction.WKMessageError("there is no state to add"); } stateToAdd.SetFSMCaller(_Caller); if (_States.Count == 0) { _States.Add(stateToAdd); _CurrentState = stateToAdd; _CurrentStateID = stateToAdd.ID; _CurrentState.OnEnter(); return; } foreach (FSMState state in _States) { if (state.ID == stateToAdd.ID) { WKStaticFunction.WKMessageError("state is already there"); return; } } _States.Add(stateToAdd); }
public void On3DAction() { WKStaticFunction.WKMessageLog("Close3D"); ARModal arModal = ARModal.Instance(); arModal.OnClose3D(); }
public void PlayVideoAction() { WKStaticFunction.WKMessageLog("Play Video"); AppRuntime appRuntime = _FSMCaller as AppRuntime; appRuntime.SetTransition(TRANSITION.TRANSITION_TO_VIDEOTUTORIALSTATE); }
private void StartAction() { WKStaticFunction.WKMessageLog("Start on Click"); AppRuntime appRuntime = _FSMCaller as AppRuntime; appRuntime.SetTransition(TRANSITION.TRANSITION_TO_ARSTATE); }
public override void OnEnter() { WKStaticFunction.WKMessageLog("Enter ARState"); ARModal arModal = ARModal.Instance(); arModal.OpenModal(); arModal.OnRegisterModal(PlayVideoAction, On3DAction); base.OnEnter(); }
public override void OnEnter() { WKStaticFunction.WKMessageLog("Enter VideoState"); VideoTutorialModal videoModal = VideoTutorialModal.Instance(); videoModal.OpenModal(); base.OnEnter(); }
public override void OnLeave() { WKStaticFunction.WKMessageLog("Leave ARState"); VideoTutorialModal videoModal = VideoTutorialModal.Instance(); videoModal.CloseModal(); base.OnLeave(); }
public override void OnLeave() { WKStaticFunction.WKMessageLog("Leave ARState"); HomeModal homeModal = HomeModal.Instance(); homeModal.CloseModal(); base.OnLeave(); }
public override void OnLeave() { WKStaticFunction.WKMessageLog("Leave ARState"); ARModal arModal = ARModal.Instance(); arModal.UnRegisterModal(); arModal.CloseModal(); base.OnLeave(); }
public override void OnEnter() { WKStaticFunction.WKMessageLog("Enter HomeState"); CreatePlayerModal createPlayer = CreatePlayerModal.Instance(); createPlayer.OpenModal(); //HomeModal homeModal = HomeModal.Instance(); //homeModal.OpenModal(); //homeModal.OnRegisterModal(StartAction); base.OnEnter(); }
// set the transition so the things in the app gonna call this to transition from one state //To another public void SetTransition(TRANSITION transition) { if (_FSM != null) { _FSM.PerformTransition(transition); } else { WKStaticFunction.WKMessageError("there is no fsm system in the app"); MakeFSM(); } }
public static ARModal Instance() { if (_Instance == null) { _Instance = GameObject.FindObjectOfType <ARModal>(); if (_Instance == null) { WKStaticFunction.WKMessageError("there is no ARModal in the system"); } } return(_Instance); }
public void DeleteTransition(TRANSITION transition) { if (transition == TRANSITION.NullTransition) { WKStaticFunction.WKMessageError("The Transition is null, or not fully initialized"); return; } if (_Map.ContainsKey(transition)) { _Map.Remove(transition); return; } WKStaticFunction.WKMessageLog("The Transition is not on the transition _Map"); }
public void DeleteState(STATE_ID stateID) { if (stateID == STATE_ID.NullStateID) { WKStaticFunction.WKMessageError("the state id is null"); return; } foreach (FSMState state in _States) { if (state.ID == stateID) { _States.Remove(state); return; } } WKStaticFunction.WKMessageError("the state is not found in the fsm map"); }
void Awake() { if (Instance == null) { Instance = this; if (Instance == null) { Instantiate(Instance); WKStaticFunction.WKMessageError("error when trying to create singleton"); } DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public void AddTransition(TRANSITION Transition, STATE_ID StateID) { if (Transition == TRANSITION.NullTransition) { WKStaticFunction.WKMessageError("The Transition is error"); return; } if (StateID == STATE_ID.NullStateID) { WKStaticFunction.WKMessageError("The State is error"); return; } if (_Map.ContainsKey(Transition)) { WKStaticFunction.WKMessageError("The FSM already have this transition for state"); return; } _Map.Add(Transition, StateID); }
private void JSONAction(string jsonString) { Debug.Log("asyjdhfguoyasdvfyuavsfajhsdvftauyvsdftgasdfbabwfyuasdbfhjbsdbbbbbbbb"); WKStaticFunction.WKMessageLog(jsonString); }
public void StartParsing(EJSONType jsonType, UnityAction <string> unityAction) { string jsonName = WKStaticFunction.GetJSONName(jsonType); StartCoroutine(StartParsingCourotine(jsonName, jsonType, unityAction)); }