예제 #1
0
        private bool CopyContent(string sdkPath, UMakeTarget umakeTarget, string version, string buildPath)
        {
            string contentFolderPath = Path.Combine(sdkPath, "tools/ContentBuilder/content");

            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);
        }
예제 #2
0
        public static void ExecuteAction(UMakeTarget t, BuildAction action)
        {
            UMake umake;

            if (!UMake.Get().TryGet(out umake))
            {
                return;
            }

            string buildPath;

            UMakeTarget.Path targetPath;

            switch (action)
            {
            case BuildAction.PreActions:
                EditorApplication.delayCall += () => t.ExecutePreBuildActions(umake);
                break;

            case BuildAction.Build:
                buildPath = UMake.GetBuildPath();
                EditorApplication.delayCall += () => t.Build(umake, buildPath);
                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;
            }
        }