public void Set(bool state) { if (tabRoot != null && state) { UITab[] cbs = tabRoot.GetComponentsInChildren <UITab>(true); for (int i = 0, imax = cbs.Length; i < imax; ++i) { UITab cb = cbs[i]; if (cb != this && cb.tabRoot == tabRoot) { cb.Set(false); cb.mChecked = false; } } } mChecked = state; for (int i = 0; i < tabSprite.Length; i++) { if (tabSprite[i] != null) { TweenAlpha.Begin(tabSprite[i].gameObject, 0.15f, mChecked ? 1f : 0f); } } if (state) { DispatcherEvents(); } }
public void Set(bool state) { if (this.tabRoot != null && state) { UITab[] componentsInChildren = this.tabRoot.GetComponentsInChildren <UITab>(true); int i = 0; int num = componentsInChildren.Length; while (i < num) { UITab uITab = componentsInChildren[i]; if (uITab != this && uITab.tabRoot == this.tabRoot) { uITab.Set(false); uITab.mChecked = false; } i++; } } this.mChecked = state; for (int j = 0; j < this.tabSprite.Length; j++) { if (this.tabSprite[j] != null) { TweenAlpha.Begin(this.tabSprite[j].gameObject, 0.15f, (!this.mChecked) ? 0f : 1f); } } this.DispatcherEvents(); }