From 78e4fb0ad1ffd55d2ccf0ca1b9e4b5dc3f5a919e Mon Sep 17 00:00:00 2001 From: max Date: Sat, 4 May 2019 13:29:02 +0200 Subject: [PATCH] #if UNITY_EDITOR Added '#if UNITY_EDITOR' to all the scripts that should only run/be used in the editor. --- .../Scripts/Data/MA_TextureAtlasserProAtlas.cs | 4 +++- .../Scripts/Data/MA_TextureAtlasserProQuad.cs | 4 +++- .../Scripts/Data/MA_TextureAtlasserProSettings.cs | 6 ++++-- .../MA_TextureAtlasserPro/Scripts/Data/MA_TextureGroup.cs | 4 +++- .../Scripts/Editor/Utils/MA_TextureAtlasserProIcons.cs | 4 +++- .../Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs | 4 +++- .../Scripts/Editor/Views/MA_TextureAtlasserProDebugView.cs | 4 +++- .../Editor/Views/MA_TextureAtlasserProInspectorView.cs | 4 +++- .../Scripts/Editor/Views/MA_TextureAtlasserProMenuView.cs | 4 +++- .../Scripts/Editor/Views/MA_TextureAtlasserProViewBase.cs | 6 ++++-- .../Scripts/Editor/Views/MA_TextureAtlasserProWorkView.cs | 6 ++++-- .../Editor/Windows/MA_TextureAtlasserProCreateWindow.cs | 6 ++++-- .../Editor/Windows/MA_TextureAtlasserProExportWindow.cs | 6 ++++-- .../Scripts/Editor/Windows/MA_TextureAtlasserProWindow.cs | 6 ++++-- MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorGridUtils.cs | 4 +++- MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorRectUtils.cs | 4 +++- MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorZoomUtils.cs | 4 +++- MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs | 4 +++- MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs | 4 +++- 19 files changed, 63 insertions(+), 25 deletions(-) diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProAtlas.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProAtlas.cs index 2bf6a0c..0dda533 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProAtlas.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProAtlas.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -100,4 +101,5 @@ namespace MA_TextureAtlasserPro } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProQuad.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProQuad.cs index 62ecc41..f23fae0 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProQuad.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProQuad.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -163,4 +164,5 @@ namespace MA_TextureAtlasserPro debugMode = isDebugging; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProSettings.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProSettings.cs index abb100b..eca954e 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProSettings.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureAtlasserProSettings.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -22,4 +23,5 @@ namespace MA_TextureAtlasserPro public KeyCode removeQuadHotKey = KeyCode.R; public KeyCode duplicateHotKey = KeyCode.D; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureGroup.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureGroup.cs index 4f4bd6f..67b89c4 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureGroup.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Data/MA_TextureGroup.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -17,3 +18,4 @@ namespace MA_TextureAtlasserPro public string name; } } +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProIcons.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProIcons.cs index f68f868..6d31fd3 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProIcons.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProIcons.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using UnityEngine; using UnityEditor; @@ -32,4 +33,5 @@ namespace MA_TextureAtlasserPro editIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "editIcon" + ".png")); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs index b0d47e0..d567e62 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Utils/MA_TextureAtlasserProUtils.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -377,4 +378,5 @@ namespace MA_TextureAtlasserPro } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProDebugView.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProDebugView.cs index bf7eb1d..15cd6fc 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProDebugView.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProDebugView.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -75,4 +76,5 @@ namespace MA_TextureAtlasserPro } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProInspectorView.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProInspectorView.cs index 32628a6..6c9f7b6 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProInspectorView.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProInspectorView.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -131,4 +132,5 @@ namespace MA_TextureAtlasserPro base.ProcessEvents(e, editorViewRect); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProMenuView.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProMenuView.cs index d3a5898..efbd0ea 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProMenuView.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProMenuView.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -78,4 +79,5 @@ namespace MA_TextureAtlasserPro base.ProcessEvents(e, editorViewRect); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProViewBase.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProViewBase.cs index 128c149..d3b2041 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProViewBase.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProViewBase.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -52,4 +53,5 @@ namespace MA_TextureAtlasserPro } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProWorkView.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProWorkView.cs index 2fc9ea5..cdeb916 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProWorkView.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Views/MA_TextureAtlasserProWorkView.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using MA_Editor; @@ -147,4 +148,5 @@ namespace MA_TextureAtlasserPro zoomCoordsOrigin = new Vector2(-(curWindow.position.width / 2) + (curWindow.position.width / 3), -(curWindow.position.height / 2) + (curWindow.position.height / 3)); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProCreateWindow.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProCreateWindow.cs index d8e2eb7..31dfdc2 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProCreateWindow.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProCreateWindow.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -167,4 +168,5 @@ namespace MA_TextureAtlasserPro isLoaded = true; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProExportWindow.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProExportWindow.cs index d21c23f..fc3d31a 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProExportWindow.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProExportWindow.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -132,4 +133,5 @@ namespace MA_TextureAtlasserPro isLoaded = true; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProWindow.cs b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProWindow.cs index 7fe7c31..1c4da9c 100644 --- a/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProWindow.cs +++ b/MA_ToolBox/MA_TextureAtlasserPro/Scripts/Editor/Windows/MA_TextureAtlasserProWindow.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; @@ -118,4 +119,5 @@ namespace MA_TextureAtlasserPro isLoaded = true; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorGridUtils.cs b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorGridUtils.cs index dab81a0..9b68cca 100644 --- a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorGridUtils.cs +++ b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorGridUtils.cs @@ -1,6 +1,7 @@ //Maxartz15 //Version 1.0 +#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -58,4 +59,5 @@ namespace MA_Editor.Grid Handles.EndGUI(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorRectUtils.cs b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorRectUtils.cs index ba1c65d..131747b 100644 --- a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorRectUtils.cs +++ b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorRectUtils.cs @@ -1,6 +1,7 @@ //Maxartz15 //Version 1.0 +#if UNITY_EDITOR using UnityEngine; using MA_Editor; @@ -67,4 +68,5 @@ namespace MA_Editor.RectUtils return multipliedRect; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorZoomUtils.cs b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorZoomUtils.cs index 1e0ceb0..b8130bf 100644 --- a/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorZoomUtils.cs +++ b/MA_ToolBox/MA_Utilities/EditorUtils/MA_EditorZoomUtils.cs @@ -1,6 +1,7 @@ //Maxartz15 //Version 1.0 +#if UNITY_EDITOR using UnityEngine; using MA_Editor; using MA_Editor.RectUtils; @@ -36,4 +37,5 @@ namespace MA_Editor.GUILayoutZoom GUI.BeginGroup(new Rect(0.0f, EditorWindowTabHeight, Screen.width, Screen.height)); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs b/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs index cf8c569..60016c8 100644 --- a/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs +++ b/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs @@ -1,6 +1,7 @@ //Maxartz15 //Version 1.0 +#if UNITY_EDITOR using System; using System.IO; using System.Text; @@ -184,4 +185,5 @@ namespace MA_Mesh public string name; public string textureName; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs b/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs index 3375c14..41f2781 100644 --- a/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs +++ b/MA_ToolBox/MA_Utilities/TextureUtils/MA_TextureUtils.cs @@ -3,6 +3,7 @@ //Part of MA_TextureUtils //https://github.com/maxartz15/MA_TextureUtils +#if UNITY_EDITOR using UnityEngine; using UnityEditor; using System.IO; @@ -200,4 +201,5 @@ namespace MA_Texture } #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file