Exemplo n.º 1
0
        void OnGUI()
        {
            if (!Init())
            {
                GUILayout.Space(8);
                GUILayout.Label("Completing import process...");
                return;
            }
            Connect();
            EditorGUIUtils.SetGUIStyles(_footerSize);

            if (Application.isPlaying)
            {
                GUILayout.Space(40);
                GUILayout.BeginHorizontal();
                GUILayout.Space(40);
                GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, GUILayout.ExpandWidth(true));
                GUILayout.Space(40);
                GUILayout.EndHorizontal();
            }
            else
            {
                _scrollVal = GUILayout.BeginScrollView(_scrollVal);
                if (_src.modules.showPanel)
                {
                    if (DOTweenUtilityWindowModules.Draw(this, _src))
                    {
                        _setupRequired         = EditorUtils.DOTweenSetupRequired();
                        _src.modules.showPanel = false;
                        EditorUtility.SetDirty(_src);
                    }
                }
                else
                {
                    Rect areaRect = new Rect(0, 0, _headerSize.x, 30);
                    _selectedTab = GUI.Toolbar(areaRect, _selectedTab, _tabLabels);

                    switch (_selectedTab)
                    {
                    case 1:
                        float labelW = EditorGUIUtility.labelWidth;
                        EditorGUIUtility.labelWidth = 160;
                        DrawPreferencesGUI();
                        EditorGUIUtility.labelWidth = labelW;
                        break;

                    default:
                        DrawSetupGUI();
                        break;
                    }
                }
                GUILayout.EndScrollView();
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(_src);
            }
        }
Exemplo n.º 2
0
 private void OnGUI()
 {
     if (!this.Init())
     {
         GUILayout.Space(8f);
         GUILayout.Label("Completing import process...");
     }
     else
     {
         this.Connect(false);
         EditorGUIUtils.SetGUIStyles(new Vector2?(this._footerSize));
         if (Application.isPlaying)
         {
             GUILayout.Space(40f);
             GUILayout.BeginHorizontal();
             GUILayout.Space(40f);
             GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, new GUILayoutOption[1]
             {
                 GUILayout.ExpandWidth(true)
             });
             GUILayout.Space(40f);
             GUILayout.EndHorizontal();
         }
         else if (this._src.modules.showPanel)
         {
             if (DOTweenUtilityWindowModules.Draw((EditorWindow)this, this._src))
             {
                 this._setupRequired         = EditorUtils.DOTweenSetupRequired();
                 this._src.modules.showPanel = false;
                 EditorUtility.SetDirty((UnityEngine.Object) this._src);
             }
         }
         else
         {
             this._selectedTab = GUI.Toolbar(new Rect(0.0f, 0.0f, this._headerSize.x, 30f), this._selectedTab, this._tabLabels);
             if (this._selectedTab == 1)
             {
                 double labelWidth = (double)EditorGUIUtility.labelWidth;
                 EditorGUIUtility.labelWidth = 160f;
                 this.DrawPreferencesGUI();
                 EditorGUIUtility.labelWidth = (float)labelWidth;
             }
             else
             {
                 this.DrawSetupGUI();
             }
         }
         if (!GUI.changed)
         {
             return;
         }
         EditorUtility.SetDirty((UnityEngine.Object) this._src);
     }
 }