private void OnGUI()
 {
     if (SpriteEditorMenu.s_Styles == null)
     {
         SpriteEditorMenu.s_Styles = new SpriteEditorMenu.Styles();
     }
     GUILayout.Space(4f);
     EditorGUIUtility.labelWidth = 124f;
     EditorGUIUtility.wideMode   = true;
     GUI.Label(new Rect(0f, 0f, base.position.width, base.position.height), GUIContent.none, SpriteEditorMenu.s_Styles.background);
     SpriteEditorMenu.s_SlicingType = (SpriteEditorMenu.SlicingType)EditorGUILayout.EnumPopup("Type", SpriteEditorMenu.s_SlicingType, new GUILayoutOption[0]);
     SpriteEditorMenu.SlicingType slicingType = SpriteEditorMenu.s_SlicingType;
     if (slicingType != SpriteEditorMenu.SlicingType.Automatic)
     {
         if (slicingType == SpriteEditorMenu.SlicingType.Grid)
         {
             this.OnGridGUI();
         }
     }
     else
     {
         this.OnAutomaticGUI();
     }
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Space(EditorGUIUtility.labelWidth + 4f);
     if (GUILayout.Button("Slice", new GUILayoutOption[0]))
     {
         this.DoSlicing();
     }
     GUILayout.EndHorizontal();
 }
		private void OnGUI()
		{
			if (SpriteEditorMenu.s_Styles == null)
			{
				SpriteEditorMenu.s_Styles = new SpriteEditorMenu.Styles();
			}
			GUILayout.Space(4f);
			EditorGUIUtility.labelWidth = 124f;
			EditorGUIUtility.wideMode = true;
			GUI.Label(new Rect(0f, 0f, base.position.width, base.position.height), GUIContent.none, SpriteEditorMenu.s_Styles.background);
			SpriteEditorMenu.s_SlicingType = (SpriteEditorMenu.SlicingType)EditorGUILayout.EnumPopup("Type", SpriteEditorMenu.s_SlicingType, new GUILayoutOption[0]);
			SpriteEditorMenu.SlicingType slicingType = SpriteEditorMenu.s_SlicingType;
			if (slicingType != SpriteEditorMenu.SlicingType.Automatic)
			{
				if (slicingType == SpriteEditorMenu.SlicingType.Grid)
				{
					this.OnGridGUI();
				}
			}
			else
			{
				this.OnAutomaticGUI();
			}
			GUILayout.BeginHorizontal(new GUILayoutOption[0]);
			GUILayout.Space(EditorGUIUtility.labelWidth + 4f);
			if (GUILayout.Button("Slice", new GUILayoutOption[0]))
			{
				this.DoSlicing();
			}
			GUILayout.EndHorizontal();
		}
 private void OnGUI()
 {
   if (SpriteEditorMenu.s_Styles == null)
     SpriteEditorMenu.s_Styles = new SpriteEditorMenu.Styles();
   GUILayout.Space(4f);
   EditorGUIUtility.labelWidth = 124f;
   EditorGUIUtility.wideMode = true;
   GUI.Label(new Rect(0.0f, 0.0f, this.position.width, this.position.height), GUIContent.none, SpriteEditorMenu.s_Styles.background);
   EditorGUI.BeginChangeCheck();
   SpriteEditorMenuSetting.SlicingType slicingType = (SpriteEditorMenuSetting.SlicingType) EditorGUILayout.EnumPopup("Type", (Enum) SpriteEditorMenu.s_Setting.slicingType, new GUILayoutOption[0]);
   if (EditorGUI.EndChangeCheck())
   {
     Undo.RegisterCompleteObjectUndo((UnityEngine.Object) SpriteEditorMenu.s_Setting, "Change slicing type");
     SpriteEditorMenu.s_Setting.slicingType = slicingType;
   }
   switch (slicingType)
   {
     case SpriteEditorMenuSetting.SlicingType.Automatic:
       this.OnAutomaticGUI();
       break;
     case SpriteEditorMenuSetting.SlicingType.GridByCellSize:
     case SpriteEditorMenuSetting.SlicingType.GridByCellCount:
       this.OnGridGUI();
       break;
   }
   GUILayout.BeginHorizontal();
   GUILayout.Space(EditorGUIUtility.labelWidth + 4f);
   if (GUILayout.Button("Slice"))
     this.DoSlicing();
   GUILayout.EndHorizontal();
 }
