Track() private method

private Track ( string page ) : void
page string
return void
Beispiel #1
0
        // Open the dialog to allow the user to purchase the asset
        static public AssetStoreInstaBuyWindow ShowAssetStoreInstaBuyWindow(AssetStoreAsset asset, string purchaseMessage, string paymentMethodCard, string paymentMethodExpire, string priceText)
        {
            AssetStoreInstaBuyWindow w = EditorWindow.GetWindowWithRect <AssetStoreInstaBuyWindow>(new Rect(100, 100, 400, kStandardHeight), true, "Buy package from Asset Store");

            if (w.m_Purchasing != PurchaseStatus.Init)
            {
                EditorUtility.DisplayDialog("Download in progress", "There is already a package download in progress. You can only have one download running at a time", "Close");
                return(w);
            }

            w.position = new Rect(100, 100, 400, kStandardHeight);
            w.m_Parent.window.m_DontSaveToLayout = true;
            w.m_Asset      = asset;
            w.m_Password   = "";
            w.m_Message    = "";
            w.m_Purchasing = PurchaseStatus.Init;
            w.m_NextAllowedBuildRequestTime = 0.0;
            w.m_BuildAttempts = 0;

            w.m_PurchaseMessage     = purchaseMessage;
            w.m_PaymentMethodCard   = paymentMethodCard;
            w.m_PaymentMethodExpire = paymentMethodExpire;
            w.m_PriceText           = priceText;
            UsabilityAnalytics.Track(string.Format("/AssetStore/ShowInstaBuy/{0}/{1}", w.m_Asset.packageID, w.m_Asset.id));
            return(w);
        }
Beispiel #2
0
 private void DoBake()
 {
     UsabilityAnalytics.Track("/LightMapper/Start");
     UsabilityAnalytics.Event("LightMapper", "Mode", LightmapSettings.lightmapsMode.ToString(), 1);
     UsabilityAnalytics.Event("LightMapper", "Button", "BakeScene", 1);
     Lightmapping.BakeAsync();
 }
Beispiel #3
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));
     }
 }
Beispiel #4
0
        private void Buttons()
        {
            bool enabled = GUI.enabled;

            GUI.enabled &= !EditorApplication.isPlayingOrWillChangePlaymode;
            bool flag = LightModeUtil.Get().IsWorkflowAuto();

            if (Lightmapping.lightingDataAsset && !Lightmapping.lightingDataAsset.isValid)
            {
                EditorGUILayout.HelpBox(Lightmapping.lightingDataAsset.validityErrorMessage, MessageType.Warning);
            }
            EditorGUILayout.Space();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            EditorGUI.BeginChangeCheck();
            flag = GUILayout.Toggle(flag, LightingWindow.Styles.ContinuousBakeLabel, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                LightModeUtil.Get().SetWorkflow(flag);
            }
            using (new EditorGUI.DisabledScope(flag))
            {
                bool flag2 = flag || !Lightmapping.isRunning;
                if (flag2)
                {
                    if (EditorGUI.ButtonWithDropdownList(LightingWindow.Styles.BuildLabel, LightingWindow.s_BakeModeOptions, new GenericMenu.MenuFunction2(this.BakeDropDownCallback), new GUILayoutOption[]
                    {
                        GUILayout.Width(180f)
                    }))
                    {
                        this.DoBake();
                        GUIUtility.ExitGUI();
                    }
                }
                else
                {
                    if (LightmapEditorSettings.giBakeBackend == LightmapEditorSettings.GIBakeBackend.PathTracer && LightModeUtil.Get().AreBakedLightmapsEnabled() && GUILayout.Button("Force Stop", new GUILayoutOption[]
                    {
                        GUILayout.Width(150f)
                    }))
                    {
                        Lightmapping.ForceStop();
                    }
                    if (GUILayout.Button("Cancel", new GUILayoutOption[]
                    {
                        GUILayout.Width(150f)
                    }))
                    {
                        Lightmapping.Cancel();
                        UsabilityAnalytics.Track("/LightMapper/Cancel");
                    }
                }
            }
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
            GUI.enabled = enabled;
        }
Beispiel #5
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);
        }
