// Use this for initialization void Start() { if (File.Exists(GeneralSettingPath)) { Debug.Log("aaa"); LoadSettings(GeneralSettingPath); WriteStartupLog(LogPath, DateTime.Now + SMDefine.GetSysMsg("Space_Tag") + SMDefine.GetSysMsg("Operation_Tag") + SMDefine.GetSysMsg("OperationMsg_001") + "(" + GeneralSettingPath + ")"); } Define = GetComponent <GameObjectDefine>(); SMDefine = GetComponent <SystemMessageDefine>(); ItemStr = GetComponent <ItemString>(); RDStr = GetComponent <RandomDialogString>(); AreaStr = GetComponent <AreaString>(); TalkStr = GetComponent <TalkString>(); LangLdr = GetComponent <LanguageLoader>(); SysSet = GetComponent <SystemSettings>(); StringTablePath = Application.dataPath + "/Resources/stringtable/"; StringTable_UIPath = StringTablePath + "jp/" + stringtable_UI_FileName; GeneralSettingPath = Application.dataPath + "/Resources/GeneralSettings.csv"; LogPath = Application.dataPath + "/log/Startup.log"; if (!Directory.Exists(Application.dataPath + "/log/")) { Directory.CreateDirectory(Application.dataPath + "/log/"); } if (!File.Exists(LogPath)) { File.Create(LogPath).Close(); } DefineLoadFiles(); //Debug.Log("File Define Loaded"); LoadSystemDefine(StringTable_System); //Debug.Log("System Define Loaded"); LoggingSystemInfo(); //Debug.Log("SystemInfo Loaded"); LoadFiles(); //Debug.Log("System Loaded"); Debug.Log(GeneralSettingPath); //GameStartBtnTextPath = GameObject.Find(Define.GameMenu_StartBtnText).GetComponent<Text>(); //ClickText = GameObject.Find(Define.GameMenu_ClickText).GetComponent<Text>(); }
private void EnsureStringsInternal() { if (TalkStrings != null) { return; } // Merge some strings string lastPortraitId = null; var internalStrings = new List <TalkString>(); var sb = new StringBuilder(); for (var i = 0; i < ScpStrings.Length;) { var str = ScpStrings[i]; if (str.Type != ScpStringType.SCPSTR_CODE_STRING) { ++i; continue; } sb.Clear(); var j = i; for (; j < ScpStrings.Length; ++j) { str = ScpStrings[j]; if (str.Type == ScpStringType.SCPSTR_CODE_STRING) { if (!string.IsNullOrEmpty(str.String)) { sb.Append(str.String); } } else if (str.Type == ScpStringType.SCPSTR_CODE_LINE_FEED) { sb.Append("\n"); } else { break; } } i = j; var text = sb.ToString(); var newString = new TalkString { PortraitId = lastPortraitId, Text = text }; var match = _portraitRegex.Match(text); if (match != null && match.Success) { newString.PortraitId = match.Groups[1].Value; newString.Text = match.Groups[2].Value; if (lastPortraitId == null) { lastPortraitId = newString.PortraitId; } } match = _cleaningRegex.Match(newString.Text); if (match != null && match.Success) { newString.Text = match.Groups[2].Value; } if (!string.IsNullOrEmpty(newString.Text)) { internalStrings.Add(newString); } } TalkStrings = internalStrings.ToArray(); }
// Use this for initialization void Start() { TalkStr = GameObject.Find("EventSystem").GetComponent <TalkString>(); }