Пример #1
0
 public static void OpenItemInAssetStore(AssetStoreAsset activeAsset)
 {
     if (activeAsset.id != 0)
     {
         AssetStore.Open(string.Format("content/{0}?assetID={1}", activeAsset.packageID, activeAsset.id));
     }
 }
Пример #2
0
 void DrawTutorial()
 {
     if (subStep == 0)
     {
         DrawText("MFPS come with support for Photon Voice, for use as Team Chat Voice feature.\n\n In order to use it you need do a few simply steps.");
         DrawImage(GetServerImage(0), TextAlignment.Center);
         DownArrow();
         DrawText("First all, you need to import the Photon Voice 2 package, you can get it free from the Asset Store, click in the button bellow to redirect to the package page:");
         GUILayout.Space(5);
         if (DrawButton("<color=yellow>Open Photon Voice 2</color>"))
         {
             AssetStore.Open("content/130518");
             NextStep();
         }
     }
     else if (subStep == 1)
     {
         DrawText("Now download and import the package from the asset store page and wait until process finish.");
         DownArrow();
         DrawText("Then, you need enable the integrated code, for it Go to (Toolbar) MFPS -> Addons -> Voice -> <b>Enable</b> and wait until script compilation finish.");
         DrawImage(GetServerImage(1));
         DownArrow();
         DrawText("After compilation finish do the same but click on the 'Integrate' button MFPS -> Addons -> Voice -> <b>Integrate</b>");
         DownArrow();
         DrawText("Ok, it's all, now Photon Voice is integrated");
     }
     else if (subStep == 2)
     {
         DrawText("For default Voice is set up to transmit only when push a key (Push to Talk) and is recommended use that way, you can change the key in bl_PlayerVoice.cs" +
                  " which is attached in the root of each Player prefab in Resources folder");
         DrawImage(GetServerImage(2));
     }
 }
Пример #3
0
        void OnGUI()
        {
            GUIStyle guiStyle = new GUIStyle(GUI.skin.button)
            {
                richText = true
            };

            GUIStyle labelStyle = new GUIStyle(GUI.skin.label)
            {
                richText  = true,
                alignment = TextAnchor.MiddleCenter
            };

            GUI.DrawTexture(new Rect(10, 25, 70, 70), tex, ScaleMode.StretchToFill);

            GUI.Label(new Rect(85, 6, 150, 70), "<size=13><b>We improve plugins\n based on your\n reviews!</b></size>", labelStyle);

            if (GUI.Button(new Rect(110, 80, 100, 30), "<size=14><b>Rate</b></size>", guiStyle))
            {
                UpdatePlugins.SetAppRated(desc.Id);

                AssetStore.Open("content/" + desc.Id);

                Close();
            }
        }
Пример #4
0
        private void ShowIntegration(string name, string description, string link, string exampleLink, string defName, Action onEnable, Action onDisable)
        {
            GUILayout.BeginVertical("box");
            if (GUILayout.Toggle(IsIntegrationEnabled(defName), name))
            {
                EnableIntegration(defName, onEnable);
            }
            else
            {
                DisableIntegration(defName, onDisable);
            }
            GUILayout.Label(description, EditorStyles.wordWrappedLabel);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            Color color = GUI.contentColor;

            GUI.contentColor = new Color(0, 0, 0.7f, 0.9f);
            if (!string.IsNullOrEmpty(exampleLink) && GUILayout.Button("Example", "label"))
            {
                Application.OpenURL(exampleLink);
            }
            GUILayout.Space(3);
            if (!string.IsNullOrEmpty(link) && GUILayout.Button("Asset Store", "label"))
            {
                AssetStore.Open(link);
            }
            GUI.contentColor = color;
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }
Пример #5
0
        void GoToInstaller()
        {
#if UNITY_2019_3_OR_NEWER
            PackageManager.UI.Window.Open(k_UdpPackageName);
#else
            AssetStore.Open(k_UdpAssetStoreIdentifier);
#endif
        }
Пример #6
0
 public static void OpenItemInAssetStore(AssetStoreAsset activeAsset)
 {
     if (activeAsset.id != 0)
     {
         AssetStore.Open(string.Format("content/{0}?assetID={1}", activeAsset.packageID, activeAsset.id));
         UsabilityAnalytics.Track(string.Format("/AssetStore/ViewInStore/{0}/{1}", activeAsset.packageID, activeAsset.id));
     }
 }
 public static void OpenItemInAssetStore(AssetStoreAsset activeAsset)
 {
     if (activeAsset.id == 0)
     {
         return;
     }
     AssetStore.Open(string.Format("content/{0}?assetID={1}", (object)activeAsset.packageID, (object)activeAsset.id));
     Analytics.Track(string.Format("/AssetStore/ViewInStore/{0}/{1}", (object)activeAsset.packageID, (object)activeAsset.id));
 }
