// ===================================== // // protected - Unity API // // ===================================== // protected override void OnAwake() { base.OnAwake(); _iLocalDataLoadingCount_Request = 0; _iLocalDataLoadingCount_Finish = 0; _pJsonParser_Persistent = SCManagerParserJson.DoMakeInstance(this, "", EResourcePath.PersistentDataPath); _pJsonParser_StreammingAssets = SCManagerParserJson.DoMakeInstance(this, const_strLocalPath_INI, EResourcePath.StreamingAssets); _pJsonParser_JsonData = SCManagerParserJson.DoMakeInstance(this, SCManagerParserJson.const_strFolderName, EResourcePath.Resources); _pManagerScene = new SCSceneLoader <ENUM_Scene_Name>(); _pManagerScene.p_EVENT_OnSceneLoaded += ProcOnSceneLoaded; ProcParse_UserSetting(); _iLocalDataLoadingCount_Request++; _iLocalDataLoadingCount_Request++; _iLocalDataLoadingCount_Request++; _pJsonParser_StreammingAssets.DoStartCo_GetStreammingAssetResource_Array <SINI_Sound>(EINI_JSON_FileName.Sound.ToString(), OnParseComplete_SoundSetting); _pJsonParser_StreammingAssets.DoStartCo_GetStreammingAssetResource <SINI_ApplicationSetting>(EINI_JSON_FileName.ApplicationSetting.ToString(), OnFinishParse_AppSetting); if (CManagerUILocalize.instance == null) { CManagerUILocalize.EventMakeSingleton(); } CManagerUILocalize.instance.DoStartParse_Locale(CUIManagerLocalize_p_EVENT_OnChangeLocalize); }
/* protected - Override & Unity API */ protected override void OnMakeSingleton() { base.OnMakeSingleton(); SCManagerParserJson pManagerParser = SCManagerParserJson.DoMakeInstance(null, const_strResourcesJsonDataPath, EResourcePath.Resources); pManagerParser.DoReadJson_And_InitEnumerator(const_strResourcesFileName, ref _mapDataTable_Dialogue); }
protected override void OnAwake() { base.OnAwake(); Dictionary <EPropTest, SDataProp> _mapData_Prop = new Dictionary <EPropTest, SDataProp>(); SCManagerParserJson pParser = SCManagerParserJson.DoMakeInstance(this, SCManagerParserJson.const_strFolderName, EResourcePath.Resources); pParser.DoReadJson_And_InitEnumerator("인게임오브젝트_테스트", ref _mapData_Prop); var listTest = _mapData_Prop.ToList(); for (int i = 0; i < listTest.Count; i++) { Debug.Log(string.Format("Key : {0} Value ( i등장확률 : {1} i최대드랍골드 : {2} )", listTest[i].Key, listTest[i].Value.i등장확률, listTest[i].Value.i최대드랍골드)); } }
// ========================================================================== // /* public - [Do] Function * 외부 객체가 호출(For External class call)*/ public void DoInit(MonoBehaviour pBaseClass, string strFolderPath) { _mapPreParsingObject.Clear(); if (_pManagerParserJson == null) { _pManagerParserJson = SCManagerParserJson.DoMakeInstance(pBaseClass, strFolderPath, EResourcePath.Resources); } List <KeyValuePair <string, TextAsset> > listResource = _pManagerParserJson.p_mapResourceOrigin.ToList(); System.Type pType = typeof(T_Key); if (pType.IsEnum) { for (int i = 0; i < listResource.Count; i++) { KeyValuePair <string, TextAsset> pKey = listResource[i]; T_Key tKey = pKey.Key.ConvertEnum <T_Key>(); Class_PreParsingType pData; if (_pManagerParserJson.DoReadJson_FromResource(tKey, out pData)) { _mapPreParsingObject.Add(tKey, pData); } else { System.Type pTypeClass = typeof(Class_PreParsingType); Debug.LogWarningFormat("[Error] SCManagerPreParserJson<{0}, {1}>.Parsing Fail Key : {2}", pType.Name, pTypeClass, tKey); } } } else { for (int i = 0; i < listResource.Count; i++) { KeyValuePair <string, TextAsset> pKey = listResource[i]; T_Key tKey = (T_Key)(object)pKey.Key; Class_PreParsingType pData; if (_pManagerParserJson.DoReadJson_FromResource(tKey, out pData)) { _mapPreParsingObject.Add(tKey, pData); } } } }
/* public - [Event] Function * 프랜드 객체가 호출 */ // ========================================================================== // /* private - [Proc] Function * 중요 로직을 처리 */ static private void Check_And_InitManagerLogin() { if (_pObjectDummy_ForCoroutine != null) { return; } GameObject pObjectDummy = new GameObject("ManagerLogInDummy_ForCoroutine"); _pObjectDummy_ForCoroutine = pObjectDummy.AddComponent <CCompoTemp>(); _pManagerJson = SCManagerParserJson.DoMakeInstance(_pObjectDummy_ForCoroutine, const_strLocalPath_INI, EResourcePath.PersistentDataPath); if (_pManagerJson.DoReadJson_FromResource <string, SINI_Account>(const_strLogInFileName, out _pLoginInfo) == false) { _pLoginInfo = new SINI_Account(); _pManagerJson.DoWriteJson <string>(const_strLogInFileName, _pLoginInfo); } else { _strEmailAddress = _pLoginInfo.strEmailAddress; _strPassword = _pLoginInfo.strPassword; } }