public UIWindow GetAnyShowWindow(UIWindowGroup group, UIWindow exludeWindow) { if (Instance == null) { return(null); } List <UIWindow> wins = Instance.m_WindowList; for (int index = 0; index < wins.Count; ++index) { UIWindow win = wins[index]; if (win.windowGroup == group && win.IsShow()) { if (exludeWindow != null && exludeWindow == win) { continue; } return(win); } } return(null); }
//--------------------------------------------------------------------- public static void HideGroup(UIWindowGroup winGroup, Action <object> handler, params object[] data) { string s = null; HideGroup(winGroup, s, handler, data); }
//--------------------------------------------------------------------- public int GetShowCount(UIWindowGroup group, bool includeHiding) { if (Instance == null) { return(0); } List <UIWindow> wins = Instance.m_WindowList; int currentShowCount = 0; for (int index = 0; index < wins.Count; ++index) { UIWindow win = wins[index]; if (win.windowGroup == group && win.IsShow()) { if (!includeHiding && win.IsHiding()) { continue; } currentShowCount++; } } return(currentShowCount); }
//--------------------------------------------------------------------- public void AddMutexGroup(UIWindowGroup group) { if (!ms_MutexGroups.Contains(group)) { ms_MutexGroups.Add(group); } }
public void ShutdownGroup(UIWindowGroup group, List <string> excludeList) { if (excludeList != null) { for (int i = 0; i < excludeList.Count; ++i) { excludeList[i] = excludeList[i]; } } UIWindow[] windows = Windows(group); for (int index = 0; index < windows.Length; ++index) { string winName = windows[index].WindowName; if (excludeList != null && excludeList.Contains(winName)) { continue; } if (!Shutdown(winName)) { LOG.Warning("Shutdown '" + winName + "' failed."); } } }
//--------------------------------------------------------------------- public static void ShowGroup(UIWindowGroup winGroup, Action <object> handler, params object[] data) { List <UIWindow> winList = Instance.m_WindowList; int totalWinCount = winList.Count; int alreadyWindowCount = 0; for (int index = 0; index < winList.Count; ++index) { UIWindow win = winList[index]; if (win.windowGroup == winGroup) { if (handler == null) { win.Show(); continue; } Action postShowHandler = null; postShowHandler = delegate() { win.PostShowEvent -= postShowHandler; alreadyWindowCount++; if (alreadyWindowCount >= totalWinCount) { handler(data); } }; win.PostShowEvent += postShowHandler; win.Show(); } } }
public OpenUIWindowInfo(int serialId, UIWindowGroup uiWindowGroup, bool pauseCovered, UIWindowContext uiWindowContext) { this.serialId = serialId; this.uiWindowGroup = uiWindowGroup; this.pauseCovered = pauseCovered; this.uiWindowContext = uiWindowContext; }
//--------------------------------------------------------------------- public void RemoveRollbackGroup(UIWindowGroup group) { if (Instance == null) { return; } Instance.m_RollbackGroupList.Remove(group); }
//--------------------------------------------------------------------- public UIWindow[] Windows(UIWindowGroup group) { if (Instance == null) { return(null); } return(Instance.GetWindows(group)); }
//--------------------------------------------------------------------- public void AddRollbackGroup(UIWindowGroup group) { if (Instance == null) { return; } if (!Instance.m_RollbackGroupList.Contains(group)) { Instance.m_RollbackGroupList.Add(group); } }
//--------------------------------------------------------------------- private UIWindow[] GetWindows(UIWindowGroup group) { List <UIWindow> windows = new List <UIWindow>(); for (int index = 0; index < Instance.m_WindowList.Count; ++index) { UIWindow win = Instance.m_WindowList[index]; if (win.windowGroup == group) { windows.Add(win); } } return(windows.ToArray()); }
public static void HideGroup(UIWindowGroup winGroup, string exclusiveWinName) { HideGroup(winGroup, exclusiveWinName, null, null); }
//--------------------------------------------------------------------- public static void ShowGroup(UIWindowGroup winGroup) { ShowGroup(winGroup, null, null); }
//--------------------------------------------------------------------- public void ShutdownGroup(UIWindowGroup group) { ShutdownGroup(group, null); }
//--------------------------------------------------------------------- public void ClearMutexGroup(UIWindowGroup group) { ms_MutexGroups.Clear(); }
//--------------------------------------------------------------------- public bool ContainsMutexGroup(UIWindowGroup group) { return(ms_MutexGroups.Contains(group)); }
//--------------------------------------------------------------------- //private bool PlayWindowAnimation(RequestType nextRequest, bool isShow) { // RequestBatch batch = LastRequestBatch(); // if (batch != null) { // // Only one animation playing. // if (batch.type == RequestType.ShowAnimation || // batch.type == RequestType.HideAnimation) { // return false; // } // } // RequestType requestType = isShow ? // RequestType.ShowAnimation : RequestType.HideAnimation; // int totalAnimationCount = 0; // AnimationOrTween.Trigger conditionTrigger = isShow ? // AnimationOrTween.Trigger.OnActivateTrue : // AnimationOrTween.Trigger.OnActivateFalse; // for (int index = 0; index < m_WindowAnimations.Length; ++index) { // UIPlayTween playTween = m_WindowAnimations[index]; // if (playTween.trigger != conditionTrigger || // !playTween.enabled || !playTween.gameObject.activeSelf || // playTween.tweenTarget == null) { // continue; // } // UITweener[] childTweens = null; // if (playTween.includeChildren) { // childTweens = playTween.tweenTarget.GetComponentsInChildren<UITweener>(); // } else { // childTweens = playTween.tweenTarget.GetComponents<UITweener>(); // } // int ownTweenerCount = 0; // for (int i = 0; i < childTweens.Length; ++i) { // if (childTweens[i].tweenGroup == playTween.tweenGroup) { // ownTweenerCount++; // } // } // if (ownTweenerCount == 0) { // continue; // } // ++totalAnimationCount; // EventDelegate finishedCallback = null; // object[] lastDataArray = null; // if (requestDataArray != null && requestDataArray.Length != 0) { // lastDataArray = new object[requestDataArray.Length]; // Array.Copy(requestDataArray, lastDataArray, lastDataArray.Length); // } // finishedCallback = new EventDelegate(delegate() { // playTween.onFinished.Remove(finishedCallback); // --totalAnimationCount; // if (totalAnimationCount <= 0) { // RemoveRequestBatch(requestType); // PushRequest(nextRequest, lastDataArray); // } // }); // playTween.onFinished.Add(finishedCallback); // } // if (totalAnimationCount == 0) { // return false; // } // PushRequest(requestType, requestDataArray); // // iTween toggle message // gameObject.SendMessage("OnActivate", isShow, // SendMessageOptions.DontRequireReceiver); // return true; //} //--------------------------------------------------------------------- public int GetPanelDepth(UIWindowGroup group) { return(10 * (int)group); }
//--------------------------------------------------------------------- public static void HideGroup(UIWindowGroup winGroup) { string s = null; HideGroup(winGroup, s, null, null); }