// Token: 0x0600089A RID: 2202 RVA: 0x00025F6C File Offset: 0x0002416C public bool SetActionForUIStateFinshed(string stateName, Action action) { UIStateDesc uistateDescByName = this.GetUIStateDescByName(stateName); if (uistateDescByName == null) { return(false); } uistateDescByName.m_eventFinished = action; return(true); }
// Token: 0x06000898 RID: 2200 RVA: 0x00025EB4 File Offset: 0x000240B4 public void OnStateExit(string stateName) { UIStateDesc uistateDescByName = this.GetUIStateDescByName(stateName); if (uistateDescByName == null) { global::Debug.LogError(string.Format("OnStateExit() receive a unknown stateName: {0}.", stateName)); return; } if (this.m_currUIState != uistateDescByName) { global::Debug.LogError(string.Format("Current state is not: {0}.", stateName)); return; } uistateDescByName.AnimationFinished = true; if (uistateDescByName.TweenFinished && CommonUIStateController.m_onUIStateEndEvent != null) { CommonUIStateController.m_onUIStateEndEvent(base.gameObject, stateName); } }
// Token: 0x06000893 RID: 2195 RVA: 0x00025618 File Offset: 0x00023818 public void SetToUIState(string stateName, bool notPlayTweens = false, bool allowToRefreshSameState = true) { UIStateDesc uistateDescByName = this.GetUIStateDescByName(stateName); if (uistateDescByName == null) { global::Debug.LogError(string.Format("CommonUIStateController::SetToUIState UIState Find Fail: GoName:{0} stateName:{1}", base.gameObject.name, stateName)); return; } if (this.m_currUIState != null && this.m_currUIState.StateName == stateName && !allowToRefreshSameState) { return; } this.m_currUIState = uistateDescByName; UIStateDesc currUIState = this.m_currUIState; bool flag = false; this.m_currUIState.TweenFinished = flag; currUIState.AnimationFinished = flag; if (!this.isGathed) { this.ReGatherDynamicGo(); } foreach (GameObject gameObject in this.DisableGoList) { gameObject.SetActive(false); } foreach (UIStateDesc uistateDesc in this.UIStateDescList) { if (uistateDesc.StateName == stateName) { foreach (GameObject gameObject2 in uistateDesc.SetToShowGameObjectList) { if (gameObject2 != null) { gameObject2.SetActive(true); } } if (uistateDesc.StateColorSetIndex >= 0 && this.UIStateColorSetList.Count > 0 && uistateDesc.StateColorSetIndex < this.UIStateColorSetList.Count) { ColorSetDesc colorSetDesc = this.UIStateColorSetList[uistateDesc.StateColorSetIndex]; this.ChangeToColor(colorSetDesc.UIStateColorDescList); this.NotifyColorChanged(colorSetDesc.UIStateColorDescList); } if (this.AnimationController == null) { this.OnStateExit(this.m_currUIState.StateName); } if (uistateDesc.TweenAnimationList.Count == 0 || notPlayTweens) { this.OnAllUIStateTweensFinished(); } else { foreach (TweenMain tweenMain in uistateDesc.TweenAnimationList) { if (!(tweenMain == null)) { tweenMain.gameObject.SetActive(true); } } foreach (TweenMain tweenMain2 in uistateDesc.TweenAnimationList) { if (!(tweenMain2 == null)) { tweenMain2.ResetToBeginning(); tweenMain2.PlayForward(); } } foreach (TweenMain tweenMain3 in this.m_allTweens) { if (!(tweenMain3 == null)) { if (!uistateDesc.TweenAnimationList.Contains(tweenMain3)) { tweenMain3.enabled = false; } } } } if (this.AnimationController != null) { this.AnimationController.SetTrigger(uistateDesc.StateName); this.AnimationController.Update(0f); } } } }