private void GotoSubState(SubState state, SlidingSide fromSide, bool tween = true) { InactivityHandler.UpdateActivity(); if (state == SubState.GodSelection) { GodSelectionState godSelectionState = new GodSelectionState(); godSelectionState.onGodSelected = (Action <God>)Delegate.Combine(godSelectionState.onGodSelected, new Action <God>(OnGodSelected)); m_ui.SetStateIndex(0, tween); BaseFightSelectionState baseFightSelectionState = godSelectionState; m_ui.returnButton.set_interactable(false); baseFightSelectionState.fromSide = fromSide; baseFightSelectionState.onUIOpeningFinished = OnChildUIOpeningFinished; this.SetChildState(baseFightSelectionState, 0); return; } throw new ArgumentOutOfRangeException("state", state, null); }
public void GotoPreviousState(StateContext currentChildState) { BaseFightSelectionState baseFightSelectionState = currentChildState as BaseFightSelectionState; if (baseFightSelectionState != null) { baseFightSelectionState.toSide = SlidingSide.Right; } if (currentChildState is GodSelectionState) { ConnectionHandler.instance.Disconnect(); this.get_parent().SetChildState(new LoginStateDemo(), 0); } else { Log.Error("We don't know where we are, this Should not happend", 330, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Demo\\Code\\States\\MainStateDemo.cs"); } }