コード例 #1
0
ファイル: AppCenterEditor.cs プロジェクト: katyushi/HA-Game
 private void OnGuiInternal()
 {
     GUI.skin       = AppCenterEditorHelper.uiStyle;
     scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false, GUILayout.Width(window.position.width), GUILayout.Height(window.position.height));
     // Gets a rectangle with size of inner scroll area.
     scrollInnerContainer = EditorGUILayout.BeginHorizontal(GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
     using (new AppCenterGuiFieldHelper.UnityVertical(
                GUILayout.Width(scrollInnerContainer.width),
                GUILayout.MaxWidth(scrollInnerContainer.width),
                GUILayout.Height(scrollInnerContainer.height)))
     {
         GUI.enabled = IsGUIEnabled();
         AppCenterEditorHeader.DrawHeader();
         AppCenterEditorMenu.DrawMenu();
         AppCenterEditorSDKTools.DrawSdkPanel();
         foreach (var package in AppCenterSDKPackage.SupportedPackages)
         {
             AppCenterEditorSDKTools.DisplayPackagePanel(package);
         }
         AppCenterEditorSDKTools.SDKState state = AppCenterEditorSDKTools.GetSDKState();
         if (state == AppCenterEditorSDKTools.SDKState.SDKIsFull || state == AppCenterEditorSDKTools.SDKState.SDKNotFull)
         {
             AppCenterEditorSDKTools.ShowUpgradePanel();
         }
         DisplayEditorExtensionHelpMenu();
     }
     EditorGUILayout.EndHorizontal();
     GUILayout.EndScrollView();
     PruneBlockingRequests();
     Repaint();
 }
コード例 #2
0
ファイル: AppCenterEditor.cs プロジェクト: katyushi/HA-Game
 public static bool IsGUIEnabled()
 {
     if (blockingRequests.Count > 0 || EditorApplication.isCompiling)
     {
         return(false);
     }
     AppCenterEditorSDKTools.SDKState state = AppCenterEditorSDKTools.GetSDKState();
     return
         (!AppCenterEditorSDKTools.IsUpgrading &&
          state != AppCenterEditorSDKTools.SDKState.SDKNotFullAndInstalling &&
          state != AppCenterEditorSDKTools.SDKState.SDKNotInstalledAndInstalling);
 }
コード例 #3
0
 private void OnGuiInternal()
 {
     GUI.skin = AppCenterEditorHelper.uiStyle;
     using (new AppCenterGuiFieldHelper.UnityVertical())
     {
         GUI.enabled = IsGUIEnabled();
         AppCenterEditorHeader.DrawHeader();
         AppCenterEditorMenu.DrawMenu();
         AppCenterEditorSDKTools.DrawSdkPanel();
         foreach (var package in AppCenterSDKPackage.SupportedPackages)
         {
             AppCenterEditorSDKTools.DisplayPackagePanel(package);
         }
         AppCenterEditorSDKTools.SDKState state = AppCenterEditorSDKTools.GetSDKState();
         if (state == AppCenterEditorSDKTools.SDKState.SDKIsFull || state == AppCenterEditorSDKTools.SDKState.SDKNotFull)
         {
             AppCenterEditorSDKTools.ShowUpgradePanel();
         }
         DisplayEditorExtensionHelpMenu();
     }
     PruneBlockingRequests();
     Repaint();
 }
コード例 #4
0
        private void RemovePackage(bool prompt = true)
        {
            if (prompt && !EditorUtility.DisplayDialog("Confirm SDK Removal", string.Format("This action will remove the current {0} SDK.", Name), "Confirm", "Cancel"))
            {
                return;
            }
            EdExLogger.LoggerInstance.LogWithTimeStamp(string.Format("Removing {0} package...", Name));

            var    toDelete    = new List <string>();
            string pluginsPath = Path.Combine(AppCenterEditorPrefsSO.Instance.SdkPath, "Plugins");
            string androidPath = Path.Combine(pluginsPath, "Android");
            string sdkPath     = Path.Combine(pluginsPath, "AppCenterSDK");
            string iosPath     = Path.Combine(pluginsPath, "iOS");
            string wsaPath     = Path.Combine(pluginsPath, "WSA");

            toDelete.Add(Path.Combine(androidPath, string.Format("appcenter-{0}-release.aar", Name.ToLower())));
            toDelete.AddRange(Directory.GetFiles(Path.Combine(sdkPath, Name)));
            toDelete.AddRange(Directory.GetDirectories(Path.Combine(sdkPath, Name)));
            toDelete.Add(Path.Combine(sdkPath, Name));
            toDelete.AddRange(Directory.GetFiles(Path.Combine(iosPath, Name)));
            toDelete.AddRange(Directory.GetDirectories(Path.Combine(iosPath, Name)));
            toDelete.Add(Path.Combine(iosPath, Name));
            if (IsSupportedForWSA)
            {
                toDelete.AddRange(Directory.GetFiles(Path.Combine(wsaPath, Name)));
                toDelete.AddRange(Directory.GetDirectories(Path.Combine(wsaPath, Name)));
                toDelete.Add(Path.Combine(wsaPath, Name));
            }

            bool deleted = true;

            foreach (var path in toDelete)
            {
                if (!FileUtil.DeleteFileOrDirectory(path))
                {
                    if (!path.EndsWith("meta"))
                    {
                        deleted = false;
                    }
                }
                FileUtil.DeleteFileOrDirectory(path + ".meta");
            }

            // Remove Core if no packages left.
            List <AppCenterSDKPackage> installedPackages = new List <AppCenterSDKPackage>();

            installedPackages.AddRange(GetInstalledPackages());
            if (installedPackages.Count <= 1)
            {
                AppCenterEditorSDKTools.RemoveSdk(false);
            }

            if (deleted)
            {
                EdExLogger.LoggerInstance.LogWithTimeStamp(string.Format("{0} package removed.", Name));
                AppCenterEditor.RaiseStateUpdate(AppCenterEditor.EdExStates.OnSuccess, string.Format("App Center {0} SDK removed.", Name));

                // HACK for 5.4, AssetDatabase.Refresh(); seems to cause the install to fail.
                if (prompt)
                {
                    AssetDatabase.Refresh();
                }
            }
            else
            {
                AppCenterEditor.RaiseStateUpdate(AppCenterEditor.EdExStates.OnError, string.Format("An unknown error occured and the {0} SDK could not be removed.", Name));
            }
        }