UnityEditor.PostprocessBuildPlayer.SupportsInstallInBuildFolder C# (CSharp) Method

SupportsInstallInBuildFolder() public static method

public static SupportsInstallInBuildFolder ( BuildTarget target ) : bool
target BuildTarget
return bool
        public static bool SupportsInstallInBuildFolder(BuildTarget target)
        {
            IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(target);
            if (buildPostProcessor != null)
            {
                return buildPostProcessor.SupportsInstallInBuildFolder();
            }
            switch (target)
            {
                case BuildTarget.PSP2:
                case BuildTarget.PSM:
                    break;

                default:
                    if ((target != BuildTarget.Android) && (target != BuildTarget.WSAPlayer))
                    {
                        return false;
                    }
                    break;
            }
            return true;
        }

Usage Example

示例#1
0
        internal static bool ValidateLocationPathNameForBuildTargetGroup(string locationPathName, BuildTargetGroup buildTargetGroup, BuildTarget target, BuildOptions options, out string errorMessage)
        {
            if (string.IsNullOrEmpty(locationPathName))
            {
                var willInstallInBuildFolder = (options & BuildOptions.InstallInBuildFolder) != 0 &&
                                               PostprocessBuildPlayer.SupportsInstallInBuildFolder(buildTargetGroup, target);
                if (!willInstallInBuildFolder)
                {
                    errorMessage =
                        "The 'locationPathName' parameter for BuildPipeline.BuildPlayer should not be null or empty.";
                    return(false);
                }
            }
            else if (string.IsNullOrEmpty(Path.GetFileName(locationPathName)))
            {
                var extensionForBuildTarget = PostprocessBuildPlayer.GetExtensionForBuildTarget(buildTargetGroup, target, options);

                if (!string.IsNullOrEmpty(extensionForBuildTarget))
                {
                    errorMessage = string.Format(
                        "For the '{0}' target the 'locationPathName' parameter for BuildPipeline.BuildPlayer should not end with a directory separator.\n" +
                        "Provided path: '{1}', expected a path with the extension '.{2}'.", target, locationPathName,
                        extensionForBuildTarget);
                    return(false);
                }
            }

            errorMessage = "";

            return(true);
        }
All Usage Examples Of UnityEditor.PostprocessBuildPlayer::SupportsInstallInBuildFolder