//ベースパス (プレハブのある場所など)からExpandOptionのバージョンをロードする private void LoadOptionVersionJsonOnBasePath(string basePath) { if (File.Exists(basePath + "Option.json")) { expandJsonPath = basePath + "Option.json"; expandOptionVersion = FileUtil.LoadJsonFile <ExpandOptionVersion>(basePath + "Option.json"); } else if (Directory.Exists(basePath + "RiClothesSetuper/")) { expandJsonPath = basePath + "RiClothesSetuper/" + "Option.json"; expandOptionVersion = FileUtil.LoadJsonFile <ExpandOptionVersion>(basePath + "RiClothesSetuper/" + "Option.json"); } }
//ExpandOptionのバージョンをロードする private void LoadExpandFileVersion() { expandOptionVersion = null; if (PrefabData.GetCloth() == null) { return; } isLoadExpandGUI = true; if (clothPrefabParentPath != "") { //プレハブ直下もしくは"RiClothesSetuper/" にOptionPathのjsonファイルを置くパターン string basePath = Path.GetDirectoryName(clothPrefabParentPath) + "/"; OptionPath optionPath = OptionPath.LoadOptionPathFromBaseDir(basePath); if (optionPath != null) { if (optionPath.option_json_path != null && optionPath.option_json_path != "") { //プレハブからの相対パス expandJsonPath = FileUtil.GetPathFromRelative(basePath, optionPath.option_json_path); expandOptionVersion = FileUtil.LoadJsonFile <ExpandOptionVersion>(expandJsonPath); } else if (optionPath.base_path != null && optionPath.base_path != "") { string optionBasePath = FileUtil.GetPathFromRelative(basePath, optionPath.base_path); LoadOptionVersionJsonOnBasePath(optionBasePath); } } //この時点でexpandOptionに中身が入っていたら終了する if (expandOptionVersion != null) { return; } //プレハブ直下もしくは"RiClothesSetuper/"にOption.jsonを置くパターン if (clothPrefabParentPath != "") { LoadOptionVersionJsonOnBasePath(basePath); } } }