diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..68425d93f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/@Solutions/ZiosThemes.dll
diff --git a/@Solutions/3.5.7/UnityEditor.dll b/@Solutions/3.5.7/UnityEditor.dll
new file mode 100644
index 000000000..e67d8a5ad
Binary files /dev/null and b/@Solutions/3.5.7/UnityEditor.dll differ
diff --git a/@Solutions/3.5.7/UnityEngine.dll b/@Solutions/3.5.7/UnityEngine.dll
new file mode 100644
index 000000000..ab6e95bad
Binary files /dev/null and b/@Solutions/3.5.7/UnityEngine.dll differ
diff --git a/@Solutions/4.7.2/UnityEditor.dll b/@Solutions/4.7.2/UnityEditor.dll
new file mode 100644
index 000000000..bb805ba1c
Binary files /dev/null and b/@Solutions/4.7.2/UnityEditor.dll differ
diff --git a/@Solutions/4.7.2/UnityEngine.dll b/@Solutions/4.7.2/UnityEngine.dll
new file mode 100644
index 000000000..a3c7fe225
Binary files /dev/null and b/@Solutions/4.7.2/UnityEngine.dll differ
diff --git a/@Solutions/5.4/UnityEditor.dll b/@Solutions/5.4/UnityEditor.dll
new file mode 100644
index 000000000..9d27f76eb
Binary files /dev/null and b/@Solutions/5.4/UnityEditor.dll differ
diff --git a/@Solutions/5.4/UnityEngine.dll b/@Solutions/5.4/UnityEngine.dll
new file mode 100644
index 000000000..7b6ed0e3b
Binary files /dev/null and b/@Solutions/5.4/UnityEngine.dll differ
diff --git a/@Solutions/Compile Themes 3.5.7.bat b/@Solutions/Compile Themes 3.5.7.bat
new file mode 100644
index 000000000..617f1e804
--- /dev/null
+++ b/@Solutions/Compile Themes 3.5.7.bat
@@ -0,0 +1,27 @@
+@ECHO OFF
+copy /Y 3.5.7\* . >NUL
+del ZiosThemes.dll
+IF EXIST "%programfiles%\MSBuild\14.0\Bin" GOTO USE_VS14_X32
+IF EXIST "%programfiles(x86)%\MSBuild\14.0\Bin" GOTO USE_VS14_X64
+IF EXIST "%programfiles%\MSBuild\15.0\Bin" GOTO USE_VS15_X32
+IF EXIST "%programfiles(x86)%\MSBuild\15.0\Bin" GOTO USE_VS15_X64
+GOTO CLOSE
+:USE_VS14_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 32-bit host)...
+ "%programfiles%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS14_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 32-bit host)...
+ "%programfiles%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:CLOSE
+copy /Y 5.4\* . >NUL
+rmdir /Q /S obj
\ No newline at end of file
diff --git a/@Solutions/Compile Themes 4.7.2.bat b/@Solutions/Compile Themes 4.7.2.bat
new file mode 100644
index 000000000..ea91ecba5
--- /dev/null
+++ b/@Solutions/Compile Themes 4.7.2.bat
@@ -0,0 +1,27 @@
+@ECHO OFF
+copy /Y 4.7.2\* . >NUL
+del ZiosThemes.dll
+IF EXIST "%programfiles%\MSBuild\14.0\Bin" GOTO USE_VS14_X32
+IF EXIST "%programfiles(x86)%\MSBuild\14.0\Bin" GOTO USE_VS14_X64
+IF EXIST "%programfiles%\MSBuild\15.0\Bin" GOTO USE_VS15_X32
+IF EXIST "%programfiles(x86)%\MSBuild\15.0\Bin" GOTO USE_VS15_X64
+GOTO CLOSE
+:USE_VS14_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 32-bit host)...
+ "%programfiles%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS14_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 32-bit host)...
+ "%programfiles%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:CLOSE
+copy /Y 5.4\* . >NUL
+rmdir /Q /S obj
\ No newline at end of file
diff --git a/@Solutions/Compile Themes 5.4 (Mono Windows).bat b/@Solutions/Compile Themes 5.4 (Mono Windows).bat
new file mode 100644
index 000000000..5bcdb6fff
--- /dev/null
+++ b/@Solutions/Compile Themes 5.4 (Mono Windows).bat
@@ -0,0 +1,7 @@
+@ECHO OFF
+copy /Y 5.4\* . >NUL
+echo Compiling ZiosThemes.dll - Mono Framework 4.5 / Unity 5.x...
+del ZiosThemes.dll
+call "%programfiles%\Unity\Editor\Data\MonoBleedingEdge\bin\xbuild.bat" ZiosThemes.sln
+rmdir /Q /S obj
+copy /Y 5.4\* . >NUL
\ No newline at end of file
diff --git a/@Solutions/Compile Themes 5.4.bat b/@Solutions/Compile Themes 5.4.bat
new file mode 100644
index 000000000..d5d782d0a
--- /dev/null
+++ b/@Solutions/Compile Themes 5.4.bat
@@ -0,0 +1,27 @@
+@ECHO OFF
+copy /Y 5.4\* . >NUL
+del ZiosThemes.dll
+IF EXIST "%programfiles%\MSBuild\14.0\Bin" GOTO USE_VS14_X32
+IF EXIST "%programfiles(x86)%\MSBuild\14.0\Bin" GOTO USE_VS14_X64
+IF EXIST "%programfiles%\MSBuild\15.0\Bin" GOTO USE_VS15_X32
+IF EXIST "%programfiles(x86)%\MSBuild\15.0\Bin" GOTO USE_VS15_X64
+GOTO CLOSE
+:USE_VS14_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 32-bit host)...
+ "%programfiles%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS14_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 2015 / MSBuild 2015 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X32
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 32-bit host)...
+ "%programfiles%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:USE_VS15_X64
+ echo Compiling ZiosThemes.dll - Visual Studio 15 / MSBuild 15 (on 64-bit host)...
+ "%programfiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe" ZiosThemes.sln
+ GOTO CLOSE
+:CLOSE
+copy /Y 5.4\* . >NUL
+rmdir /Q /S obj
\ No newline at end of file
diff --git a/@Solutions/Compile Themes Mac OS X.sh b/@Solutions/Compile Themes Mac OS X.sh
new file mode 100644
index 000000000..27beb2f52
--- /dev/null
+++ b/@Solutions/Compile Themes Mac OS X.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+rm ZiosThemes.dll
+/Applications/Unity/Unity.app/Contents/MonoBleedingEdge/bin/xbuild ZiosThemesMono.sln
+rm -R obj
diff --git a/@Solutions/Download MSBuild Tools 2015.url b/@Solutions/Download MSBuild Tools 2015.url
new file mode 100644
index 000000000..e15a96826
--- /dev/null
+++ b/@Solutions/Download MSBuild Tools 2015.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://go.microsoft.com/fwlink/?LinkId=615458
diff --git a/@Solutions/Properties/AssemblyInfo.cs b/@Solutions/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..6d4ed75aa
--- /dev/null
+++ b/@Solutions/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Zios Themes")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Zios")]
+[assembly: AssemblyProduct("ZiosThemes")]
+[assembly: AssemblyCopyright("Copyright © Zios 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("90c40447-c2b4-4725-9cea-9e0e8199eefc")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/@Solutions/UnityEditor.dll b/@Solutions/UnityEditor.dll
new file mode 100644
index 000000000..9d27f76eb
Binary files /dev/null and b/@Solutions/UnityEditor.dll differ
diff --git a/@Solutions/UnityEngine.dll b/@Solutions/UnityEngine.dll
new file mode 100644
index 000000000..7b6ed0e3b
Binary files /dev/null and b/@Solutions/UnityEngine.dll differ
diff --git a/@Solutions/ZiosThemes.csproj b/@Solutions/ZiosThemes.csproj
new file mode 100644
index 000000000..1fccbec3f
--- /dev/null
+++ b/@Solutions/ZiosThemes.csproj
@@ -0,0 +1,97 @@
+
+
+
+
+ Release
+ AnyCPU
+ {90C40447-C2B4-4725-9CEA-9E0E8199EEFC}
+ Library
+ Properties
+ ZiosThemes
+ ZiosThemes
+ v3.5
+ 512
+
+
+ true
+ .
+ prompt
+ 4
+ UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_STANDALONE;UNITY_THEMES
+
+
+
+
+
+ UnityEditor.dll
+
+
+ UnityEngine.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/@Solutions/ZiosThemes.sln b/@Solutions/ZiosThemes.sln
new file mode 100644
index 000000000..075597457
--- /dev/null
+++ b/@Solutions/ZiosThemes.sln
@@ -0,0 +1,17 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZiosThemes", "ZiosThemes.csproj", "{90C40447-C2B4-4725-9CEA-9E0E8199EEFC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {90C40447-C2B4-4725-9CEA-9E0E8199EEFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90C40447-C2B4-4725-9CEA-9E0E8199EEFC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Containers/Container.cs b/Containers/Container.cs
new file mode 100644
index 000000000..13f0e4cdb
--- /dev/null
+++ b/Containers/Container.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+namespace Zios.Containers{
+ [Serializable]
+ public class Container{
+ public List keys = new List();
+ public List values = new List();
+ public Dictionary collection = new Dictionary();
+ public int Count{
+ get{return this.collection.Count;}
+ set{}
+ }
+ public TValue this[TKey key]{
+ get{
+ int index = this.keys.IndexOf(key);
+ return this.values.ElementAt(index);
+ }
+ set{
+ int index = this.keys.IndexOf(key);
+ if(index == -1){
+ this.keys.Add(key);
+ this.values.Add(value);
+ this.collection = this.keys.ToDictionary(x => x,x => this.values[this.keys.IndexOf(x)]);
+ }
+ else{
+ this.values[index] = value;
+ }
+ }
+ }
+ public void Clear(){
+ this.keys.Clear();
+ this.values.Clear();
+ this.collection.Clear();
+ }
+ public IEnumerator> GetEnumerator(){
+ return this.collection.GetEnumerator();
+ }
+ }
+ [Serializable] public class IntContainer : Container{}
+ [Serializable] public class StringContainer : Container{}
+ [Serializable] public class FloatContainer : Container{}
+ [Serializable] public class BoolContainer : Container{}
+ [Serializable] public class GameObjectContainer : Container{}
+ [Serializable]
+ public class FixedContainer{
+ public TKey[] keys;
+ public TValue[] values;
+ private int nextIndex = 0;
+ public FixedContainer(int size){
+ this.keys = new TKey[size];
+ this.values = new TValue[size];
+ }
+ public TValue this[TKey key]{
+ get{
+ int index = Array.IndexOf(this.keys,key);
+ return this.values[index];
+ }
+ set{
+ int index = Array.IndexOf(this.keys,key);
+ if(index == -1){
+ this.keys[this.nextIndex] = key;
+ this.values[this.nextIndex] = value;
+ ++this.nextIndex;
+ }
+ else{
+ this.values[index] = value;
+ }
+ }
+ }
+ }
+ public class FixedList : List{
+ public int maxSize = 0;
+ public FixedList(int size) : base(size){
+ this.maxSize = size;
+ }
+ public new void Add(T item){
+ if(this.Count >= this.maxSize){
+ this.RemoveAt(0);
+ }
+ base.Add(item);
+ }
+ }
+ public class Hierarchy : Dictionary{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>>>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>>>>{public Hierarchy():base(){}}
+ public class Hierarchy : Dictionary>>>>>>{public Hierarchy():base(){}}
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/AnimationCurve.cs b/Extensions/@Unity/AnimationCurve.cs
new file mode 100644
index 000000000..0a4bb96d0
--- /dev/null
+++ b/Extensions/@Unity/AnimationCurve.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+using System;
+using System.Text;
+using System.Collections.Generic;
+namespace Zios{
+ public static class AnimationCurveExtension{
+ public static string Serialize(this AnimationCurve current){
+ var output = new StringBuilder();
+ foreach(var key in current.keys){
+ output.Append(key.time);
+ output.Append("-");
+ output.Append(key.value);
+ output.Append("-");
+ output.Append(key.inTangent);
+ output.Append("-");
+ output.Append(key.outTangent);
+ output.Append("|");
+ }
+ return output.ToString().TrimRight("|");
+ }
+ public static AnimationCurve Deserialize(this AnimationCurve current,string value){
+ var keys = new List();
+ foreach(var keyData in value.Split("|")){
+ var data = keyData.Split("-").Convert();
+ keys.Add(new Keyframe(data[0],data[1],data[2],data[3]));
+ }
+ current.keys = keys.ToArray();
+ return current;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/AnimationExtensions.cs b/Extensions/@Unity/AnimationExtensions.cs
new file mode 100644
index 000000000..da788846d
--- /dev/null
+++ b/Extensions/@Unity/AnimationExtensions.cs
@@ -0,0 +1,9 @@
+using UnityEngine;
+namespace Zios{
+ public static class AnimationExtension{
+ public static void Set(this Animation current,string name,bool state){
+ if(state){current.Play(name);}
+ else{current.Stop(name);}
+ }
+ }
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/Color.cs b/Extensions/@Unity/Color.cs
new file mode 100644
index 000000000..20bdc4149
--- /dev/null
+++ b/Extensions/@Unity/Color.cs
@@ -0,0 +1,53 @@
+using System.Linq;
+using UnityEngine;
+namespace Zios{
+ using System.Collections.Generic;
+ public static class ColorExtension{
+ public static Color Add(this Color current,Color amount){
+ current.r = Mathf.Clamp(current.r+amount.r,0,1);
+ current.g = Mathf.Clamp(current.g+amount.g,0,1);
+ current.b = Mathf.Clamp(current.b+amount.b,0,1);
+ return current;
+ }
+ public static Color Add(this Color current,float amount){
+ current.r = Mathf.Clamp(current.r+amount,0,1);
+ current.g = Mathf.Clamp(current.g+amount,0,1);
+ current.b = Mathf.Clamp(current.b+amount,0,1);
+ return current;
+ }
+ public static Color Multiply(this Color current,Color amount){
+ current.r = Mathf.Clamp(current.r*amount.r,0,1);
+ current.g = Mathf.Clamp(current.g*amount.g,0,1);
+ current.b = Mathf.Clamp(current.b*amount.b,0,1);
+ return current;
+ }
+ public static Color Multiply(this Color current,float amount){
+ current.r = Mathf.Clamp(current.r*amount,0,1);
+ current.g = Mathf.Clamp(current.g*amount,0,1);
+ current.b = Mathf.Clamp(current.b*amount,0,1);
+ return current;
+ }
+ public static Color Random(this Color current,float intensity=1.0f){
+ int[] order = (new List(){0,1,2}).Shuffle().ToArray();
+ float[] color = new float[3];
+ color[order[0]] = UnityEngine.Random.Range(intensity,1.0f);
+ color[order[1]] = UnityEngine.Random.Range(0,1.0f - intensity);
+ color[order[2]] = UnityEngine.Random.Range(0,1.0f);
+ return new Color(color[0],color[1],color[2]);
+ }
+ public static string ToHex(this Color current,bool alwaysAlpha=true){
+ var red = (current.r*255).ToInt().ToString("X2");
+ var green = (current.g*255).ToInt().ToString("X2");
+ var blue = (current.b*255).ToInt().ToString("X2");
+ var alpha = (current.a*255).ToInt().ToString("X2");
+ if(alpha == "FF" && !alwaysAlpha){alpha = "";}
+ return "#"+red+green+blue+alpha;
+ }
+ public static string Serialize(this Color current){
+ return current.ToHex(false);
+ }
+ public static Color Deserialize(this Color current,string value){
+ return value.ToColor("-");
+ }
+ }
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/ComponentExtensions.cs b/Extensions/@Unity/ComponentExtensions.cs
new file mode 100644
index 000000000..6e3d8f6cd
--- /dev/null
+++ b/Extensions/@Unity/ComponentExtensions.cs
@@ -0,0 +1,97 @@
+using UnityEngine;
+namespace Zios{
+ public static class ComponentExtension{
+ public static void UpdateSerialized(this Component current){
+ #if UNITY_EDITOR
+ Utility.UpdateSerialized(current);
+ #endif
+ }
+ public static GameObject GetPrefabRoot(this Component current){
+ return current.gameObject.GetPrefabRoot();
+ }
+ public static GameObject GetParent(this Component current){
+ return current.gameObject.GetParent();
+ }
+ public static string GetPath(this Component current,bool includeSelf=true){
+ if(current.IsNull() || current.gameObject.IsNull()){return "Null";}
+ string path = current.gameObject.GetPath();
+ if(includeSelf){path += current.GetAlias();}
+ return path;
+ }
+ public static bool IsPrefab(this Component current){
+ return current.gameObject.IsPrefab();
+ }
+ public static bool IsEnabled(this Component current){
+ bool enabled = !current.IsNull() && current.gameObject.activeInHierarchy;
+ if(current is MonoBehaviour){enabled = enabled && current.As().enabled;}
+ return enabled;
+ }
+ public static void Move(this Component current,int amount){
+ Utility.DisconnectPrefabInstance(current);
+ while(amount != 0){
+ if(amount > 0){
+ Utility.MoveComponentDown(current);
+ amount -= 1;
+ }
+ if(amount < 0){
+ Utility.MoveComponentUp(current);
+ amount += 1;
+ }
+ }
+ }
+ public static void MoveUp(this Component current){
+ Component[] components = current.GetComponents();
+ int position = components.IndexOf(current);
+ int amount = 1;
+ if(position != 0){
+ while(components[position-1].hideFlags.Contains(HideFlags.HideInInspector)){
+ position -= 1;
+ amount += 1;
+ }
+ }
+ current.Move(-amount);
+ }
+ public static void MoveDown(this Component current){
+ Component[] components = current.GetComponents();
+ int position = components.IndexOf(current);
+ int amount = 1;
+ if(position < components.Length-1){
+ while(components[position+1].hideFlags.Contains(HideFlags.HideInInspector)){
+ position += 1;
+ amount += 1;
+ }
+ }
+ current.Move(amount);
+ }
+ public static void MoveToTop(this Component current){
+ Utility.DisconnectPrefabInstance(current);
+ Component[] components = current.GetComponents();
+ int position = components.IndexOf(current);
+ current.Move(-position);
+ }
+ public static void MoveToBottom(this Component current){
+ Utility.DisconnectPrefabInstance(current);
+ Component[] components = current.GetComponents();
+ int position = components.IndexOf(current);
+ current.Move(components.Length-position);
+ }
+ //====================
+ // Interface
+ //====================
+ public static Component[] GetComponentsByInterface(this Component current) where T : Component{
+ return current.gameObject.GetComponentsByInterface();
+ }
+ public static T GetComponent(this Component current,bool includeInactive) where T : Component{
+ return current.gameObject.GetComponent(includeInactive);
+ }
+ public static T[] GetComponents(this Component current,bool includeInactive) where T : Component{
+ return current.gameObject.GetComponents(includeInactive);
+ }
+ public static T GetComponentInParent(this Component current,bool includeInactive) where T : Component{
+ return current.gameObject.GetComponentInParent(includeInactive);
+ }
+ public static T GetComponentInChildren(this Component current,bool includeInactive) where T : Component{
+ return current.gameObject.GetComponentInChildren(includeInactive);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/Editor/GenericMenu.cs b/Extensions/@Unity/Editor/GenericMenu.cs
new file mode 100644
index 000000000..7a929fbad
--- /dev/null
+++ b/Extensions/@Unity/Editor/GenericMenu.cs
@@ -0,0 +1,12 @@
+using UnityEditor;
+using UnityEngine;
+namespace Zios{
+ public static class GenericMenuExtension{
+ public static void AddItem(this GenericMenu current,string label,bool state,GenericMenu.MenuFunction method){
+ current.AddItem(new GUIContent(label),state,method);
+ }
+ public static void AddItem(this GenericMenu current,string label,bool state,GenericMenu.MenuFunction2 method,object data){
+ current.AddItem(new GUIContent(label),state,method,data);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Extensions/@Unity/EditorGUI.cs b/Extensions/@Unity/EditorGUI.cs
new file mode 100644
index 000000000..67e71ef80
--- /dev/null
+++ b/Extensions/@Unity/EditorGUI.cs
@@ -0,0 +1,222 @@
+#if UNITY_EDITOR
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEditor;
+using UnityEngine;
+using UnityObject = UnityEngine.Object;
+namespace Zios.Interface{
+ public static class LabelExtensions{
+ public static UnityLabel ToLabel(this GUIContent current){
+ return new UnityLabel(current);
+ }
+ public static UnityLabel ToLabel(this string current){
+ return new UnityLabel(current);
+ }
+ }
+ public class UnityLabel{
+ public GUIContent value = new GUIContent("");
+ public UnityLabel(string value){this.value = new GUIContent(value);}
+ public UnityLabel(GUIContent value){this.value = value;}
+ public override string ToString(){return this.value.text;}
+ public GUIContent ToContent(){return this.value;}
+ //public static implicit operator string(UnityLabel current){return current.value.text;}
+ public static implicit operator GUIContent(UnityLabel current){
+ if(current == null){return GUIContent.none;}
+ return current.value;
+ }
+ public static implicit operator UnityLabel(GUIContent current){return new UnityLabel(current);}
+ public static implicit operator UnityLabel(string current){return new UnityLabel(current);}
+ }
+ public static class EditorGUIExtension{
+ public static bool render = true;
+ public static bool lastChanged;
+ public static Type Draw(Func method,bool indention=true){
+ int indentValue = EditorGUI.indentLevel;
+ if(!indention){EditorGUI.indentLevel = 0;}
+ bool wasChanged = GUI.changed;
+ GUI.changed = false;
+ Type value = (Type)method();
+ EditorGUIExtension.lastChanged = GUI.changed;
+ GUI.changed = GUI.changed || wasChanged;
+ EditorGUI.indentLevel = indentValue;
+ return value;
+ }
+ public static void Draw(Action method,bool indention=true){
+ int indentValue = EditorGUI.indentLevel;
+ if(!indention){EditorGUI.indentLevel = 0;}
+ if(EditorGUIExtension.render){method();}
+ if(!indention){EditorGUI.indentLevel = indentValue;}
+ }
+ public static string Draw(this string current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.textField;
+ return EditorGUIExtension.Draw(()=>EditorGUI.TextField(area,label,current,style),indention);
+ }
+ public static float Draw(this float current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.numberField;
+ return EditorGUIExtension.Draw(()=>EditorGUI.FloatField(area,label,current,style),indention);
+ }
+ public static bool Draw(this bool current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.toggle;
+ return EditorGUIExtension.Draw(()=>EditorGUI.Toggle(area,label,current,style),indention);
+ }
+ public static Enum Draw(this Enum current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ return EditorGUIExtension.Draw(()=>EditorGUI.EnumPopup(area,label,current,style),indention);
+ }
+ public static int Draw(this IEnumerable current,Rect area,int index,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ string name = label.IsNull() ? "" : label.ToString();
+ return EditorGUIExtension.Draw(()=>EditorGUI.Popup(area,name,index,current.ToArray(),style),indention);
+ }
+ public static void DrawMenu(this IEnumerable current,Rect area,GenericMenu.MenuFunction2 callback,IEnumerable selected=null,IEnumerable disabled=null){
+ if(selected.IsNull()){selected = new List();}
+ if(disabled.IsNull()){disabled = new List();}
+ var menu = new GenericMenu();
+ var index = 0;
+ foreach(var item in current){
+ ++index;
+ if(!disabled.Contains(item)){
+ menu.AddItem(item.ToContent(),selected.Contains(item),callback,index-1);
+ continue;
+ }
+ menu.AddDisabledItem(item.ToContent());
+ }
+ menu.DropDown(area);
+ }
+ public static void Draw(this SerializedProperty current,Rect area,UnityLabel label=null,bool allowScene=true,bool indention=true){
+ if(label != null && label.value.text.IsEmpty()){label = new GUIContent(current.displayName);}
+ EditorGUIExtension.Draw(()=>EditorGUI.PropertyField(area,current,label,allowScene),indention);
+ }
+ public static Rect Draw(this Rect current,Rect area,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUI.RectField(area,label,current),indention);
+ }
+ public static AnimationCurve Draw(this AnimationCurve current,Rect area,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUI.CurveField(area,label,current),indention);
+ }
+ public static Color Draw(this Color current,Rect area,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUI.ColorField(area,label,current),indention);
+ }
+ }
+ public static class EditorGUIExtensionSpecial{
+ public static Rect menuArea;
+ public static object menuValue;
+ public static void DrawAuto(this object current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ if(current is string){current.As().Draw(area,label,style,indention);}
+ if(current is int){current.As().DrawInt(area,label,style,indention);}
+ if(current is float){current.As().Draw(area,label,style,indention);}
+ if(current is Enum){current.As().Draw(area,label,style,indention);}
+ if(current is SerializedProperty){current.As().Draw(area,label,indention);}
+ if(current is AnimationCurve){current.As().Draw(area,label,indention);}
+ if(current is Color){current.As().Draw(area,label,indention);}
+ if(current is Rect){current.As().Draw(area,label,indention);}
+ if(current is GameObject){current.As().Draw(area,label,indention);}
+ if(current is Component){current.As().Draw(area,label,indention);}
+ if(current is Material){current.As().Draw(area,label,indention);}
+ if(current is Shader){current.As().Draw(area,label,indention);}
+ if(current is Vector2){current.As().DrawVector2(area,label,indention);}
+ if(current is Vector3){current.As().DrawVector3(area,label,indention);}
+ if(current is Vector4){current.As().DrawVector4(area,label,indention);}
+ }
+ public static bool DrawFoldout(this UnityLabel current,Rect area,object key,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.foldout;
+ string name = key.IsNull() ? current + "Foldout" : key.GetHashCode().ToString();
+ if(key is string){name = (string)key;}
+ bool previous = EditorPrefs.GetBool(name);
+ bool state = EditorGUIExtension.Draw(()=>EditorGUI.Foldout(area,previous,current,style),indention);
+ if(previous != state){EditorPrefs.SetBool(name,state);}
+ return state;
+ }
+ public static bool DrawHeader(this UnityLabel current,Rect area,object key,GUIStyle style=null,bool indention=true){
+ string stateName = key.IsNull() ? current + "Foldout" : key.GetHashCode().ToString();
+ if(key is string){stateName = (string)key;}
+ bool state = EditorPrefs.GetBool(stateName);
+ current = state ? "▼ " + current : "▶ " + current;
+ var currentStyle = style.IsNull() ? null : new GUIStyle(style);
+ if(state){currentStyle.normal = currentStyle.active;}
+ if(current.DrawButton(area,currentStyle,indention)){
+ state = !state;
+ EditorPrefs.SetBool(stateName,state);
+ }
+ return state;
+ }
+ //public static void DrawLabel(this string current,Rect area,GUIStyle style=null,bool indention=true){new UnityLabel(current).DrawLabel(area,style,indention);}
+ //public static void DrawLabel(this GUIContent current,Rect area,GUIStyle style=null,bool indention=true){new UnityLabel(current).DrawLabel(area,style,indention);}
+ public static void DrawLabel(this UnityLabel current,Rect area,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.label;
+ EditorGUIExtension.Draw(()=>EditorGUI.LabelField(area,current,style),indention);
+ }
+ public static void DrawHelp(this string current,Rect area,string textType,bool indention=true){
+ MessageType type = MessageType.None;
+ if(textType.Contains("Info",true)){type = MessageType.Info;}
+ if(textType.Contains("Error",true)){type = MessageType.Error;}
+ if(textType.Contains("Warning",true)){type = MessageType.Warning;}
+ EditorGUIExtension.Draw(()=>EditorGUI.HelpBox(area,current,type),indention);
+ }
+ public static string DrawTextArea(this string current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.textField;
+ return EditorGUIExtension.Draw(()=>EditorGUI.TextField(area,label,current,style),indention);
+ }
+ //public static bool DrawButton(this string current,Rect area,GUIStyle style=null,bool indention=true){return new UnityLabel(current).DrawButton(area,style,indention);}
+ //public static bool DrawButton(this GUIContent current,Rect area,GUIStyle style=null,bool indention=true){return new UnityLabel(current).DrawButton(area,style,indention);}
+ public static bool DrawButton(this UnityLabel current,Rect area,GUIStyle style=null,bool indention=true){
+ style = style ?? GUI.skin.button;
+ return EditorGUIExtension.Draw(()=>GUI.Button(area,current,style),indention);
+ }
+ public static int DrawInt(this int current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.numberField;
+ return EditorGUIExtension.Draw(()=>EditorGUI.IntField(area,label,current,style),indention);
+ }
+ public static float DrawSlider(this float current,Rect area,float min,float max,bool indention=true){
+ var value = EditorGUIExtension.Draw(()=>GUI.HorizontalSlider(area,current,min,max),indention);
+ if(value != current){GUI.FocusControl("");}
+ return value;
+ }
+ public static Type Draw(this UnityObject current,Rect area,UnityLabel label=null,bool allowScene=true,bool indention=true) where Type : UnityObject{
+ return (Type)EditorGUIExtension.Draw(()=>EditorGUI.ObjectField(area,label,current,typeof(Type),allowScene),indention);
+ }
+ public static Enum DrawMask(this Enum current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ string value = current.ToName().Replace(" "," | ").ToTitleCase();
+ Rect valueArea = area;
+ if(!label.IsNull()){
+ Rect labelArea = area.AddWidth(-EditorGUIUtility.labelWidth);
+ valueArea = labelArea.AddX(EditorGUIUtility.labelWidth);
+ if(value.IsEmpty()){value = "None";}
+ label.DrawLabel(labelArea,null,true);
+ }
+ if(GUI.Button(valueArea,value.Trim("| "),style)){
+ var items = current.ToName().Split(" ").ToTitleCase();
+ GenericMenu.MenuFunction2 callback = index=>{
+ EditorGUIExtensionSpecial.menuArea = area;
+ EditorGUIExtensionSpecial.menuValue = current.GetValues().GetValue((int)index);
+ };
+ current.GetNames().ToTitleCase().DrawMenu(valueArea,callback,items);
+ }
+ if(EditorGUIExtensionSpecial.menuArea == area && !EditorGUIExtensionSpecial.menuValue.IsNull()){
+ var menuValue = (Enum)EditorGUIExtensionSpecial.menuValue;
+ var newValue = current.ToInt() ^ menuValue.ToInt();
+ current = (Enum)Enum.ToObject(current.GetType(),newValue);
+ EditorGUIExtensionSpecial.menuValue = null;
+ EditorGUIExtensionSpecial.menuArea = new Rect();
+ GUI.changed = true;
+ }
+ return current;
+ }
+ public static Enum DrawMaskField(this Enum current,Rect area,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ return EditorGUIExtension.Draw(()=>EditorGUI.EnumMaskField(area,label,current,style),indention);
+ }
+ public static Vector2 DrawVector2(this Vector2 current,Rect area,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUI.Vector2Field(area,label,current),indention);
+ }
+ public static Vector3 DrawVector3(this Vector3 current,Rect area,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUI.Vector3Field(area,label,current),indention);
+ }
+ public static Vector4 DrawVector4(this Vector4 current,Rect area,UnityLabel label=null,bool indention=true){
+ string name = label.IsNull() ? null : label.ToString();
+ return EditorGUIExtension.Draw(()=>EditorGUI.Vector4Field(area,name,current),indention);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Extensions/@Unity/EditorGUILayout.cs b/Extensions/@Unity/EditorGUILayout.cs
new file mode 100644
index 000000000..76c750cfd
--- /dev/null
+++ b/Extensions/@Unity/EditorGUILayout.cs
@@ -0,0 +1,203 @@
+#if UNITY_EDITOR
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEditor;
+using UnityEngine;
+using UnityObject = UnityEngine.Object;
+namespace Zios.Interface{
+ public static class EditorGUILayoutExtension{
+ public static string Draw(this string current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.textField;
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.TextField(label,current,style,style.CreateLayout()),indention);
+ }
+ public static float Draw(this float current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.numberField;
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.FloatField(label,current,style,style.CreateLayout()),indention);
+ }
+ public static bool Draw(this bool current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.toggle;
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.Toggle(label,current,style,style.CreateLayout()),indention);
+ }
+ public static Enum Draw(this Enum current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.EnumPopup(label,current,style,style.CreateLayout()),indention);
+ }
+ public static int Draw(this IEnumerable current,int index,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ style = style ?? EditorStyles.popup;
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.Popup(label.ToString(),index,current.ToArray(),style),indention);
+ }
+ public static void Draw(this SerializedProperty current,UnityLabel label=null,bool allowScene=true,bool indention=true){
+ if(label != null && label.value.text.IsEmpty()){label = new GUIContent(current.displayName);}
+ Action action = ()=>EditorGUILayout.PropertyField(current,label,allowScene);
+ EditorGUIExtension.Draw(action,indention);
+ }
+ public static Rect Draw(this Rect current,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.RectField(label,current),indention);
+ }
+ public static AnimationCurve Draw(this AnimationCurve current,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.CurveField(label,current),indention);
+ }
+ public static Color Draw(this Color current,UnityLabel label=null,bool indention=true){
+ return EditorGUIExtension.Draw(()=>EditorGUILayout.ColorField(label,current),indention);
+ }
+ public static void Draw(this IList current,string header="List"){
+ if(header.IsEmpty() || EditorGUILayoutExtensionSpecial.DrawFoldout(header)){
+ if(!header.IsEmpty()){EditorGUI.indentLevel += 1;}
+ for(int index=0;index().ToList().Draw(label);
+ continue;
+ }
+ if(!item.IsNull() && item.GetType() != typeof(UnityObject) && item.GetType().IsClass && item.GetType().IsSerializable && !(item is string)){
+ item.DrawFields(label);
+ continue;
+ }
+ item.DrawAuto(label);
+ }
+ if(!header.IsEmpty()){EditorGUI.indentLevel -= 1;}
+ }
+ }
+ public static void Draw(this IDictionary current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ var open = EditorGUILayoutExtensionSpecial.DrawFoldout(label.ToString().ToTitleCase());
+ if(!open){return;}
+ EditorGUI.indentLevel += 1;
+ foreach(DictionaryEntry item in current){
+ item.Value.DrawAuto(item.Key.ToString(),style,true);
+ }
+ EditorGUI.indentLevel -= 1;
+ }
+ }
+ public static class EditorGUILayoutExtensionSpecial{
+ public static void DrawAuto(this object current,UnityLabel label=null,GUIStyle style=null,bool indention=true){
+ bool isDictionary = current.GetType().IsGenericType && current.GetType().GetGenericTypeDefinition() == typeof(Dictionary<,>);
+ if(current is string){current.As().Draw(label,style,indention);}
+ if(current is int){current.As().DrawInt(label,style,indention);}
+ if(current is float){current.As().Draw(label,style,indention);}
+ if(current is Enum){current.As().Draw(label,style,indention);}
+ if(current is SerializedProperty){current.As().Draw(label,indention);}
+ if(current is AnimationCurve){current.As().Draw(label,indention);}
+ if(current is Color){current.As().Draw(label,indention);}
+ if(current is Rect){current.As().Draw(label,indention);}
+ if(current is GameObject){current.As().Draw(label,indention);}
+ if(current is Component){current.As().Draw(label,indention);}
+ if(current is Material){current.As().Draw(label,indention);}
+ if(current is Shader){current.As().Draw(label,indention);}
+ if(current is Vector2){current.As().DrawVector2(label,indention);}
+ if(current is Vector3){current.As().DrawVector3(label,indention);}
+ if(current is Vector4){current.As().DrawVector4(label,indention);}
+ if(isDictionary){current.As().Draw(label,style,indention);}
+ }
+ public static void DrawFields(this object current,string header="Fields"){
+ if(header.IsEmpty() || EditorGUILayoutExtensionSpecial.DrawFoldout(header)){
+ if(!header.IsEmpty()){EditorGUI.indentLevel += 1;}
+ foreach(var item in current.GetVariables()){
+ string label = item.Key.ToTitleCase();
+ object field = item.Value;
+ if(field is ICollection){
+ var enumerable = field as IEnumerable;
+ enumerable.OfType