void OnGUI()
        {
            if (!shouldDraw)
            {
                w.Close();
                return;
            }

            headerStyle                  = new GUIStyle(GUI.skin.label);
            headerStyle.fontSize         = 18;
            headerStyle.fontStyle        = FontStyle.Bold;
            headerStyle.alignment        = TextAnchor.MiddleLeft;
            headerStyle.fixedHeight      = headerTexture.height;
            headerStyle.normal.textColor = Color.white;
            headerStyle.font             = headerFont;

            style0                  = new GUIStyle(GUI.skin.label);
            style0.fontSize         = 10;
            style0.fontStyle        = FontStyle.Italic;
            style0.alignment        = TextAnchor.UpperLeft;
            style0.fixedHeight      = 40f;
            style0.normal.textColor = Color.cyan;

            btnStyle = new GUIStyle(GUI.skin.button);
            btnStyle.hover.background = btnStyle.normal.background;
            btnStyle.hover.textColor  = new Color(1f, 112 / 255f, 4 / 255f, 1f);
            btnStyle.fixedWidth       = 160;
            btnStyle.stretchWidth     = true;

            btnStyle2 = new GUIStyle(GUI.skin.button);
            btnStyle2.hover.background = btnStyle.normal.background;
            btnStyle2.hover.textColor  = new Color(1f, 112 / 255f, 4 / 255f, 1f);
            btnStyle2.fixedWidth       = 80;
            btnStyle2.stretchWidth     = true;

            GUIStyle currentStyle = new GUIStyle(GUI.skin.box);

            currentStyle.normal.background = EditorUtils.MakeTex(2, 2, new Color(1f, 112 / 255f, 4 / 255f, 1f));
            currentStyle.fixedHeight       = headerStyle.fixedHeight * 1.2f;


            // Header //
            EditorGUILayout.BeginHorizontal(currentStyle);
            Rect rect = GUILayoutUtility.GetRect(0f, 0f);

            rect.width  = headerTexture.width;
            rect.height = headerTexture.height;
            GUILayout.Space(rect.height);
            GUI.DrawTexture(rect, headerTexture);
            EditorGUILayout.LabelField("Submit Bug Report", headerStyle);
            EditorGUILayout.EndHorizontal();


            EditorGUILayout.BeginVertical("box");
            EditorGUILayout.BeginVertical();

            // Title //
            EditorGUILayout.LabelField("Title");
            _report.title = EditorGUILayout.TextField(_report.title);
            GUILayout.Space(15f);

            // Description //
            EditorGUILayout.LabelField("Description");
            if (System.String.IsNullOrEmpty(_report.title))
            {
                _report.description = "1) What happened?:" + "\n\n\n\n" + "2) How reproduce it?:";
            }

            _report.description = EditorGUILayout.TextArea(_report.description, GUILayout.Height(150));
            GUILayout.Space(15f);

            // Enviroment //
            _report.enviromentID = EditorGUILayout.Popup("Where did it happen? ", _report.enviromentID, _enviromentValues);
            GUILayout.Space(15f);

            // Attachment //
            EditorGUILayout.BeginVertical();
            GUILayout.Label("Attach file");
            EditorGUILayout.BeginHorizontal("box");
            if (GUILayout.Button("Select file", EditorStyles.miniButton))
            {
                _report.attachPath = EditorUtility.OpenFilePanel("Select file", "", "*.*");
            }
            EditorGUILayout.LabelField("file://" + _report.attachPath);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndVertical();
            GUILayout.Space(15f);

            // Your Email //
            EditorGUILayout.LabelField("Your E-mail");
            _report.email = EditorGUILayout.TextField(_report.email);
            GUILayout.Space(15f);

            EditorGUILayout.LabelField("Your local info:");
            // Scans //
            _report.assetVersion = SettingsManager.getVersion();
            _report.unityVersion = Application.unityVersion;
            _report.isUnityPro   = Application.HasProLicense();
            _report.buildTarget  = EditorUserBuildSettings.activeBuildTarget.ToString();
            _report.currentOS    = SystemInfo.operatingSystem;

            msg  = "2DDL Version: " + _report.assetVersion + "\n";
            msg += "Unity Version: " + _report.unityVersion + "\n";
            msg += "Unity Pro?: " + _report.isUnityPro + "\n";
            msg += "Build Target: " + _report.buildTarget + "\n";
            msg += "Current OS: " + _report.currentOS;

            EditorGUILayout.HelpBox(msg, MessageType.None);


            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Cancel", btnStyle2))
            {
                w.Close();
            }

            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Submit", btnStyle))
            {
                if (BugReportUtils.SendReport("2DDL Bug Report tool", _report.email, consolidateData(), "New Bug: " + _report.title, _report.attachPath))
                {
                    BugReportUtils.SendReportProof("2DDL Bug Report <Automatic response>", _report.email, consolidateData(), "Proof of report sent: " + _report.title, _report.attachPath);

                    EditorUtility.DisplayDialog("2DDL Bug Report", "Successful submitted! You will receive a response within 48 hours.", "Ok");

                    w.Close();
                }
            }

            EditorGUILayout.EndHorizontal();


            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
        }
