private void OnDestroy() { #if !UNITY_EDITOR try { #endif s_MainBtn = null; EventDispatcher.Instance.RemoveEventListener(UIEvent_PlayMainUIBtnAnimEvent.EVENT_TYPE, OnEvent_RunAnim); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
//固定帧数刷新动画 private void Start() { #if !UNITY_EDITOR try { #endif return; mainScreenButton = gameObject.GetComponent <MainScreenButtonFrame>(); BtnOffset = mainScreenButton.mLenth; if (mainScreenButton == null) { Logger.Log2Bugly(" myMainUiButtonLogic == null"); return; } s_MainBtn = this; buttonDict.Add(0, mainScreenButton.BtnList1); buttonDict.Add(1, mainScreenButton.BtnList2); buttonDict.Add(2, mainScreenButton.BtnList3); buttonDict.Add(3, mainScreenButton.BtnList4); if (GameSetting.Instance.EnableNewFunctionTip == true) { if (!s_isInit) { s_isInit = true; var root = mainScreenButton.BtnList1[0].gameObject.transform.root.GetComponent <UIRoot>() .gameObject.transform; { // foreach(var go in myMainUiButtonLogic.BtnList1) var __enumerator1 = (mainScreenButton.BtnList1).GetEnumerator(); while (__enumerator1.MoveNext()) { var go = __enumerator1.Current; { var goTransform = go.transform; var p = root.InverseTransformPoint(goTransform.position); s_NamePosList.Add(go.name, p); p = root.InverseTransformPoint(goTransform.parent.position); s_ButtonPosList.Add(go.name, p); } } } { // foreach(var go in myMainUiButtonLogic.BtnList2) var __enumerator2 = (mainScreenButton.BtnList2).GetEnumerator(); while (__enumerator2.MoveNext()) { var go = __enumerator2.Current; { var goTransform = go.transform; var p = root.InverseTransformPoint(goTransform.position); s_NamePosList.Add(go.name, p); p = root.InverseTransformPoint(goTransform.parent.position); s_ButtonPosList.Add(go.name, p); } } } { // foreach(var go in myMainUiButtonLogic.BtnList3) var __enumerator3 = (mainScreenButton.BtnList3).GetEnumerator(); while (__enumerator3.MoveNext()) { var go = __enumerator3.Current; { var goTransform = go.transform; var p = root.InverseTransformPoint(goTransform.position); s_NamePosList.Add(go.name, p); p = root.InverseTransformPoint(goTransform.parent.position); s_ButtonPosList.Add(go.name, p); } } } { // foreach(var go in myMainUiButtonLogic.BtnList4) var __enumerator4 = (mainScreenButton.BtnList4).GetEnumerator(); while (__enumerator4.MoveNext()) { var go = __enumerator4.Current; { var goTransform = go.transform; var p = root.InverseTransformPoint(goTransform.position); s_NamePosList.Add(go.name, p); p = root.InverseTransformPoint(goTransform.parent.position); s_ButtonPosList.Add(go.name, p); } } } } { // foreach(var table in GameLogic.Instance.GuideTrigger.NewFunction) var __enumerator7 = (GameLogic.Instance.GuideTrigger.NewFunction).GetEnumerator(); while (__enumerator7.MoveNext()) { var table = __enumerator7.Current; { //判断哪些新系统是开放的 if (-1 == table.FlagPrepose || PlayerDataManager.Instance.GetFlag(table.FlagPrepose)) { //判断标记位 continue; } foreach (var pair in buttonDict) { foreach (var btn in pair.Value) { if (0 == btn.gameObject.name.CompareTo(table.Name)) { pair.Value.Remove(btn); break; } } } } } } { // foreach(var pair in mRelationship) var __enumerator10 = (buttonDict).GetEnumerator(); while (__enumerator10.MoveNext()) { var pair = __enumerator10.Current; { foreach (var go in pair.Value) { var btn = go.GetComponentInChildren <UIButton>(); if (null != btn) { var next = btn.gameObject.GetComponent <OnClickNextGuide>(); if (null == next) { next = btn.gameObject.AddComponent <OnClickNextGuide>(); } next.GuideStepList.Clear(); foreach (var table in GameLogic.Instance.GuideTrigger.NewFunction) { if (0 == table.Name.CompareTo(go.name)) { next.GuideStepList.Add(table.Flag); break; } } } } } } } { // foreach(var pair in mRelationship) var __enumerator11 = (buttonDict).GetEnumerator(); while (__enumerator11.MoveNext()) { var pair = __enumerator11.Current; { if (0 == pair.Value.Count) { mainScreenButton.BtnList[pair.Key].gameObject.SetActive(false); } } } } /* * myMainUiButtonLogic.BtnList[0].gameObject.SetActive(false); * myMainUiButtonLogic.BtnList[3].gameObject.SetActive(false); * myMainUiButtonLogic.BtnList2.RemoveAt(2); * myMainUiButtonLogic.BtnList2.RemoveAt(0); */ } EventDispatcher.Instance.AddEventListener(UIEvent_PlayMainUIBtnAnimEvent.EVENT_TYPE, OnEvent_RunAnim); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }