示例#1
0
文件: CBuildTools.cs 项目: scris/_GS
    /// <summary>
    /// Extra Flag ->   ex:  Android/  AndroidSD/  AndroidHD/
    /// </summary>
    /// <param name="platfrom"></param>
    /// <param name="quality"></param>
    /// <returns></returns>
    public static string GetExportPath(BuildTarget platfrom, CResourceQuality quality = CResourceQuality.Sd)
    {
        string basePath = Path.GetFullPath(Application.dataPath + "/" + CCosmosEngine.GetConfig(CCosmosEngineDefaultConfig.AssetBundleBuildRelPath) + "/");

        if (!Directory.Exists(basePath))
        {
            CBuildTools.ShowDialog("路径配置错误: " + basePath);
            throw new System.Exception("路径配置错误");
        }

        string path = null;

        switch (platfrom)
        {
        case BuildTarget.Android:
        case BuildTarget.iPhone:
        case BuildTarget.StandaloneWindows:
            var platformName = CResourceModule.BuildPlatformName;
            if (quality != CResourceQuality.Sd)      // SD no need add
            {
                platformName += quality.ToString().ToUpper();
            }

            path = basePath + platformName + "/";
            break;

        default:
            CBuildTools.ShowDialog("构建平台配置错误");
            throw new System.Exception("构建平台配置错误");
        }
        return(path);
    }
示例#2
0
    /// <summary>
    /// Different platform's assetBundles is incompatible.
    /// CosmosEngine put different platform's assetBundles in different folder.
    /// Here, get Platform name that represent the AssetBundles Folder.
    /// </summary>
    /// <returns>Platform folder Name</returns>
    private static string GetBuildPlatformName()
    {
        string buildPlatformName = "Win32"; // default

#if UNITY_EDITOR
        var buildTarget = UnityEditor_EditorUserBuildSettings_activeBuildTarget; //UnityEditor.EditorUserBuildSettings.activeBuildTarget;
        switch (buildTarget)
        {
        case "StandaloneWindows":    // UnityEditor.BuildTarget.StandaloneWindows:
        case "StandaloneWindows64":  // UnityEditor.BuildTarget.StandaloneWindows64:
            buildPlatformName = "Win32";
            break;

        case "Android":    // UnityEditor.BuildTarget.Android:
            buildPlatformName = "Android";
            break;

        case "iPhone":    // UnityEditor.BuildTarget.iPhone:
            buildPlatformName = "IOS";
            break;

        default:
            CDebug.Assert(false);
            break;
        }
#else
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            buildPlatformName = "Android";
            break;

        case RuntimePlatform.IPhonePlayer:
            buildPlatformName = "IOS";
            break;

        case RuntimePlatform.WindowsPlayer:
        case RuntimePlatform.WindowsWebPlayer:
            buildPlatformName = "Win32";
            break;

        default:
            CDebug.Assert(false);
            break;
        }
#endif
        if (Quality != CResourceQuality.Sd)  // SD no need add
        {
            buildPlatformName += Quality.ToString().ToUpper();
        }
        return(buildPlatformName);
    }