예제 #1
0
    void Populate()
    {
        buildTarget  = EditorUserBuildSettings.activeBuildTarget;
        _channelType = PackageUtils.GetCurSelectedChannel();

        bundleVersion = PlayerSettings.bundleVersion;
    }
예제 #2
0
    public static void BuildAssetBundlesForCurSetting()
    {
        var    buildTarget = EditorUserBuildSettings.activeBuildTarget;
        string channelName = PackageUtils.GetCurSelectedChannel().ToString();

        BuildAssetBundles(buildTarget, channelName);
    }
예제 #3
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();
    }
예제 #4
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        ReadLocalVersionFile(buildTarget, channelType);

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();

        androidBuildABForPerChannel = PackageUtils.GetAndroidBuildABForPerChannelSetting();
        iosBuildABForPerChannel     = PackageUtils.GetIOSBuildABForPerChannelSetting();
    }
예제 #5
0
    void OnEnable()
    {
        buildTarget = EditorUserBuildSettings.activeBuildTarget;
        channelType = PackageUtils.GetCurSelectedChannel();

        resVersion    = ReadResVersionConfig();
        bundleVersion = PlayerSettings.bundleVersion;

        localServerType = PackageUtils.GetLocalServerType();
        localServerIP   = PackageUtils.GetLocalServerIP();

        androidBuildABForPerChannel = PackageUtils.GetAndroidBuildABForPerChannelSetting();
        iosBuildABForPerChannel     = PackageUtils.GetIOSBuildABForPerChannelSetting();
    }
