Пример #1
0
        public static void Show(string publisher)
        {
            MetroCreateTestCertificateWindow[] array = (MetroCreateTestCertificateWindow[])Resources.FindObjectsOfTypeAll(typeof(MetroCreateTestCertificateWindow));
            MetroCreateTestCertificateWindow   metroCreateTestCertificateWindow = (array.Length <= 0) ? ScriptableObject.CreateInstance <MetroCreateTestCertificateWindow>() : array[0];

            metroCreateTestCertificateWindow.path                   = Path.Combine(Application.dataPath, "WSATestCertificate.pfx").Replace('\\', '/');
            metroCreateTestCertificateWindow.publisher              = publisher;
            metroCreateTestCertificateWindow.password               = string.Empty;
            metroCreateTestCertificateWindow.confirm                = metroCreateTestCertificateWindow.password;
            metroCreateTestCertificateWindow.message                = ((!File.Exists(metroCreateTestCertificateWindow.path)) ? GUIContent.none : EditorGUIUtility.TextContent("Current file will be overwritten."));
            metroCreateTestCertificateWindow.messageStyle           = new GUIStyle(GUI.skin.label);
            metroCreateTestCertificateWindow.messageStyle.fontStyle = FontStyle.Italic;
            metroCreateTestCertificateWindow.focus                  = "publisher";
            if (array.Length > 0)
            {
                metroCreateTestCertificateWindow.Focus();
            }
            else
            {
                metroCreateTestCertificateWindow.titleContent = EditorGUIUtility.TextContent("Create Test Certificate for Windows Store");
                metroCreateTestCertificateWindow.position     = new Rect(100f, 100f, 350f, 140f);
                metroCreateTestCertificateWindow.minSize      = new Vector2(metroCreateTestCertificateWindow.position.width, metroCreateTestCertificateWindow.position.height);
                metroCreateTestCertificateWindow.maxSize      = metroCreateTestCertificateWindow.minSize;
                metroCreateTestCertificateWindow.ShowUtility();
            }
        }