Beispiel #2
0
        void OnGUI()
        {
            if (_init)
            {
                _init = false;
                //StartDownload();
            }

            style1           = new GUIStyle(GUI.skin.label);
            style1.fontSize  = 14;
            style1.fontStyle = FontStyle.Bold;
            style1.alignment = TextAnchor.MiddleLeft;

            style0                  = new GUIStyle(GUI.skin.label);
            style0.fontSize         = 10;
            style0.fontStyle        = FontStyle.Italic;
            style0.alignment        = TextAnchor.UpperLeft;
            style0.fixedHeight      = 40f;
            style0.normal.textColor = Color.cyan;

            headerStyle                  = new GUIStyle(GUI.skin.label);
            headerStyle.fontSize         = 18;
            headerStyle.fontStyle        = FontStyle.Bold;
            headerStyle.alignment        = TextAnchor.MiddleLeft;
            headerStyle.fixedHeight      = headerTexture.height;
            headerStyle.normal.textColor = Color.white;
            headerStyle.font             = headerFont;


            GUIStyle currentStyle = new GUIStyle(GUI.skin.box);

            currentStyle.normal.background = EditorUtils.MakeTex(2, 2, new Color(1f, 112 / 255f, 4 / 255f, 1f));
            currentStyle.fixedHeight       = headerStyle.fixedHeight * 1.2f;


            // Header //
            EditorGUILayout.BeginHorizontal(currentStyle);
            Rect rect = GUILayoutUtility.GetRect(0f, 0f);

            rect.width  = headerTexture.width;
            rect.height = headerTexture.height;
            GUILayout.Space(rect.height);
            GUI.DrawTexture(rect, headerTexture);
            EditorGUILayout.LabelField("About", headerStyle);
            EditorGUILayout.EndHorizontal();

            style1           = new GUIStyle(GUI.skin.label);
            style1.fontStyle = FontStyle.Bold;
            style1.alignment = TextAnchor.MiddleCenter;
            //style1.

            //GUILayout.Label(m_Logo);

            GUILayout.Space(25);

            GUILayout.BeginVertical("box");

            GUILayout.Label("2DDL PRO: Dynamic Lights and Shadows Effects");
            GUILayout.Label("Version: " + SettingsManager.getVersion());

            GUILayout.EndVertical();


            GUILayout.BeginHorizontal("box");
            if (GUILayout.Button("Documentation"))
            {
                Application.OpenURL("http://martinysa.com/2d-dynamic-lights-doc/");
            }
            if (GUILayout.Button("AssetStore"))
            {
                UnityEditorInternal.AssetStore.Open("/content/25933");
            }

            if (GUILayout.Button("Contact"))
            {
                Application.OpenURL("mailto:[email protected]");
            }
            GUILayout.EndHorizontal();



            // si se ha leido desde server
            if (enableBtn)
            {
                LoadCheckUpdateAsset();

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                //GUILayout.Label("Remote Version");
                if (GUILayout.Button("Check"))
                {
                    LoadCheckUpdateAsset();
                }

                EditorGUILayout.Separator();
                EditorGUILayout.SelectableLabel("Lastest Version:    " + _chVersion.version);
                EditorGUILayout.SelectableLabel("Date Released:    " + _chVersion.dataReleased);
                EditorGUILayout.SelectableLabel("Link:    " + _chVersion.link);

                GUILayout.Space(20);
                EditorGUILayout.BeginHorizontal("box");
                if (GUILayout.Button("See ChangeLog"))
                {
                    Application.OpenURL(_chVersion.changeLog);
                }


                if (GUILayout.Button("Open in AssetStore tab"))
                {
                    UnityEditorInternal.AssetStore.Open("/content/25933");
                }
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                string lbl1 = "Checking new version";
                string lbl2 = " .";
                if (framesCount == 0)
                {
                    lbl2 = " .";
                }
                else if (framesCount == 1)
                {
                    lbl2 = " ..";
                }
                else if (framesCount == 2)
                {
                    lbl2 = " ...";
                }
                else if (framesCount == 3)
                {
                    lbl2 = " ....";
                }
                else if (framesCount == 4)
                {
                    lbl2 = " .....";
                }
                else if (framesCount == 5)
                {
                    lbl2         = " ......";
                    framesCount *= 0;
                }

                framesCount++;

                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();
                EditorGUILayout.Separator();

                GUILayout.Label(lbl1 + lbl2);
                Repaint();
            }
        }