예제 #6
0
        static public void ToolBuildForCurrentSetting()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkCopy       = EditorUtility.DisplayDialog("Build AssetBundles Warning",
                                                               string.Format("Build AssetBundles for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                               "Confirm", "Cancel");

            if (!checkCopy)
            {
                return;
            }

            PackageTool.BuildAssetBundlesForCurrentChannel();
        }
        static public void ToolsToolsCopyAssetbundles()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkCopy       = EditorUtility.DisplayDialog("Copy AssetBundles To StreamingAssets Warning",
                                                               string.Format("Copy AssetBundles to streamingAssets folder for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                               "Confirm", "Cancel");

            if (!checkCopy)
            {
                return;
            }

            PackageUtils.CopyCurSettingAssetBundlesToStreamingAssets();
        }
        static public void ToolRunAllCheckers()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkCopy       = EditorUtility.DisplayDialog("Run Checkers Warning",
                                                               string.Format("Run Checkers for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                               "Confirm", "Cancel");

            if (!checkCopy)
            {
                return;
            }

            CheckAssetBundles.Run();
        }
예제 #9
0
        static void CheckSimulateModelEnv()
        {
            if (!AssetBundleConfig.IsSimulateMode)
            {
                return;
            }

            var  buildTargetName      = PackageUtils.GetCurPlatformName();
            var  channelName          = PackageUtils.GetCurSelectedChannel().ToString();
            var  outputManifest       = PackageUtils.GetCurBuildSettingAssetBundleManifestPath();
            bool hasBuildAssetBundles = false;

            if (!File.Exists(outputManifest))
            {
                bool checkBuild = EditorUtility.DisplayDialog("Build AssetBundles Warning",
                                                              string.Format("Build AssetBundles for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                              "Confirm", "Cancel");
                if (!checkBuild)
                {
                    ToggleEditorMode();
                    return;
                }

                hasBuildAssetBundles = true;
                BuildPlayer.BuildAssetBundlesForCurSetting();
            }

            var streamingManifest = PackageUtils.GetCurBuildSettingStreamingManifestPath();

            if (hasBuildAssetBundles || !File.Exists(streamingManifest))
            {
                bool checkCopy = EditorUtility.DisplayDialog("Copy AssetBundles To StreamingAssets Warning",
                                                             string.Format("Copy AssetBundles to streamingAssets folder for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                             "Confirm", "Cancel");
                if (!checkCopy)
                {
                    ToggleEditorMode();
                    return;
                }

                // 拷贝到StreamingAssets目录时,相当于执行大版本更新,那么沙盒目录下的数据就作废了
                // 真机上会对比这两个目录下的App版本号来删除,编辑器下暴力一点,直接删除
                ToolsClearPersistentAssets();
                PackageUtils.CopyCurSettingAssetBundlesToStreamingAssets(EditorUserBuildSettings.activeBuildTarget);
            }
            LaunchAssetBundleServer.CheckAndDoRunning();
        }
예제 #10
0
        static public void ToolsClearOutput()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkClear      = EditorUtility.DisplayDialog("ClearOutput Warning",
                                                               string.Format("Clear output assetbundles will force to rebuild all : \n\nplatform : {0} \nchannel : {1} \n\n continue ?", buildTargetName, channelName),
                                                               "Yes", "No");

            if (!checkClear)
            {
                return;
            }
            string outputPath = PackageUtils.GetCurBuildSettingAssetBundleOutputPath();

            GameUtility.SafeDeleteDir(outputPath);
            Debug.Log(string.Format("Clear done : {0}", outputPath));
        }
예제 #11
0
    public static Manifest GetCurrentManifest()
    {
        var    buildTarget = EditorUserBuildSettings.activeBuildTarget;
        string channelName = PackageUtils.GetCurSelectedChannel().ToString();

        string   path     = PackageUtils.GetAssetbundleManifestPath(buildTarget, channelName);
        Manifest manifest = new Manifest();

        if (File.Exists(path))
        {
            AssetBundle assetBundle = AssetBundle.LoadFromFile(path);
            manifest.LoadFromAssetbundle(assetBundle);
            assetBundle.Unload(false);
        }

        return(manifest);
    }
        static public void ToolsCopyAssetbundles()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkCopy       = EditorUtility.DisplayDialog("Copy AssetBundles To StreamingAssets Warning",
                                                               string.Format("Copy AssetBundles to streamingAssets folder for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                               "Confirm", "Cancel");

            if (!checkCopy)
            {
                return;
            }

            // 拷贝到StreamingAssets目录时,相当于执行大版本更新,那么沙盒目录下的数据就作废了
            // 真机上会对比这两个目录下的App版本号来删除,编辑器下暴力一点,直接删除
            ToolsClearPersistentAssets();
            PackageUtils.CopyCurSettingAssetBundlesToStreamingAssets();
        }
예제 #13
0
        static public void ToolRunAllCheckers()
        {
            var  buildTargetName = PackageUtils.GetCurPlatformName();
            var  channelName     = PackageUtils.GetCurSelectedChannel().ToString();
            bool checkCopy       = EditorUtility.DisplayDialog("Run Checkers Warning",
                                                               string.Format("Run Checkers for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                               "Confirm", "Cancel");

            if (!checkCopy)
            {
                return;
            }

            bool checkChannel = PackageUtils.BuildAssetBundlesForPerChannel(EditorUserBuildSettings.activeBuildTarget);

            PackageUtils.CheckAndRunAllCheckers(checkChannel, true);
            AddressCofing2Lua.instance.WriteAssetsAddress();
        }
        static void CheckSimulateModelEnv()
        {
            if (!AssetBundleConfig.IsSimulateMode)
            {
                return;
            }

            var  buildTargetName      = PackageUtils.GetCurPlatformName();
            var  channelName          = PackageUtils.GetCurSelectedChannel().ToString();
            var  outputManifest       = PackageUtils.GetCurBuildSettingOutputManifestPath();
            bool hasBuildAssetBundles = false;

            if (!File.Exists(outputManifest))
            {
                bool checkBuild = EditorUtility.DisplayDialog("Build AssetBundles Warning",
                                                              string.Format("Build AssetBundles for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                              "Confirm", "Cancel");
                if (!checkBuild)
                {
                    ToggleEditorMode();
                    return;
                }

                hasBuildAssetBundles = true;
                BuildPlayer.BuildAssetBundlesForCurSetting();
            }

            var streamingManifest = PackageUtils.GetCurBuildSettingStreamingManifestPath();

            if (hasBuildAssetBundles || !File.Exists(streamingManifest))
            {
                bool checkCopy = EditorUtility.DisplayDialog("Copy AssetBundles To StreamingAssets Warning",
                                                             string.Format("Copy AssetBundles to streamingAssets folder for : \n\nplatform : {0} \nchannel : {1} \n\nContinue ?", buildTargetName, channelName),
                                                             "Confirm", "Cancel");
                if (!checkCopy)
                {
                    ToggleEditorMode();
                    return;
                }

                PackageUtils.CopyCurSettingAssetBundlesToStreamingAssets();
            }
            LaunchAssetBundleServer.CheckAndDoRunning();
        }
예제 #15
0
 static PackageTool()
 {
     channelType = PackageUtils.GetCurSelectedChannel();
 }