Пример #8
0
        void PurchaseDeclinedGUI()
        {
            AssetStoreAsset.PreviewInfo item = m_Asset.previewInfo;
            GUILayout.BeginHorizontal();
            GUILayout.Space(5);
            GUILayout.Label(s_AssetStoreLogo, GUIStyle.none, GUILayout.ExpandWidth(false));
            GUILayout.BeginVertical();
            GUILayout.Label("Purchase declined", EditorStyles.boldLabel);
            GUILayout.Label("No money has been drawn from you credit card");

            bool  hasMessage = m_Message != null && m_Message != "";
            float newHeight  = kStandardHeight + (hasMessage ? 20 : 0);

            if (newHeight != position.height)
            {
                position = new Rect(position.x, position.y, position.width, newHeight);
            }

            if (hasMessage)
            {
                GUILayout.Label(m_Message, EditorStyles.wordWrappedLabel);
            }

            GUILayout.Label("Package: " + item.packageName, EditorStyles.wordWrappedLabel);

            GUILayout.EndVertical();
            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Space(8);

            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Close"))
            {
                UsabilityAnalytics.Track(string.Format("/AssetStore/DeclinedAbort/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_Asset = null;
                Close();
            }
            GUILayout.Space(5);
            if (GUILayout.Button("Put to basket"))
            {
                AssetStore.Open(string.Format("content/{0}/basketpurchase", m_Asset.packageID));
                UsabilityAnalytics.Track(string.Format("/AssetStore/DeclinedPutToBasket/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_Asset = null;
                Close();
            }
            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.Space(5);
        }
        private void InitiateBuySelected(bool firstAttempt)
        {
            AssetStoreAsset firstAsset = AssetStoreAssetSelection.GetFirstAsset();

            if (firstAsset == null)
            {
                EditorUtility.DisplayDialog("No asset selected", "Please select asset before buying a package", "ok");
            }
            else if (AssetStoreAssetInspector.paymentAvailability == AssetStoreAssetInspector.PaymentAvailability.AnonymousUser)
            {
                if (AssetStoreClient.LoggedIn())
                {
                    AssetStoreAssetSelection.RefreshFromServer(delegate
                    {
                        this.InitiateBuySelected(false);
                    });
                }
                else if (firstAttempt)
                {
                    this.LoginAndInitiateBuySelected();
                }
            }
            else if (AssetStoreAssetInspector.paymentAvailability == AssetStoreAssetInspector.PaymentAvailability.ServiceDisabled)
            {
                if (firstAsset.previewInfo == null)
                {
                    return;
                }
                AssetStore.Open(string.Format("content/{0}/directpurchase", firstAsset.packageID));
            }
            else if (AssetStoreAssetInspector.paymentAvailability == AssetStoreAssetInspector.PaymentAvailability.BasketNotEmpty)
            {
                if (firstAsset.previewInfo == null)
                {
                    return;
                }
                if (firstAttempt)
                {
                    AssetStoreAssetSelection.RefreshFromServer(delegate
                    {
                        this.InitiateBuySelected(false);
                    });
                }
                else
                {
                    AssetStore.Open(string.Format("content/{0}/basketpurchase", firstAsset.packageID));
                }
            }
            else
            {
                AssetStoreInstaBuyWindow.ShowAssetStoreInstaBuyWindow(firstAsset, AssetStoreAssetInspector.s_PurchaseMessage, AssetStoreAssetInspector.s_PaymentMethodCard, AssetStoreAssetInspector.s_PaymentMethodExpire, AssetStoreAssetInspector.s_PriceText);
            }
        }
        private static void DrawAssetInformation()
        {
            EditorGUILayout.Space();

#if UNITY_2019_3_OR_NEWER
            const float logoDimensions = 130f;
#else
            const float logoDimensions = 120f;
#endif

            var totalRect = EditorGUILayout.GetControlRect(false, logoDimensions);

            var logoRect = new Rect(totalRect);
            logoRect.xMax = logoRect.xMin + logoDimensions;

            GUI.DrawTexture(logoRect, _assetLogo, ScaleMode.StretchToFill);

            var detailsRect = new Rect(totalRect);
            detailsRect.xMin += logoDimensions + 5f;

            GUI.Box(detailsRect, GUIContent.none, _groupBoxStyle);
            detailsRect.xMin  += 5f;
            detailsRect.xMax  -= 5f;
            detailsRect.yMin  += 5f;
            detailsRect.height = EditorGUIUtility.singleLineHeight;
            GUI.Label(detailsRect, "Game 2D Water Kit v1.4", EditorStyles.boldLabel);
            detailsRect.y += EditorGUIUtility.singleLineHeight - 3f;
            GUI.Label(detailsRect, "www.game2dwaterkit.com", EditorStyles.miniBoldLabel);
            EditorGUI.DrawRect(new Rect(detailsRect.x, detailsRect.y + EditorGUIUtility.singleLineHeight, detailsRect.width, 1f), EditorStyles.label.normal.textColor);
            detailsRect.y += EditorGUIUtility.singleLineHeight + 7f;
            if (GUI.Button(detailsRect, "Asset Website"))
            {
                Application.OpenURL("https://game2dwaterkit.com/");
            }
            detailsRect.y += EditorGUIUtility.singleLineHeight + 3f;
            if (GUI.Button(detailsRect, "Getting Started Guide"))
            {
                Application.OpenURL("https://game2dwaterkit.com/#getting-started/");
            }
            detailsRect.y += EditorGUIUtility.singleLineHeight + 3f;
            if (GUI.Button(detailsRect, "Contact Publisher"))
            {
                Application.OpenURL("https://game2dwaterkit.com/contact/");
            }
            detailsRect.y += EditorGUIUtility.singleLineHeight + 3f;
            if (GUI.Button(detailsRect, "Rate/Review Asset"))
            {
                AssetStore.Open("content/118057");
            }
        }
Пример #11
0
 internal static IEnumerable <SearchAction> ActionHandlers()
 {
     return(new[]
     {
         new SearchAction(type, "open", null, "Open package in the Asset Store...")
         {
             handler = (item, context) =>
             {
                 var data = (AssetStoreData)item.data;
                 AssetStore.Open(string.Format("content/{0}?assetID={1}", data.packageId, data.id));
             }
         }
     });
 }
Пример #12
0
        private void PurchaseDeclinedGUI()
        {
            AssetStoreAsset.PreviewInfo previewInfo = this.m_Asset.previewInfo;
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(5f);
            GUILayout.Label(AssetStoreInstaBuyWindow.s_AssetStoreLogo, GUIStyle.none, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(false)
            });
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label("Purchase declined", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.Label("No money has been drawn from you credit card", new GUILayoutOption[0]);
            bool  flag = this.m_Message != null && this.m_Message != string.Empty;
            float num  = (float)(160 + ((!flag) ? 0 : 20));

            if (num != base.position.height)
            {
                base.position = new Rect(base.position.x, base.position.y, base.position.width, num);
            }
            if (flag)
            {
                GUILayout.Label(this.m_Message, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            }
            GUILayout.Label("Package: " + previewInfo.packageName, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(8f);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Close", new GUILayoutOption[0]))
            {
                Analytics.Track(string.Format("/AssetStore/DeclinedAbort/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_Asset = null;
                base.Close();
            }
            GUILayout.Space(5f);
            if (GUILayout.Button("Put to basket", new GUILayoutOption[0]))
            {
                AssetStore.Open(string.Format("content/{0}/basketpurchase", this.m_Asset.packageID));
                Analytics.Track(string.Format("/AssetStore/DeclinedPutToBasket/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_Asset = null;
                base.Close();
            }
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.Space(5f);
        }
Пример #13
0
 private void ShowHelpPageOrBrowseURL(string url, string analyticsAction)
 {
     Analytics.Track(string.Format("/WelcomeScreen/OpenURL/{0}/{1}", analyticsAction, WelcomeScreen.s_ShowCount));
     if (url.StartsWith("file"))
     {
         Help.ShowHelpPage(url);
     }
     else if (url.StartsWith("home/"))
     {
         AssetStore.Open(url);
         GUIUtility.ExitGUI();
     }
     else
     {
         Help.BrowseURL(url);
     }
 }
Пример #14
0
        private void DrawDOTween()
        {
            GUIStyle iconStyle = Settings.DOTweenDetected ? s_iconOk : s_iconError;

            GUILayout.BeginHorizontal(s_itemBackground);
            {
                GUILayout.Space(24);
                GUILayout.BeginVertical(GUILayout.Height(s_itemBackground.fixedHeight));
                {
                    GUILayout.Space(s_itemBackground.fixedHeight / 2 - iconStyle.fixedHeight / 2);
                    GUILayout.Label(iconStyle.normal.background);
                }
                GUILayout.EndVertical();
                GUILayout.Space(48);
                GUILayout.BeginVertical(GUILayout.Height(s_itemBackground.fixedHeight));
                {
                    GUILayout.Space(s_itemBackground.fixedHeight / 2 - s_logoDOTween.fixedHeight / 2);
                    GUILayout.Label(s_logoDOTween.normal.background);
                }
                GUILayout.EndVertical();
                GUILayout.FlexibleSpace();
                if (Settings.DOTweenDetected)
                {
                    GUILayout.Label(Labels.Installed, s_labelGreen, GUILayout.Height(s_itemBackground.fixedHeight));
                }
                else
                {
                    GUILayout.BeginVertical(GUILayout.Height(s_itemBackground.fixedHeight));
                    {
                        GUILayout.Space(s_itemBackground.fixedHeight / 2 - s_downloadButton.fixedHeight / 2);
                        if (GUILayout.Button(Labels.Download, s_downloadButton))
                        {
                            AssetStore.Open("content/27676");                                                      //DOTween Asset Store Id
                        }
                    }
                    GUILayout.EndVertical();
                }

                GUILayout.Space(32);
            }
            GUILayout.EndHorizontal();
        }
Пример #15
0
 void OnGUI()
 {
     if (CheckPlaymakerInstalled() && CheckSuperTilemapEditorInstalled())
     {
         GUILayout.Label("Everything is fine, you can now use Playmaker4STE. Enjoy!");
     }
     else
     {
         GUILayout.Label("In order to use this asset you need to install the following assets:");
     }
     EditorGUILayout.Space();
     if (!CheckSuperTilemapEditorInstalled() && GUILayout.Button("Super Tilemap Editor"))
     {
         AssetStore.Open("content/56339");
     }
     if (!CheckPlaymakerInstalled() && GUILayout.Button("Playmaker"))
     {
         AssetStore.Open("content/368");
     }
 }
 public void OpenInAssetStore(object userData)
 {
     AssetStore.Open("content/" + userData);
 }
Пример #17
0
        public void OnGUI()
        {
            if (AssetStoreLoginWindow.styles == null)
            {
                AssetStoreLoginWindow.styles = new AssetStoreLoginWindow.Styles();
            }
            AssetStoreLoginWindow.LoadLogos();
            if (AssetStoreClient.LoginInProgress() || AssetStoreClient.LoggedIn())
            {
                GUI.enabled = false;
            }
            GUILayout.BeginVertical();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal();
            GUILayout.Space(5f);
            GUILayout.Label(AssetStoreLoginWindow.s_AssetStoreLogo, GUIStyle.none, new GUILayoutOption[1]
            {
                GUILayout.ExpandWidth(false)
            });
            GUILayout.BeginVertical();
            GUILayout.BeginHorizontal();
            GUILayout.Space(6f);
            GUILayout.Label(this.m_LoginReason, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            Rect lastRect = GUILayoutUtility.GetLastRect();

            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Space(6f);
            Rect rect = new Rect(0.0f, 0.0f, 0.0f, 0.0f);

            if (this.m_LoginRemoteMessage != null)
            {
                Color color = GUI.color;
                GUI.color = Color.red;
                GUILayout.Label(this.m_LoginRemoteMessage, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
                GUI.color = color;
                rect      = GUILayoutUtility.GetLastRect();
            }
            float height = (float)((double)lastRect.height + (double)rect.height + 110.0);

            if (Event.current.type == EventType.Repaint && (double)height != (double)this.position.height)
            {
                this.position = new Rect(this.position.x, this.position.y, this.position.width, height);
                this.Repaint();
            }
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUI.SetNextControlName("username");
            this.m_Username = EditorGUILayout.TextField("Username", this.m_Username, new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            this.m_Password = EditorGUILayout.PasswordField("Password", this.m_Password, new GUILayoutOption[1]
            {
                GUILayout.ExpandWidth(true)
            });
            if (GUILayout.Button(new GUIContent("Forgot?", "Reset your password"), AssetStoreLoginWindow.styles.link, new GUILayoutOption[1]
            {
                GUILayout.ExpandWidth(false)
            }))
            {
                Application.OpenURL("https://accounts.unity3d.com/password/new");
            }
            EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
            GUILayout.EndHorizontal();
            bool rememberSession = AssetStoreClient.RememberSession;
            bool flag            = EditorGUILayout.Toggle("Remember me", rememberSession, new GUILayoutOption[0]);

            if (flag != rememberSession)
            {
                AssetStoreClient.RememberSession = flag;
            }
            GUILayout.EndVertical();
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.Space(8f);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Create account"))
            {
                AssetStore.Open("createuser/");
                this.m_LoginRemoteMessage = "Cancelled - create user";
                this.Close();
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Cancel"))
            {
                this.m_LoginRemoteMessage = "Cancelled";
                this.Close();
            }
            GUILayout.Space(5f);
            if (GUILayout.Button("Login"))
            {
                this.DoLogin();
                this.Repaint();
            }
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.Space(5f);
            GUILayout.EndVertical();
            if (Event.current.Equals((object)Event.KeyboardEvent("return")))
            {
                this.DoLogin();
                this.Repaint();
            }
            if (!(this.m_Username == string.Empty))
            {
                return;
            }
            EditorGUI.FocusTextInControl("username");
        }
Пример #18
0
        private void PasswordGUI()
        {
            AssetStoreAsset.PreviewInfo previewInfo = this.m_Asset.previewInfo;
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(5f);
            GUILayout.Label(AssetStoreInstaBuyWindow.s_AssetStoreLogo, GUIStyle.none, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(false)
            });
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label("Complete purchase by entering your AssetStore password", EditorStyles.boldLabel, new GUILayoutOption[0]);
            bool  flag  = this.m_PurchaseMessage != null && this.m_PurchaseMessage != string.Empty;
            bool  flag2 = this.m_Message != null && this.m_Message != string.Empty;
            float num   = (float)(160 + ((!flag) ? 0 : 20) + ((!flag2) ? 0 : 20));

            if (num != base.position.height)
            {
                base.position = new Rect(base.position.x, base.position.y, base.position.width, num);
            }
            if (flag)
            {
                GUILayout.Label(this.m_PurchaseMessage, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            }
            if (flag2)
            {
                Color color = GUI.color;
                GUI.color = Color.red;
                GUILayout.Label(this.m_Message, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
                GUI.color = color;
            }
            GUILayout.Label("Package: " + previewInfo.packageName, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            string text = string.Format("Credit card: {0} (expires {1})", this.m_PaymentMethodCard, this.m_PaymentMethodExpire);

            GUILayout.Label(text, EditorStyles.wordWrappedLabel, new GUILayoutOption[0]);
            GUILayout.Space(8f);
            EditorGUILayout.LabelField("Amount", this.m_PriceText, new GUILayoutOption[0]);
            this.m_Password = EditorGUILayout.PasswordField("Password", this.m_Password, new GUILayoutOption[0]);
            GUILayout.EndVertical();
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(8f);
            if (GUILayout.Button("Just put to basket...", new GUILayoutOption[0]))
            {
                AssetStore.Open(string.Format("content/{0}/basketpurchase", this.m_Asset.packageID));
                Analytics.Track(string.Format("/AssetStore/PutToBasket/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_Asset = null;
                base.Close();
                GUIUtility.ExitGUI();
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Cancel", new GUILayoutOption[0]))
            {
                Analytics.Track(string.Format("/AssetStore/CancelInstaBuy/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_Asset = null;
                base.Close();
                GUIUtility.ExitGUI();
            }
            GUILayout.Space(5f);
            if (GUILayout.Button("Complete purchase", new GUILayoutOption[0]))
            {
                this.CompletePurchase();
            }
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.Space(5f);
        }
 public static void OpenPlaymaker()
 {
     AssetStore.Open(playMaker.ToStoreId());
 }
    public void OnGUI()
    {
        using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(scrollPosition))
        {
            scrollPosition = scrollViewScope.scrollPosition;

            if (versionResource != null && !versionResource.isDone)
            {
                EditorGUILayout.HelpBox("Checking for updates...", MessageType.Info);
                return;
            }

            if (latestRelease == null)
            {
                EditorGUILayout.HelpBox("There was a problem checking for updates.", MessageType.Error);
                DrawCheckAgainButton();

                return;
            }

            string newVersionName = latestRelease.name == string.Format("Version {0}", latestRelease.version)
                                        ? string.Empty
                                        : string.Format(" \"{0}\"", latestRelease.name);
            bool isUpToDate = VRTK_Defines.CurrentVersion >= latestRelease.version;

            EditorGUILayout.HelpBox(
                string.Format(
                    "{0}.\n\nInstalled Version: {1}\nAvailable version: {2}{3} (published on {4})",
                    isUpToDate ? "Already up to date" : "A new version of VRTK is available",
                    VRTK_Defines.CurrentVersion,
                    latestRelease.version,
                    newVersionName,
                    latestRelease.publishedDateTime.ToLocalTime()),
                isUpToDate ? MessageType.Info : MessageType.Warning);

            DrawCheckAgainButton();

            isChangelogFoldOut = EditorGUILayout.Foldout(isChangelogFoldOut, "Changelog", true);
            if (isChangelogFoldOut)
            {
                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.Space(10);

                    using (new EditorGUILayout.VerticalScope())
                    {
                        VRTK_EditorUtilities.DrawScrollableSelectableLabel(
                            ref changelogScrollPosition,
                            ref changelogWidth,
                            latestRelease.changelogPages[changelogPageIndex],
                            new GUIStyle(EditorStyles.textArea)
                        {
                            richText = true
                        });

                        if (latestRelease.changelogPages.Count > 0)
                        {
                            using (new EditorGUILayout.HorizontalScope())
                            {
                                using (new EditorGUI.DisabledGroupScope(changelogPageIndex == 0))
                                {
                                    if (GUILayout.Button("Previous Page"))
                                    {
                                        changelogPageIndex      = Math.Max(0, --changelogPageIndex);
                                        changelogScrollPosition = Vector3.zero;
                                    }
                                }
                                using (new EditorGUI.DisabledGroupScope(changelogPageIndex == latestRelease.changelogPages.Count - 1))
                                {
                                    if (GUILayout.Button("Next Page"))
                                    {
                                        changelogPageIndex      = Math.Min(latestRelease.changelogPages.Count - 1, ++changelogPageIndex);
                                        changelogScrollPosition = Vector3.zero;
                                    }
                                }
                            }
                        }

                        if (GUILayout.Button("View on GitHub"))
                        {
                            Application.OpenURL(latestRelease.html_url);
                        }
                    }
                }
            }

            if (isUpToDate)
            {
                return;
            }

            GUILayout.FlexibleSpace();

            VRTK_EditorUtilities.AddHeader("Get Latest Version");
            using (new EditorGUILayout.HorizontalScope())
            {
                if (GUILayout.Button("From Asset Store"))
                {
                    AssetStore.Open(assetStoreURL);
                    Close();
                }
                if (GUILayout.Button("From GitHub"))
                {
                    Application.OpenURL(latestRelease.zipball_url);
                }
            }

            using (EditorGUI.ChangeCheckScope changeCheckScope = new EditorGUI.ChangeCheckScope())
            {
                string key        = string.Format(hidePromptKeyFormat, latestRelease.version);
                bool   hideToggle = EditorPrefs.HasKey(key);

                hideToggle = GUILayout.Toggle(hideToggle, "Do not prompt for this version again.");

                if (changeCheckScope.changed)
                {
                    if (hideToggle)
                    {
                        EditorPrefs.SetBool(key, true);
                    }
                    else
                    {
                        EditorPrefs.DeleteKey(key);
                    }
                }
            }
        }
    }
 public static void OpenFishesVol1()
 {
     AssetStore.Open(fishesVol1.ToStoreId());
 }
 public static void OpenBackgroundsVol2()
 {
     AssetStore.Open(backgroundsVol2.ToStoreId());
 }
Пример #23
0
 public static void GetWindowsPhone8Addon()
 {
     AssetStore.Open("content/10602");
 }
 public static void OpenVillageVol1()
 {
     AssetStore.Open(villageVol1.ToStoreId());
 }
Пример #25
0
        private void OnGUI()
        {
            GUIStyle guiStyle = new GUIStyle(GUI.skin.button)
            {
                richText = true
            };

            int       y                = 15;
            const int x                = 10;
            int       width            = WindowWidth - x * 2;
            const int scrollAreaHeight = 150;


            if (UpdatePlugins.pluginsToUpdate.Count > 0)
            {
                const int btnHeight = 40;
                const int btnSpace  = 7;
                int       scrollY   = 0;

                int scrollHeight = UpdatePlugins.pluginsToUpdate.Count * (btnHeight + btnSpace);

                // Make sure scrollbar is always visible
                if (scrollHeight < scrollAreaHeight + 2)
                {
                    scrollHeight = scrollAreaHeight + 2;
                }

                int scrollWidth = width - 10;
                _scrollPos = GUI.BeginScrollView(new Rect(x, y, width + 10, scrollAreaHeight), _scrollPos, new Rect(0, 0, scrollWidth, scrollHeight));


                for (int i = 0; i < UpdatePlugins.pluginsToUpdate.Count; ++i)
                {
                    UpdatePlugins.PluginDesc desc = UpdatePlugins.pluginsToUpdate[i];

                    if (GUI.Button(new Rect(0, scrollY, scrollWidth, btnHeight), "<size=11><b>Update</b>\n" + desc.Name + "</size>", guiStyle))
                    {
                        AssetStore.Open("content/" + desc.Id);
                        RegisterEvent("pluginUpdatePress");
                    }

                    scrollY += btnHeight + btnSpace;
                }

                GUI.EndScrollView();
            }
            else
            {
                GUI.Label(new Rect(x, 40, width, 100), "<size=15><b>All plugins are up-to-date</b></size>", guiStyle);
            }

            // Start new area with promo
            y = 170;

            GUI.DrawTexture(new Rect(0, y, WindowWidth, 3), GetWhiteTex());


            GUIStyle labelStyle = new GUIStyle(GUI.skin.label)
            {
                richText  = true,
                alignment = TextAnchor.MiddleCenter
            };

            labelStyle.normal.textColor = guiStyle.normal.textColor;

            y += 10;
            if (GUI.Button(new Rect(x, y, width, 80), ""))
            {
                AssetStore.Open("content/45507");
                RegisterEvent("promo1Press");
            }

            // button texture 1
            GUI.DrawTexture(new Rect(x + 10, y + 5, 70, 70), GetPromo1Tex(), ScaleMode.StretchToFill);
            GUI.Label(new Rect(x + 90, y + 4, width - 100, 72), "<size=15><b>Android\nNotifications:</b></size><size=15>\nLocal and Push</size>", labelStyle);


            y += 90;
            if (GUI.Button(new Rect(x, y, width, 80), ""))
            {
                AssetStore.Open("content/58550");
                RegisterEvent("promo2Press");
            }

            // button texture 2
            GUI.DrawTexture(new Rect(x + 10, y + 5, 70, 70), GetPromo2Tex(), ScaleMode.StretchToFill);
            GUI.Label(new Rect(x + 90, y + 4, width - 100, 72), "<size=15><b>iOS\nNotifications:</b></size><size=15>\nLocal and Push</size>", labelStyle);


            y += 90;
            if (GUI.Button(new Rect(x, y, width, 80), ""))
            {
                AssetStore.Open("content/57268");
                RegisterEvent("promo3Press");
            }

            // button texture 3
            GUI.DrawTexture(new Rect(x + 10, y + 5, 70, 70), GetPromo3Tex(), ScaleMode.StretchToFill);
            GUI.Label(new Rect(x + 90, y + 4, width - 100, 72), "<size=15><b>Admob Ads\nfor Android, iOS,\nAmazon</b></size><size=15></size>", labelStyle);


            y = WindowHeight - 50;
            GUI.DrawTexture(new Rect(0, y, WindowWidth, 3), GetWhiteTex());

            const int socBtnSize  = 37;
            const int socBtnSpace = 5;

            Rect     socRect = new Rect(WindowWidth - 10 - socBtnSize, y + 8, socBtnSize, socBtnSize);
            GUIStyle s       = new GUIStyle();

            if (GUI.Button(socRect, GetIconFb(), s))
            {
                Application.OpenURL("https://www.facebook.com/Area730Official/");
                RegisterEvent("socialFbPress");
            }
            EditorGUIUtility.AddCursorRect(socRect, MouseCursor.Link);

            socRect.x -= socBtnSize + socBtnSpace;

            if (GUI.Button(socRect, GetIconTw(), s))
            {
                Application.OpenURL("https://twitter.com/area_730");
                RegisterEvent("socialTwPress");
            }
            EditorGUIUtility.AddCursorRect(socRect, MouseCursor.Link);

            socRect.x -= socBtnSize + socBtnSpace;

            if (GUI.Button(socRect, GetIconVk(), s))
            {
                Application.OpenURL("https://vk.com/area730");
                RegisterEvent("socialVkPress");
            }
            EditorGUIUtility.AddCursorRect(socRect, MouseCursor.Link);

            socRect.x -= socBtnSize + socBtnSpace;

            if (GUI.Button(socRect, GetIconUnity(), s))
            {
                Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/search/page=1/sortby=popularity/query=publisher:12354");
                RegisterEvent("socialUnityPress");
            }
            EditorGUIUtility.AddCursorRect(socRect, MouseCursor.Link);
        }
Пример #26
0
        private void CreateProductEntry(ProductInfo p)
        {
            EditorGUILayout.BeginVertical("Box", GUILayout.Width(428));

            EditorGUILayout.BeginHorizontal();

            //Create and anchor the foldout
            GUILayout.Label(GUIContent.none, GUILayout.Width(230));

            var productLabel = new GUIContent(" " + p.name, p.icon);

            p.expanded = EditorGUI.Foldout(GUILayoutUtility.GetLastRect(), p.expanded, productLabel, true, _styles.foldout);

            //New update marker
            if (p.newUpdateAvailable)
            {
                if (p.status == ProductStatus.PatchAvailable)
                {
                    GUILayout.Label(new GUIContent("#", "New patch available!"), _styles.labelHighlight, GUILayout.Width(20));
                }
                else
                {
                    GUILayout.Label(new GUIContent("!", "New update available!"), _styles.labelHighlight, GUILayout.Width(20));
                }
            }
            else
            {
                GUILayout.Label(GUIContent.none, GUILayout.Width(20));
            }

            //Version
            GUIContent status;

            if (p.installedVersion == null)
            {
                status = new GUIContent("N/A", "Not installed");
            }
            else
            {
                status = new GUIContent(Write(p.installedVersion), "Installed version");
            }

            GUILayout.Label(status, GUILayout.Width(50));

            //Link buttons / status
            if (p.status != ProductStatus.UpToDate)
            {
                if (p.status == ProductStatus.ComingSoon)
                {
                    EditorGUILayout.LabelField("Coming soon", GUILayout.Width(80));
                }
                else if (p.status == ProductStatus.UpdateAvailable)
                {
                    if (GUILayout.Button(new GUIContent("Update It", string.Format("Version {0} is now available.\n\nClick to open the product's page on the Unity Asset Store.", p.newestVersion))))
                    {
                        AssetStore.Open(p.storeUrl);
                    }
                }
                else if (p.status == ProductStatus.ProductAvailable)
                {
                    if (GUILayout.Button(new GUIContent("Get It", "Now available.\n\nClick to open the product's page on the Unity Asset Store.")))
                    {
                        AssetStore.Open(p.storeUrl);
                    }
                }
                else if (p.status == ProductStatus.PatchAvailable)
                {
                    if (GUILayout.Button(new GUIContent("Patch It", "A patch is available.\n\nClick to download and apply the patch. Patches are hot fixes and all patches will be included in the following product update.")))
                    {
                        ProductManager.ApplyPatches(p, _settings);
                    }
                }
            }

            EditorGUILayout.EndHorizontal();

            //Details
            if (p.expanded)
            {
                GUILayout.Box(GUIContent.none, _styles.boxSeparator);
                var description = string.IsNullOrEmpty(p.description) ? "No description available" : p.description;
                EditorGUILayout.LabelField(description, _styles.labelWithWrap);

                EditorGUILayout.BeginHorizontal();

                if (!string.IsNullOrEmpty(p.productUrl))
                {
                    if (GUILayout.Button("Product Page", _styles.labelLink))
                    {
                        Application.OpenURL(p.productUrl);
                    }

                    EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
                }

                if (!string.IsNullOrEmpty(p.changeLogPath))
                {
                    if (GUILayout.Button("Change Log", _styles.labelLink))
                    {
                        Application.OpenURL(p.changeLogPath);
                    }

                    EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
                }

                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.EndVertical();
        }
Пример #27
0
 private static void OpenPackagePage()
 {
     AssetStore.Open("content/130518");
 }
Пример #28
0
        void PasswordGUI()
        {
            AssetStoreAsset.PreviewInfo item = m_Asset.previewInfo;
            GUILayout.BeginHorizontal();
            GUILayout.Space(5);
            GUILayout.Label(s_AssetStoreLogo, GUIStyle.none, GUILayout.ExpandWidth(false));
            GUILayout.BeginVertical();
            GUILayout.Label("Complete purchase by entering your AssetStore password", EditorStyles.boldLabel);
            bool  hasMessage      = m_PurchaseMessage != null && m_PurchaseMessage != "";
            bool  hasErrorMessage = m_Message != null && m_Message != "";
            float newHeight       = kStandardHeight + (hasMessage ? 20 : 0) + (hasErrorMessage ? 20 : 0);

            if (newHeight != position.height)
            {
                position = new Rect(position.x, position.y, position.width, newHeight);
            }

            if (hasMessage)
            {
                GUILayout.Label(m_PurchaseMessage, EditorStyles.wordWrappedLabel);
            }
            if (hasErrorMessage)
            {
                Color oldColor = GUI.color;
                GUI.color = Color.red;
                GUILayout.Label(m_Message, EditorStyles.wordWrappedLabel);
                GUI.color = oldColor;
            }
            GUILayout.Label("Package: " + item.packageName, EditorStyles.wordWrappedLabel);
            string cardInfo = string.Format("Credit card: {0} (expires {1})", m_PaymentMethodCard, m_PaymentMethodExpire);

            GUILayout.Label(cardInfo, EditorStyles.wordWrappedLabel);
            GUILayout.Space(8);
            EditorGUILayout.LabelField("Amount", m_PriceText);
            m_Password = EditorGUILayout.PasswordField("Password", m_Password);
            GUILayout.EndVertical();
            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Space(8);
            if (GUILayout.Button("Just put to basket..."))
            {
                AssetStore.Open(string.Format("content/{0}/basketpurchase", m_Asset.packageID));
                UsabilityAnalytics.Track(string.Format("/AssetStore/PutToBasket/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_Asset = null;
                this.Close();
                GUIUtility.ExitGUI();
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Cancel"))
            {
                UsabilityAnalytics.Track(string.Format("/AssetStore/CancelInstaBuy/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_Asset = null;
                this.Close();
                GUIUtility.ExitGUI();
            }
            GUILayout.Space(5);
            if (GUILayout.Button("Complete purchase"))
            {
                CompletePurchase();
            }

            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.Space(5);
        }
Пример #29
0
        private void AddIntegration(string name, string link, string defName, string description, Action onEnable, Action onDisable)
        {
            GUILayout.BeginVertical("box");

            GUILayout.BeginHorizontal();

            if (defName == string.Empty)
            {
                GUI.enabled = false;
            }
            else
            {
                GUI.enabled = true;
            }

            GUILayout.Space(3);
            GUILayout.BeginVertical();
            GUILayout.Space(2);
            if (GUILayout.Toggle(IsIntegrationEnabled(defName), " " + name))
            {
                EnableIntegration(defName, onEnable);
            }
            else
            {
                DisableIntegration(defName, onDisable);
            }
            GUILayout.EndVertical();

            GUI.enabled = true;

            GUILayout.FlexibleSpace();

            if (description.Length != 0)
            {
                GUI.color = new Color(1.5f, 1.5f, 0f);

                GUILayout.BeginVertical();
                GUILayout.Space(2);
                if (GUILayout.Button(new GUIContent(@"/!\", description), GUILayout.Width(30)))
                {
                    EditorUtility.DisplayDialog("Easy Build System - Integration", description, "Ok");
                }
                GUILayout.EndVertical();
            }

            GUI.color = GetEditorColor;

            GUILayout.BeginVertical();
            GUILayout.Space(2);
            if (GUILayout.Button("Asset Store Page", GUILayout.Width(125)) && link != string.Empty)
            {
                AssetStore.Open(link);
            }
            GUILayout.EndVertical();

            GUI.color = Color.white;

            GUILayout.EndHorizontal();

            GUILayout.Space(3);

            GUILayout.EndVertical();
        }
        /**
         * Initiate a purchase of the selected package from the asset store.
         * The package will be the one that contains the currently selected asset.
         *
         * Since not all users may have allowed for single click purchases this can result
         * in two scenarios:
         * 1. single click allowed and a native purchase acknowledgement dialog appears to
         *    finalize the purchase.
         * 2. single click is not allowed and the package is put to an asset store basket.
         *    Then the asset store window is displayed with the basket open.
         */
        void InitiateBuySelected(bool firstAttempt)
        {
            //Debug.Log("payavail " + paymentAvailability.ToString());
            // Ask the asset store if the use has allowed single click payments
            AssetStoreAsset asset = AssetStoreAssetSelection.GetFirstAsset();

            if (asset == null)
            {
                EditorUtility.DisplayDialog("No asset selected", "Please select asset before buying a package", "ok");
            }
            else if (paymentAvailability == PaymentAvailability.AnonymousUser)
            {
                // Maybe the asset store window did a login already and we have a session key
                // then we just need to fetch the new info
                if (AssetStoreClient.LoggedIn())
                {
                    AssetStoreAssetSelection.RefreshFromServer(delegate() {
                        InitiateBuySelected(false);
                    });
                }
                else if (firstAttempt)
                {
                    LoginAndInitiateBuySelected();
                }
            }
            else if (paymentAvailability == PaymentAvailability.ServiceDisabled)
            {
                // Use the asset store window to complete the purchase since single click is not possible
                if (asset.previewInfo == null)
                {
                    return;
                }
                AssetStore.Open(string.Format("content/{0}/directpurchase", asset.packageID));
            }
            else if (paymentAvailability == PaymentAvailability.BasketNotEmpty)
            {
                // Use the asset store window to complete the purchase since there is already \
                // something in the users basket
                if (asset.previewInfo == null)
                {
                    return;
                }

                // Maybe the basket has been emptied and this is a retry by the user
                if (firstAttempt)
                {
                    AssetStoreAssetSelection.RefreshFromServer(delegate() {
                        InitiateBuySelected(false);
                    });
                }
                else
                {
                    AssetStore.Open(string.Format("content/{0}/basketpurchase", asset.packageID));
                }
            }
            else
            {
                // Show single click window
                AssetStoreInstaBuyWindow.ShowAssetStoreInstaBuyWindow(asset,
                                                                      AssetStoreAssetInspector.s_PurchaseMessage,
                                                                      AssetStoreAssetInspector.s_PaymentMethodCard,
                                                                      AssetStoreAssetInspector.s_PaymentMethodExpire,
                                                                      AssetStoreAssetInspector.s_PriceText
                                                                      );
            }
        }