public void LoadConfigs() { foreach (string path in ResourcesManager.CsvDict.Keys) { ReadCsv config = ResourcesManager.CsvDict[path]; for (int i = 3; i < config.GetRow(); i++) { if (path.Contains("Scene.csv")) { ConfigScene data = new ConfigScene(config, i); this.CfgScene.Add(data._id, data); } else if (path.Contains("Story.csv")) { ConfigStory data = new ConfigStory(config, i); this.CfgStory.Add(data._id, data); } else if (path.Contains("Event.csv")) { ConfigEvent data = new ConfigEvent(config, i); this.CfgEvent.Add(data._id, data); } else if (path.Contains("Item.csv")) { ConfigItem data = new ConfigItem(config, i); this.CfgItem.Add(data._id, data); } else if (path.Contains("Drop.csv")) { ConfigDrop data = new ConfigDrop(config, i); this.CfgDrop.Add(data._id, data); } else if (path.Contains("Monster.csv")) { ConfigMonster data = new ConfigMonster(config, i); this.CfgMonster.Add(data._id, data); } else if (path.Contains("Equipment.csv")) { ConfigEquipment data = new ConfigEquipment(config, i); this.CfgEquipment.Add(data._id, data); } } } }
public override void OnEnable() { base.OnEnable(); mHideToScene = mParam != null ? (string)mParam : WindowType.WINDOW_MAIN; HideAllText(); HideBtns(); mStoryInfo = ConfigManager.Instance.ReqStory(Process.Instance.NextStoryID); if (mStoryInfo != null) { mDialogList.Clear(); SplitDialog(mStoryInfo._desc); mCurDialogIndex = 0; mCurWordCount = 1; Timers.inst.Add(0.1f, 0, UpdateDialog); } else { MyLog.LogError("Dialog[" + Process.Instance.NextStoryID + "] not exist"); SwitchToWindow(); } }
public bool NeedShowDialog() { if (_lastStoryId == 0) { _nextStoryId = GameConfig.DIALOG_START_ID; return(true); } else { ConfigStory lastStory = ConfigManager.Instance.ReqStory(_lastStoryId); if (lastStory._type == (int)DialogType.ChooseDialog) { MyLog.Log("Continue show last choose dialog[" + lastStory._nextId + "]"); _nextStoryId = lastStory._nextId; return(true); } else if (lastStory._type == (int)DialogType.ToNextDialog) { MyLog.Log("To next dialog[" + lastStory._nextId + "]"); _nextStoryId = lastStory._nextId; return(true); } else { List <ConfigStory> curSceneDialogs = ConfigManager.Instance.ReqDialogList(_curScene); curSceneDialogs.Sort((data1, data2) => { return(data1._id.CompareTo(data2._id)); }); int index = -1; for (int i = 0; i < curSceneDialogs.Count; i++) { if (curSceneDialogs[i]._id == lastStory._id) { index = i + 1; break; } } if (index == -1) { MyLog.Log("Last dialog scene[" + _lastStoryId + "] is not current scene[" + _curScene + "]. Current scene has dialog count " + curSceneDialogs.Count); if (curSceneDialogs.Count > 0) { _nextStoryId = curSceneDialogs[0]._id; return(true); } else { return(false); } } else { MyLog.Log("Current scene has dialog count " + curSceneDialogs.Count); if (index >= curSceneDialogs.Count) { return(false); } else { _nextStoryId = curSceneDialogs[index]._id; MyLog.Log("Will play dialog[ " + _nextStoryId + "]"); return(true); } } } } }