예제 #1
0
        void OnGUI()
        {
            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("Settings", headerStyle);
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(20);

            EditorGUILayout.BeginHorizontal("box");
            EditorGUILayout.LabelField("Casters Default Layer");
            selectableLayerField = EditorGUILayout.LayerField("", selectableLayerField);
            EditorGUILayout.EndHorizontal();
            GUI.color = Color.green;
            EditorGUILayout.HelpBox("Layer by default for any caster creation.", MessageType.None);
            GUI.color = Color.white;

            GUILayout.Space(20);

            EditorGUILayout.BeginHorizontal("box");
            EditorGUILayout.LabelField("2DDLight Default LayerMask");
            selectableLayerMask = LayerMaskField("", selectableLayerMask);
            EditorGUILayout.EndHorizontal();
            GUI.color = Color.green;
            EditorGUILayout.HelpBox("LayerMask by default for any 2DDLight creation.", MessageType.None);
            GUI.color = Color.white;

            //EditorGUILayout.LabelField ("2D LIGHT: LayerMask by Default");
            //selectableLayerMask = LayerMaskField("", selectableLayerMask);

            AssetUtility.SaveProperty("layerCaster", selectableLayerField, settingProfileAsset);

            EditorGUILayout.Separator();

            AssetUtility.SaveProperty("layerMask", selectableLayerMask, settingProfileAsset);
        }
예제 #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://2ddlpro.com/");
            }
            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++;

                                #if UNITY_WEBPLAYER
                lbl1 = "Can't check updates under Web Player platform. \nChange your project to another target in File -> Build Settings";
                lbl2 = "";
                                #endif

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

                GUILayout.Label(lbl1 + lbl2);
                Repaint();
            }
        }
예제 #3
0
        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", consolidateData(), "New Bug: " + _report.title, _report.attachPath))
                {
                    w.Close();
                }
            }

            EditorGUILayout.EndHorizontal();


            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
        }