public static void ExecuteAction(UMakeTarget t, BuildAction action) { UMake umake; if (!UMake.Get().TryGet(out umake)) { return; } UMakeTarget.Path targetPath; switch (action) { case BuildAction.PreActions: EditorApplication.delayCall += () => t.ExecutePreBuildActions(umake); break; case BuildAction.Build: targetPath = t.GetTargetPath(umake.version, UMake.GetBuildPath()); EditorApplication.delayCall += () => t.Build(umake, targetPath); break; case BuildAction.PostActions: EditorApplication.delayCall += () => t.ExecutePostBuildActions(umake); break; case BuildAction.OpenFolder: targetPath = t.GetTargetPath(umake.version, UMake.GetBuildPath()); EditorUtility.RevealInFinder(targetPath.directoryPath); break; } }
private bool CopyContent(UMakeTarget umakeTarget, string version, string buildPath) { string contentFolderPath = GetContentFolderPath(); if (!Directory.Exists(contentFolderPath)) { Debug.LogFormat("Content folder \"{0}\" does not exist.", contentFolderPath); return(false); } UMakeTarget.Path targetPath = umakeTarget.GetTargetPath(version, buildPath); if (!Directory.Exists(targetPath.directoryPath)) { Debug.LogFormat("Target path \"{0}\" does not exist. Did you forget to build?", targetPath.directoryPath); return(false); } string uploadFolderPath = Path.Combine(contentFolderPath, contentSubFolder); if (Directory.Exists(uploadFolderPath)) { Directory.Delete(uploadFolderPath, true); } FileSystemHelper.CopyDirectory(targetPath.directoryPath, uploadFolderPath); Debug.LogFormat("Build files copied to \"{0}\".", uploadFolderPath); return(true); }