Beispiel #6
0
        void PurchaseSuccessGUI()
        {
            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 completed succesfully", EditorStyles.boldLabel);
            GUILayout.Label("You will receive a receipt in your email soon.");

            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/PurchaseOk/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_Asset = null;
                this.Close();
            }
            GUILayout.Space(5);
            if (GUILayout.Button("Import package"))
            {
                UsabilityAnalytics.Track(string.Format("/AssetStore/PurchaseOkImport/{0}/{1}", m_Asset.packageID, m_Asset.id));
                m_BuildAttempts = 1;
                m_Asset.previewInfo.buildProgress = 0f;
                m_Purchasing = PurchaseStatus.StartBuild;
            }
            GUILayout.Space(5);
            GUILayout.EndHorizontal();

            GUILayout.Space(5);
        }
Beispiel #7
0
        public static void ShowAssetStoreLoginWindow(string loginReason, AssetStoreLoginWindow.LoginCallback callback)
        {
            AssetStoreLoginWindow windowWithRect = EditorWindow.GetWindowWithRect <AssetStoreLoginWindow>(new Rect(100f, 100f, 360f, 140f), true, "Login to Asset Store");

            windowWithRect.position = new Rect(100f, 100f, windowWithRect.position.width, windowWithRect.position.height);
            windowWithRect.m_Parent.window.m_DontSaveToLayout = true;
            windowWithRect.m_Password           = "";
            windowWithRect.m_LoginCallback      = callback;
            windowWithRect.m_LoginReason        = loginReason;
            windowWithRect.m_LoginRemoteMessage = null;
            UsabilityAnalytics.Track("/AssetStore/Login");
        }
Beispiel #8
0
        // For free or already purchased packages this will open the dialog
        // and just import the package.
        static public void ShowAssetStoreInstaBuyWindowBuilding(AssetStoreAsset asset)
        {
            AssetStoreInstaBuyWindow w = ShowAssetStoreInstaBuyWindow(asset, "", "", "", "");

            if (w.m_Purchasing != PurchaseStatus.Init)
            {
                EditorUtility.DisplayDialog("Download in progress", "There is already a package download in progress. You can only have one download running at a time", "Close");
                return;
            }
            w.m_Purchasing    = PurchaseStatus.StartBuild;
            w.m_BuildAttempts = 1;
            asset.previewInfo.buildProgress = 0f;
            UsabilityAnalytics.Track(string.Format("/AssetStore/ShowInstaFree/{0}/{1}", w.m_Asset.packageID, w.m_Asset.id));
        }
Beispiel #9
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 != "";
            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]))
            {
                UsabilityAnalytics.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));
                UsabilityAnalytics.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);
        }
