void OnDestroy() { if (cdTimer != null) { cdTimer.stop(); } if (checkStateTimer != null) { checkStateTimer.stop(); } if (map != null) { Destroy(map.gameObject); } focusGuess = null; }
private IEnumerator initData(int index) { pointRoot.GetComponent <UIScrollView> ().ResetPosition(); yield return(1); map.clear(); if (focusGuess == null) { focusGuess = new ArenaFocusGuess(); } else { focusGuess.Clear(); } Utils.DestoryChilds(pointRoot); ArenaFinalInfo[][] infos; if (index <= 3) { infos = new ArenaFinalInfo[5][]; infos [0] = am.getFinalInfo(index * 16, 16); infos [1] = am.getFinalInfo(index * 8 + 64, 8); infos [2] = am.getFinalInfo(index * 4 + 96, 4); infos [3] = am.getFinalInfo(index * 2 + 112, 2); infos [4] = am.getFinalInfo(index + 120, 1); } else { infos = new ArenaFinalInfo[3][]; infos [0] = am.getFinalInfo(120, 4); infos [1] = am.getFinalInfo(124, 2); infos [2] = am.getFinalInfo(126, 1); } ArenaFinalPoint[][] points = new ArenaFinalPoint[infos.Length][]; for (int i = 0; i < points.Length; i++) { points [i] = new ArenaFinalPoint[infos [i].Length]; } Vector3 postion = new Vector3(-263, 62, 0); //bool isFocusCuess = false; for (int i = 0; i < infos.Length; i++) { for (int j = 0; j < infos[i].Length; j++) { ArenaFinalInfo info = infos [i] [j]; GameObject obj = NGUITools.AddChild(pointRoot, rolePointPrefab); obj.name = "rolepoint_" + (i * 100) + j; obj.SetActive(true); if (i == 0) { obj.transform.localPosition = postion + new Vector3(0, j * -233, 0); } else { ArenaFinalPoint paren1 = points [i - 1] [j * 2]; ArenaFinalPoint paren2 = points [i - 1] [j * 2 + 1]; float len = (paren2.transform.localPosition.y - paren1.transform.localPosition.y) / 2; obj.transform.localPosition = paren1.transform.localPosition + new Vector3(200, len, 0); } ArenaFinalPoint point = obj.GetComponent <ArenaFinalPoint> (); point.window = this; point.init(info); points [i] [j] = point; if (i > 0) { ArenaFinalPoint paren1 = points [i - 1] [j * 2]; ArenaFinalPoint paren2 = points [i - 1] [j * 2 + 1]; point.initParent(paren1, paren2); if (point.buttonGuess.activeInHierarchy) { focusGuess.AddFocusCuessPoint(point.gameObject.transform.localPosition, i, j, point.guessNum.activeInHierarchy, index, obj.name); } } chanPoint = point; if (info.uid == UserManager.Instance.self.uid) { myPoint = point; } yield return(1); } } focusGuess.SortFocusCuess(); ResetSpringPanel(); updateGuessNumbers(); if (am.state == ArenaManager.STATE_RESET && am.tapIndex == 4) { lookChanPosition(); chanPoint.chanName.text = LanguageConfigManager.Instance.getLanguage("Arena80", chanPoint.lblRoleName.text); chanPoint.chanName.gameObject.SetActive(true); chanPoint.timecd.text = lblNextCD.text; chanPoint.nextTime.gameObject.SetActive(true); EndLabel.text = LanguageConfigManager.Instance.getLanguage("Arena73"); EndLabel.gameObject.SetActive(true); } MaskWindow.UnlockUI(); }