public override void Init() { this.status = 1; this.mgInfo = Globals.Instance.AttDB.MGDict.GetInfo(GameUIManager.mInstance.uiState.PveSceneValue); if (this.mgInfo == null) { global::Debug.LogErrorFormat("MGDict.GetInfo error, id = {0}", new object[] { GameUIManager.mInstance.uiState.PveSceneValue }); return; } this.index = 0; this.timeStamp = 0f; this.maxWave = 0; this.damageCount = 0; this.respawnTimer = 0f; this.respawning = false; this.repaired = false; this.combatTimer = 0f; }
private void RefreshInfo() { for (int i = 0; i < this.mRewards.transform.childCount; i++) { UnityEngine.Object.Destroy(this.mRewards.transform.GetChild(i).gameObject); } int num = this.index * 3 + GUIGuardReadyPopUp.LevelItem.mCur.Index + 1; this.mMGInfo = Globals.Instance.AttDB.MGDict.GetInfo(num); if (this.mMGInfo == null) { global::Debug.LogError(new object[] { "MGDict get info error , ID : {0} ", num }); return; } int combatValue = Globals.Instance.Player.TeamSystem.GetCombatValue(); this.mTeamCombat.text = combatValue.ToString(); this.mRecommendCombat.text = this.mMGInfo.CombatValue.ToString(); float num2 = (this.mMGInfo.CombatValue <= 0) ? 1f : ((float)combatValue / (float)this.mMGInfo.CombatValue); float[] expr_10C = new float[4]; expr_10C[0] = 1f; expr_10C[1] = 0.8f; expr_10C[2] = 0.6f; float[] array = expr_10C; Color[] array2 = new Color[] { new Color32(102, 254, 0, 255), new Color32(254, 217, 14, 255), new Color32(252, 141, 0, 255), new Color32(254, 1, 3, 255) }; for (int j = 0; j < array.Length; j++) { if (num2 >= array[j]) { this.mTeamCombat.color = array2[j]; break; } } for (int k = 0; k < this.mRewards.transform.childCount; k++) { UnityEngine.Object.Destroy(this.mRewards.transform.GetChild(k).gameObject); } if (this.mMGInfo == null) { return; } this.mPending.Refresh(this.mMGInfo.MinFragmentCount, this.mMGInfo.MaxFragmentCount); for (int l = 0; l < this.mMGInfo.RewardType.Count; l++) { if (this.mMGInfo.RewardType[l] > 0 && this.mMGInfo.RewardType[l] < 20) { Transform transform = GameUITools.CreateReward(this.mMGInfo.RewardType[l], this.mMGInfo.RewardValue1[l], this.mMGInfo.RewardValue2[l], this.mRewards.transform, true, true, 36f, -7f, -2000f, 20f, 13f, 7f, 0).transform; transform.localScale = new Vector3(0.65f, 0.65f, 1f); transform.localPosition = new Vector3((float)(-66 + 70 * l), 8f, 0f); } } if (Tools.CanPlay(GameConst.GetInt32(214), true) && (1 << num & Globals.Instance.Player.Data.MGFlag) != 0) { this.mFarmCost = GameUITools.FindUILabel("Cost", this.mFarmBtn); this.mFarmCost.text = GameConst.GetInt32(215).ToString(); this.mFarmBtn.SetActive(true); } else { this.mFarmBtn.SetActive(false); } }