Beispiel #10
0
        private void PurchaseSuccessGUI()
        {
            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 completed succesfully", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.Label("You will receive a receipt in your email soon.", new GUILayoutOption[0]);
            bool  flag = this.m_Message != null && this.m_Message != "";
            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]))
            {
                UsabilityAnalytics.Track(string.Format("/AssetStore/PurchaseOk/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_Asset = null;
                base.Close();
            }
            GUILayout.Space(5f);
            if (GUILayout.Button("Import package", new GUILayoutOption[0]))
            {
                UsabilityAnalytics.Track(string.Format("/AssetStore/PurchaseOkImport/{0}/{1}", this.m_Asset.packageID, this.m_Asset.id));
                this.m_BuildAttempts = 1;
                this.m_Asset.previewInfo.buildProgress = 0f;
                this.m_Purchasing = AssetStoreInstaBuyWindow.PurchaseStatus.StartBuild;
            }
            GUILayout.Space(5f);
            GUILayout.EndHorizontal();
            GUILayout.Space(5f);
        }
Beispiel #11
0
        private void Buttons()
        {
            bool flag = Lightmapping.giWorkflowMode == Lightmapping.GIWorkflowMode.Iterative;

            if (flag)
            {
                EditorGUILayout.HelpBox("Baking of lightmaps is automatic because the workflow mode is set to 'Auto'. The lightmap data is stored in the GI cache.", MessageType.Info);
            }
            if (Lightmapping.lightingDataAsset && !Lightmapping.lightingDataAsset.isValid)
            {
                EditorGUILayout.HelpBox(Lightmapping.lightingDataAsset.validityErrorMessage, MessageType.Error);
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            EditorGUI.BeginChangeCheck();
            flag = GUILayout.Toggle(flag, LightingWindow.styles.ContinuousBakeLabel, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                Lightmapping.giWorkflowMode = ((!flag) ? Lightmapping.GIWorkflowMode.OnDemand : Lightmapping.GIWorkflowMode.Iterative);
                InspectorWindow.RepaintAllInspectors();
            }
            using (new EditorGUI.DisabledScope(flag))
            {
                bool flag2 = flag || !Lightmapping.isRunning;
                if (flag2)
                {
                    if (EditorGUI.ButtonWithDropdownList(LightingWindow.styles.BuildLabel, LightingWindow.s_BakeModeOptions, new GenericMenu.MenuFunction2(this.BakeDropDownCallback), new GUILayoutOption[]
                    {
                        GUILayout.Width(180f)
                    }))
                    {
                        this.DoBake();
                        GUIUtility.ExitGUI();
                    }
                }
                else if (GUILayout.Button("Cancel", new GUILayoutOption[]
                {
                    GUILayout.Width(this.kButtonWidth)
                }))
                {
                    Lightmapping.Cancel();
                    UsabilityAnalytics.Track("/LightMapper/Cancel");
                }
            }
            GUILayout.EndHorizontal();
        }
Beispiel #12
0
        void CompletePurchase()
        {
            m_Message = "";
            string pw = m_Password;

            m_Password   = "";
            m_Purchasing = PurchaseStatus.InProgress;
            AssetStoreClient.DirectPurchase(m_Asset.packageID, pw, delegate(PurchaseResult result) {
                m_Purchasing = PurchaseStatus.Init;
                if (result.error != null)
                {
                    m_Purchasing = PurchaseStatus.Declined;
                    m_Message    = "An error occurred while completing you purhase.";
                    Close();
                }

                string msg = null;
                switch (result.status)
                {
                case PurchaseResult.Status.BasketNotEmpty:
                    m_Message    = "Something else has been put in our Asset Store basket while doing this purchase.";
                    m_Purchasing = PurchaseStatus.Declined;
                    break;

                case PurchaseResult.Status.ServiceDisabled:
                    m_Message    = "Single click purchase has been disabled while doing this purchase.";
                    m_Purchasing = PurchaseStatus.Declined;
                    break;

                case PurchaseResult.Status.AnonymousUser:
                    m_Message    = "You have been logged out from somewhere else while doing this purchase.";
                    m_Purchasing = PurchaseStatus.Declined;
                    break;

                case PurchaseResult.Status.PasswordMissing:
                    m_Message = result.message;
                    Repaint();
                    break;

                case PurchaseResult.Status.PasswordWrong:
                    m_Message = result.message;
                    Repaint();
                    break;

                case PurchaseResult.Status.PurchaseDeclined:
                    m_Purchasing = PurchaseStatus.Declined;
                    if (result.message != null)
                    {
                        m_Message = result.message;
                    }
                    Repaint();
                    break;

                case PurchaseResult.Status.Ok:
                    m_Purchasing = PurchaseStatus.Complete;
                    if (result.message != null)
                    {
                        m_Message = result.message;
                    }
                    Repaint();
                    break;
                }
                if (msg != null)
                {
                    EditorUtility.DisplayDialog("Purchase failed", msg + " This purchase has been cancelled.",
                                                "Add this item to basket", "Cancel");
                }
            });
            UsabilityAnalytics.Track(string.Format("/AssetStore/InstaBuy/{0}/{1}", m_Asset.packageID, m_Asset.id));
        }
Beispiel #13
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);
        }
Beispiel #14
0
 private void DoBakeReflectionProbes()
 {
     Lightmapping.BakeAllReflectionProbesSnapshots();
     UsabilityAnalytics.Track("/LightMapper/BakeAllReflectionProbesSnapshots");
 }
