public bool Reset(int LevelID) { this.Clear(); SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); DebugHelper.Assert(curLvelContext != null); if (curLvelContext == null) { return(false); } for (int i = 0; i < curLvelContext.m_starDetail.Length; i++) { ResDT_IntParamArrayNode resDT_IntParamArrayNode = curLvelContext.m_starDetail[i]; if (resDT_IntParamArrayNode.iParam == 0) { break; } this.AddStarEvaluation(resDT_IntParamArrayNode.iParam); } if (curLvelContext.m_loseCondition != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)curLvelContext.m_loseCondition); DebugHelper.Assert(dataByKey != null); if (dataByKey == null) { return(false); } this.FailureEvaluation = this.CreateStar(dataByKey, 0); DebugHelper.Assert(this.FailureEvaluation != null, "我擦,怎会没有?"); } Singleton <EventRouter> .get_instance().BroadCastEvent(EventID.StarSystemInitialized); return(true); }
public bool Reset(SLevelContext levelContext, bool bMultiGame) { this.Clear(); bool result = false; if (levelContext.IsMobaModeWithOutGuide()) { this.CurLevelTimeDuration = levelContext.m_timeDuration; if (levelContext.m_addWinCondStarId != 0u) { ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(levelContext.m_addWinCondStarId); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { this.WinnerEvaluation = this.CreateStar(dataByKey); DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?"); result = true; } } if (levelContext.m_addLoseCondStarId != 0u) { ResEvaluateStarInfo dataByKey2 = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(levelContext.m_addLoseCondStarId); DebugHelper.Assert(dataByKey2 != null); if (dataByKey2 != null) { this.LoserEvaluation = this.CreateStar(dataByKey2); DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?"); result = true; } } } return result; }
private void initNotifyDestroyStat() { SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); if (!curLvelContext.isPVPLevel) { ResLevelCfgInfo info = StarSystem.FindLevelConfig(curLvelContext.iLevelID); if ((info != null) && (info.astStarDetail != null)) { for (int i = 0; i < info.astStarDetail.Length; i++) { int iParam = info.astStarDetail[i].iParam; if (iParam != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)iParam); this.CondfoToDestroyStat(dataByKey.astConditions); } } } else { DebugHelper.Assert(false, string.Format("LevelConfig is null -- levelID: {0}", curLvelContext.iLevelID)); } } }
public bool Reset(int LevelID) { this.Clear(); ResLevelCfgInfo info = FindLevelConfig(LevelID); DebugHelper.Assert(info != null); if (info == null) { return(false); } for (int i = 0; i < info.astStarDetail.Length; i++) { ResDT_IntParamArrayNode node = info.astStarDetail[i]; if (node.iParam == 0) { break; } this.AddStarEvaluation(node.iParam); } if (info.iLoseCondition != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)info.iLoseCondition); DebugHelper.Assert(dataByKey != null); if (dataByKey == null) { return(false); } this.FailureEvaluation = this.CreateStar(dataByKey, 0); DebugHelper.Assert(this.FailureEvaluation != null, "我擦,怎会没有?"); } Singleton <EventRouter> .instance.BroadCastEvent(EventID.StarSystemInitialized); return(true); }
private void initNotifyDestroyStat() { SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext(); if (curLvelContext.IsMobaMode()) { return; } if (curLvelContext != null && curLvelContext.m_starDetail != null) { for (int i = 0; i < curLvelContext.m_starDetail.Length; i++) { int iParam = curLvelContext.m_starDetail[i].iParam; if (iParam != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)iParam); this.CondfoToDestroyStat(dataByKey.astConditions); } } } else { DebugHelper.Assert(false, string.Format("LevelConfig is null -- levelID: {0}", curLvelContext.m_mapID)); } }
private IStarEvaluation CreateStar(ResEvaluateStarInfo ConditionDetail) { StarEvaluation starEvaluation = new StarEvaluation(); starEvaluation.OnChanged += new OnEvaluationChangedDelegate(this.OnEvaluationChangedInner); starEvaluation.Index = 0; starEvaluation.Initialize(ConditionDetail); return starEvaluation; }
protected IStarEvaluation CreateStar(ResEvaluateStarInfo ConditionDetail, int InIndex) { StarEvaluation starEvaluation = new StarEvaluation(); starEvaluation.OnChanged += new OnEvaluationChangedDelegate(this.OnEvaluationChangedInner); starEvaluation.Index = InIndex; starEvaluation.Initialize(ConditionDetail); return(starEvaluation); }
private static void SetStarConditionDesc(CUIFormScript formScript, GameObject descCon, uint conditionId, bool bAchieved) { Text component = descCon.transform.Find("TxtWinCondtion").gameObject.GetComponent <Text>(); ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey(conditionId); object[] inParameters = new object[] { conditionId }; DebugHelper.Assert(dataByKey != null, "Can't find star condition config with ID: {0}", inParameters); component.text = StringHelper.UTF8BytesToString(ref dataByKey.szCondDesc); component.color = !bAchieved ? Color.white : Color.green; descCon.transform.Find("ImgStar").gameObject.GetComponent <Image>().SetSprite("UGUI/Sprite/System/" + (!bAchieved ? "Adventure/empty_big_star" : "Adventure/big_star"), formScript, true, false, false); }
protected void AddStarEvaluation(int CondID) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)CondID); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { IStarEvaluation item = this.CreateStar(dataByKey, this.StarEvaluations.Count); this.StarEvaluations.Add(item); } }
protected void AddStarEvaluation(int CondID) { ResEvaluateStarInfo dataByKey = GameDataMgr.evaluateCondInfoDatabin.GetDataByKey((uint)CondID); DebugHelper.Assert(dataByKey != null); if (dataByKey == null) { return; } IStarEvaluation starEvaluation = this.CreateStar(dataByKey, this.StarEvaluations.get_Count()); this.StarEvaluations.Add(starEvaluation); }
public void Initialize(ResEvaluateStarInfo InStarInfo) { this.StarInfo = InStarInfo; this.Description = Utility.UTF8Convert(InStarInfo.szCondDesc); for (int i = 0; i < InStarInfo.astConditions.Length; i++) { ResDT_ConditionInfo inCondConfig = InStarInfo.astConditions[i]; if (inCondConfig.dwType == 0) { break; } this.AddCondition(inCondConfig); } }
public bool Reset(int LevelID, bool bMultiGame) { this.Clear(); ResDT_LevelCommonInfo outLevelComInfo = null; if (bMultiGame) { outLevelComInfo = CLevelCfgLogicManager.FindLevelConfigMultiGame(LevelID); } else { ResLevelCfgInfo outLevelCfg = null; CLevelCfgLogicManager.FindLevelConfigSingleGame(LevelID, out outLevelCfg, out outLevelComInfo); } bool flag = false; if (outLevelComInfo != null) { this.CurLevelTimeDuration = outLevelComInfo.dwTimeDuration; if (outLevelComInfo.dwAddWinCondStarId != 0) { ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddWinCondStarId); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { this.WinnerEvaluation = this.CreateStar(dataByKey); DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?"); flag = true; } } if (outLevelComInfo.dwAddLoseCondStarId != 0) { ResEvaluateStarInfo conditionDetail = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddLoseCondStarId); DebugHelper.Assert(conditionDetail != null); if (conditionDetail != null) { this.LoserEvaluation = this.CreateStar(conditionDetail); DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?"); flag = true; } } } return(flag); }