Esempio n. 4
0
 private void OnGUI()
 {
     if (SpriteEditorMenu.s_Styles == null)
     {
         SpriteEditorMenu.s_Styles = new SpriteEditorMenu.Styles();
     }
     GUILayout.Space(4f);
     EditorGUIUtility.labelWidth = 124f;
     EditorGUIUtility.wideMode   = true;
     GUI.Label(new Rect(0f, 0f, base.position.width, base.position.height), GUIContent.none, SpriteEditorMenu.s_Styles.background);
     EditorGUI.BeginChangeCheck();
     SpriteEditorMenuSetting.SlicingType slicingType = SpriteEditorMenu.s_Setting.slicingType;
     slicingType = (SpriteEditorMenuSetting.SlicingType)EditorGUILayout.EnumPopup(SpriteEditorMenu.s_Styles.typeLabel, slicingType, new GUILayoutOption[0]);
     if (EditorGUI.EndChangeCheck())
     {
         Undo.RegisterCompleteObjectUndo(SpriteEditorMenu.s_Setting, "Change slicing type");
         SpriteEditorMenu.s_Setting.slicingType = slicingType;
     }
     if (slicingType != SpriteEditorMenuSetting.SlicingType.GridByCellSize && slicingType != SpriteEditorMenuSetting.SlicingType.GridByCellCount)
     {
         if (slicingType == SpriteEditorMenuSetting.SlicingType.Automatic)
         {
             this.OnAutomaticGUI();
         }
     }
     else
     {
         this.OnGridGUI();
     }
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     GUILayout.Space(EditorGUIUtility.labelWidth + 4f);
     if (GUILayout.Button(SpriteEditorMenu.s_Styles.sliceButtonLabel, new GUILayoutOption[0]))
     {
         this.DoSlicing();
     }
     GUILayout.EndHorizontal();
 }
        private void OnGUI()
        {
            if (SpriteEditorMenu.s_Styles == null)
            {
                SpriteEditorMenu.s_Styles = new SpriteEditorMenu.Styles();
            }
            GUILayout.Space(4f);
            EditorGUIUtility.labelWidth = 124f;
            EditorGUIUtility.wideMode   = true;
            GUI.Label(new Rect(0.0f, 0.0f, this.position.width, this.position.height), GUIContent.none, SpriteEditorMenu.s_Styles.background);
            EditorGUI.BeginChangeCheck();
            SpriteEditorMenuSetting.SlicingType slicingType = (SpriteEditorMenuSetting.SlicingType)EditorGUILayout.EnumPopup("Type", (Enum)SpriteEditorMenu.s_Setting.slicingType, new GUILayoutOption[0]);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo((UnityEngine.Object)SpriteEditorMenu.s_Setting, "Change slicing type");
                SpriteEditorMenu.s_Setting.slicingType = slicingType;
            }
            switch (slicingType)
            {
            case SpriteEditorMenuSetting.SlicingType.Automatic:
                this.OnAutomaticGUI();
                break;

            case SpriteEditorMenuSetting.SlicingType.GridByCellSize:
            case SpriteEditorMenuSetting.SlicingType.GridByCellCount:
                this.OnGridGUI();
                break;
            }
            GUILayout.BeginHorizontal();
            GUILayout.Space(EditorGUIUtility.labelWidth + 4f);
            if (GUILayout.Button("Slice"))
            {
                this.DoSlicing();
            }
            GUILayout.EndHorizontal();
        }