/// <summary> /// AssetBundleをSTYLY_ASSETフォルダへコピーする。 /// </summary> /// <param name="guid">GUID</param> /// <returns>成否。 0: 成功, -1: 失敗</returns> public int CopyBuildedAssetBundleToSTYLY(string guid) { var paltformName = "Windows"; string srcPath = Path.Combine(OutputPath, "STYLY_ASSET", paltformName, guid); Debug.Log("assetBundlePath:" + srcPath); string destPath = CommonUtility.FixPathString(Path.Combine(GetSTYLYPersistentDataPath(), "STYLY_ASSET", paltformName, guid)); Debug.Log("STYLYPath:" + destPath); if (!File.Exists(srcPath)) { Debug.LogError("Error:Src File Not Found. " + srcPath); return(-1); } var result = PushFile(srcPath, destPath); if (result != 0) { return(-1); } return(0); }
public int CopyBuildedAssetBundleToSTYLY(GameObject[] gameObjects) { var abUtility = new AssetBundleUtility(); var pcvrUtility = new PCVRUtility(); var buildedPathData = abUtility.GetBuildedAssetData(); var paltformName = "Windows"; foreach (var gameObject in gameObjects) { var buildedInfo = GetBuildedData(gameObject); string srcPath = Path.Combine(OutputPath + "STYLY_ASSET", paltformName); srcPath = CommonUtility.FixPathString(Path.Combine(srcPath, buildedInfo["guid"])); Debug.Log("assetBundlePath:" + srcPath); string destPath = CommonUtility.FixPathString(Path.Combine(pcvrUtility.GetSTYLYPersistentDataPath(), "STYLY_ASSET\\" + paltformName)); destPath = CommonUtility.FixPathString(Path.Combine(destPath, buildedInfo["guid"])); Debug.Log("STYLYPath:" + destPath); var result = pcvrUtility.PushFile(srcPath, destPath); if (result != 0) { return(-1); } } return(0); }
/// <summary> /// シーン情報JSONファイルをSTYLY_SCENEフォルダへ出力する /// </summary> /// <param name="sceneInfoJson">シーン情報JSON</param> /// <param name="sceneGuid">シーンGUID</param> public void SaveSceneJsonToSTYLY(string sceneInfoJson, string sceneGuid) { var destPath = CommonUtility.FixPathString(Path.Combine(GetSTYLYPersistentDataPath(), "STYLY_SCENE\\" + sceneGuid + ".json")); var directoryPath = Path.GetDirectoryName(destPath); if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } File.WriteAllText(destPath, sceneInfoJson); }
public string PullFile(string srcPath) { Debug.Log("Pull File:" + srcPath); string result = null; if (!File.Exists(srcPath)) { return(null); } var outputPath = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf(@"\") + 1); outputPath = Path.Combine(outputPath, Path.GetFileName(srcPath)); File.Copy(srcPath, outputPath, true); return(CommonUtility.FixPathString(outputPath)); }