public void Dispose() { for (int i = 0; i < 16; i += 1) { if (m_state_sink_array[i] != null) { m_state_sink_array[i] = null; } } m_state_sink_array.Clear(); int j = 0; while (j < 64) { if (m_state_array[j] != null) { m_state_array[j] = null; } j++; } this.m_state_array.Clear(); if (mAllStateListener != null) { mAllStateListener.Free(); mAllStateListener = null; } }
protected void ClearCallbackInfo() { if (this.m_listner != null) { this.m_listner.Free(); } this.m_listner = null; }
public void SetListener(LuaFunction enter_func, LuaFunction exit_func) { if (this.mAllStateListener != null) { this.mAllStateListener.Free(); this.mAllStateListener = null; } this.mAllStateListener = new ScriptAllStateListner(this, enter_func, exit_func); }
public GameState(GameStateMachine parent_machine, uint state_id, string state_name, ushort sink_id, StateComposeType sct) { this.m_parent_machine = parent_machine; this.m_state_id = state_id; this.m_state_name = state_name; this.m_sink_id = sink_id; this.m_compose_type = sct; this.m_action_flag = uint.MaxValue; this.m_can_re_enter = false; this.m_is_state_lock = false; this.m_listner = null; this.m_parent_state_id = ushort.MaxValue; }
public GameStateMachine() { mAllStateListener = null; //初始化分支 for (ushort i = 0; i < SINK_ID_CAPACITY; i++) { m_free_sink_id_list.Add(i); m_state_sink_array.Add(null); } //初始化状态 for (ushort i = 0; i < STATE_ID_CAPACITY; i++) { m_free_state_id_list.Add(i); m_state_array.Add(null); } }
public void SetCallbackAsCListner(IGameStateListner listner) { this.ClearCallbackInfo(); this.m_listner = listner; }