Beispiel #15
0
        private void Buttons()
        {
            bool enabled = GUI.enabled;

            GUI.enabled &= !EditorApplication.isPlayingOrWillChangePlaymode;
            if (Lightmapping.lightingDataAsset && !Lightmapping.lightingDataAsset.isValid)
            {
                EditorGUILayout.HelpBox(Lightmapping.lightingDataAsset.validityErrorMessage, MessageType.Warning);
            }
            EditorGUILayout.Space();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            Rect rect = GUILayoutUtility.GetRect(LightingWindow.Styles.ContinuousBakeLabel, GUIStyle.none);

            EditorGUI.BeginProperty(rect, LightingWindow.Styles.ContinuousBakeLabel, this.m_WorkflowMode);
            bool flag = this.m_WorkflowMode.intValue == 0;

            EditorGUI.BeginChangeCheck();
            flag = GUILayout.Toggle(flag, LightingWindow.Styles.ContinuousBakeLabel, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                this.m_WorkflowMode.intValue = ((!flag) ? 1 : 0);
            }
            EditorGUI.EndProperty();
            using (new EditorGUI.DisabledScope(flag))
            {
                bool flag2 = flag || !Lightmapping.isRunning;
                if (flag2)
                {
                    if (EditorGUI.ButtonWithDropdownList(LightingWindow.Styles.BuildLabel, LightingWindow.s_BakeModeOptions, new GenericMenu.MenuFunction2(this.BakeDropDownCallback), new GUILayoutOption[]
                    {
                        GUILayout.Width(170f)
                    }))
                    {
                        this.DoBake();
                        GUIUtility.ExitGUI();
                    }
                }
                else
                {
                    if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.PathTracer && this.m_EnabledBakedGI.boolValue && GUILayout.Button("Force Stop", new GUILayoutOption[]
                    {
                        GUILayout.Width(150f)
                    }))
                    {
                        Lightmapping.ForceStop();
                    }
                    if (GUILayout.Button("Cancel", new GUILayoutOption[]
                    {
                        GUILayout.Width(150f)
                    }))
                    {
                        Lightmapping.Cancel();
                        UsabilityAnalytics.Track("/LightMapper/Cancel");
                    }
                }
            }
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
            GUI.enabled = enabled;
        }
Beispiel #16
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 != "";
            bool  flag2 = this.m_Message != null && this.m_Message != "";
            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));
                UsabilityAnalytics.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]))
            {
                UsabilityAnalytics.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);
        }
Beispiel #17
0
 private void DoClear()
 {
     Lightmapping.ClearLightingDataAsset();
     Lightmapping.Clear();
     UsabilityAnalytics.Track("/LightMapper/Clear");
 }
        void Buttons()
        {
            bool wasGUIEnabled = GUI.enabled;

            GUI.enabled &= !EditorApplication.isPlayingOrWillChangePlaymode;

            if (Lightmapping.lightingDataAsset && !Lightmapping.lightingDataAsset.isValid)
            {
                EditorGUILayout.HelpBox(Lightmapping.lightingDataAsset.validityErrorMessage, MessageType.Warning);
            }

            EditorGUILayout.Space();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            Rect rect = GUILayoutUtility.GetRect(Styles.ContinuousBakeLabel, GUIStyle.none);

            EditorGUI.BeginProperty(rect, Styles.ContinuousBakeLabel, m_WorkflowMode);

            bool iterative = m_WorkflowMode.intValue == (int)Lightmapping.GIWorkflowMode.Iterative;

            EditorGUI.BeginChangeCheck();
            iterative = GUILayout.Toggle(iterative, Styles.ContinuousBakeLabel);

            if (EditorGUI.EndChangeCheck())
            {
                m_WorkflowMode.intValue = (int)(iterative ? Lightmapping.GIWorkflowMode.Iterative : Lightmapping.GIWorkflowMode.OnDemand);
            }

            EditorGUI.EndProperty();

            using (new EditorGUI.DisabledScope(iterative))
            {
                // Bake button if we are not currently baking
                bool showBakeButton = iterative || !Lightmapping.isRunning;
                if (showBakeButton)
                {
                    if (EditorGUI.ButtonWithDropdownList(Styles.BuildLabel, s_BakeModeOptions, BakeDropDownCallback, GUILayout.Width(170)))
                    {
                        DoBake();

                        // DoBake could've spawned a save scene dialog. This breaks GUI on mac (Case 490388).
                        // We work around this with an ExitGUI here.
                        GUIUtility.ExitGUI();
                    }
                }
                // Cancel button if we are currently baking
                else
                {
                    // Only show Force Stop when using the PathTracer backend
                    if (LightmapEditorSettings.lightmapper == LightmapEditorSettings.Lightmapper.ProgressiveCPU &&
                        m_EnabledBakedGI.boolValue &&
                        GUILayout.Button("Force Stop", GUILayout.Width(kButtonWidth)))
                    {
                        Lightmapping.ForceStop();
                    }
                    if (GUILayout.Button("Cancel", GUILayout.Width(kButtonWidth)))
                    {
                        Lightmapping.Cancel();
                        UsabilityAnalytics.Track("/LightMapper/Cancel");
                    }
                }
            }

            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
            GUI.enabled = wasGUIEnabled;
        }