diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cc11e4c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/Library
+obj/
+/Temp
+*.csproj
+*.sln
+*.userprefs
diff --git a/Assembly-CSharp-Editor-vs.csproj b/Assembly-CSharp-Editor-vs.csproj
deleted file mode 100644
index 7e4e721..0000000
--- a/Assembly-CSharp-Editor-vs.csproj
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}
- Library
- Properties
-
- Assembly-CSharp-Editor
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_4_6_0;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEngine.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/UnityEngine.UI.dll
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/Editor/UnityEditor.UI.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.Graphs.dll
-
-
-
-
- {0C590955-EECE-1351-B315-A143BE8037B1} Assembly-CSharp-vs
-
-
-
-
-
diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj
deleted file mode 100644
index 7bd03e8..0000000
--- a/Assembly-CSharp-Editor.csproj
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}
- Library
- Properties
-
- Assembly-CSharp-Editor
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_4_6_0;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEngine.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/UnityEngine.UI.dll
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/Editor/UnityEditor.UI.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.Graphs.dll
-
-
-
-
- {0C590955-EECE-1351-B315-A143BE8037B1} Assembly-CSharp
-
-
-
-
-
diff --git a/Assembly-CSharp-vs.csproj b/Assembly-CSharp-vs.csproj
deleted file mode 100644
index 0a377a9..0000000
--- a/Assembly-CSharp-vs.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {0C590955-EECE-1351-B315-A143BE8037B1}
- Library
- Properties
-
- Assembly-CSharp
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_4_6_0;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEngine.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/UnityEngine.UI.dll
-
-
-
-
-
-
diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
deleted file mode 100644
index 0a377a9..0000000
--- a/Assembly-CSharp.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {0C590955-EECE-1351-B315-A143BE8037B1}
- Library
- Properties
-
- Assembly-CSharp
- v3.5
- 512
- Assets
-
-
- true
- full
- false
- Temp\bin\Debug\
- DEBUG;TRACE;UNITY_4_6_0;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN
- prompt
- 4
- 0169
-
-
- pdbonly
- true
- Temp\bin\Release\
- TRACE
- prompt
- 4
- 0169
-
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEngine.dll
-
-
- D:/Unity_46b15/Editor/Data/Managed/UnityEditor.dll
-
-
-
-
-
-
- D:/Unity_46b15/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.0/UnityEngine.UI.dll
-
-
-
-
-
-
diff --git a/Assets/Editor/ScriptableObjectFactory.cs b/Assets/Editor/ScriptableObjectFactory.cs
index a0492cf..6692bf3 100644
--- a/Assets/Editor/ScriptableObjectFactory.cs
+++ b/Assets/Editor/ScriptableObjectFactory.cs
@@ -1,18 +1,16 @@
using System;
-using System.Collections;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
///
-/// Helper class for instantiating ScriptableObjects.
+/// A helper class for instantiating ScriptableObjects in the editor.
///
public class ScriptableObjectFactory
{
- [MenuItem("Project/Create/ScriptableObject")]
[MenuItem("Assets/Create/ScriptableObject")]
- public static void Create()
+ public static void CreateScriptableObject()
{
var assembly = GetAssembly ();
@@ -22,10 +20,7 @@ where t.IsSubclassOf(typeof(ScriptableObject))
select t).ToArray();
// Show the selection window.
- var window = EditorWindow.GetWindow(true, "Create a new ScriptableObject", true);
- window.ShowPopup();
-
- window.Types = allScriptableObjects;
+ ScriptableObjectWindow.Init(allScriptableObjects);
}
///
diff --git a/Assets/Editor/ScriptableObjectWindow.cs b/Assets/Editor/ScriptableObjectWindow.cs
index 6b7edc0..0e6bc1f 100644
--- a/Assets/Editor/ScriptableObjectWindow.cs
+++ b/Assets/Editor/ScriptableObjectWindow.cs
@@ -21,11 +21,11 @@ public override void Action (int instanceId, string pathName, string resourceFil
public class ScriptableObjectWindow : EditorWindow
{
private int selectedIndex;
- private string[] names;
+ private static string[] names;
- private Type[] types;
+ private static Type[] types;
- public Type[] Types
+ private static Type[] Types
{
get { return types; }
set
@@ -34,7 +34,15 @@ public Type[] Types
names = types.Select(t => t.FullName).ToArray();
}
}
-
+
+ public static void Init(Type[] scriptableObjects)
+ {
+ Types = scriptableObjects;
+
+ var window = EditorWindow.GetWindow(true, "Create a new ScriptableObject", true);
+ window.ShowPopup();
+ }
+
public void OnGUI()
{
GUILayout.Label("ScriptableObject Class");
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4c71da2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+# ScriptableObjectFactory
+A Unity editor extension for creating any ScriptableObject type
+
+Download as a .UnityPackage: [ScriptableObjectFactory](https://www.dropbox.com/s/vdvf5si4go3jnb5/ScriptableObjectFactory.unitypackage)
+
+Originally introduced in this [Blog Post](http://www.tallior.com/unity-scriptableobject-factory/?utm_source=github&utm_medium=readme&utm_campaign=link)
diff --git a/ScriptableObjects-csharp.sln b/ScriptableObjects-csharp.sln
deleted file mode 100644
index ed8d0e1..0000000
--- a/ScriptableObjects-csharp.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2008
-
-Project("{E725F106-9BD1-43A2-2050-5BF13E9EFB89}") = "ScriptableObjects", "Assembly-CSharp-vs.csproj", "{0C590955-EECE-1351-B315-A143BE8037B1}"
-EndProject
-Project("{E725F106-9BD1-43A2-2050-5BF13E9EFB89}") = "ScriptableObjects", "Assembly-CSharp-Editor-vs.csproj", "{26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0C590955-EECE-1351-B315-A143BE8037B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Release|Any CPU.Build.0 = Release|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = Assembly-CSharp.csproj
- Policies = $0
- $0.TextStylePolicy = $1
- $1.inheritsSet = null
- $1.scope = text/x-csharp
- $0.CSharpFormattingPolicy = $2
- $2.inheritsSet = Mono
- $2.inheritsScope = text/x-csharp
- $2.scope = text/x-csharp
- $0.TextStylePolicy = $3
- $3.FileWidth = 120
- $3.TabWidth = 4
- $3.EolMarker = Unix
- $3.inheritsSet = Mono
- $3.inheritsScope = text/plain
- $3.scope = text/plain
- EndGlobalSection
-
-EndGlobal
diff --git a/ScriptableObjects.sln b/ScriptableObjects.sln
deleted file mode 100644
index 4e2f9c8..0000000
--- a/ScriptableObjects.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2008
-
-Project("{E725F106-9BD1-43A2-2050-5BF13E9EFB89}") = "ScriptableObjects", "Assembly-CSharp.csproj", "{0C590955-EECE-1351-B315-A143BE8037B1}"
-EndProject
-Project("{E725F106-9BD1-43A2-2050-5BF13E9EFB89}") = "ScriptableObjects", "Assembly-CSharp-Editor.csproj", "{26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0C590955-EECE-1351-B315-A143BE8037B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0C590955-EECE-1351-B315-A143BE8037B1}.Release|Any CPU.Build.0 = Release|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {26B2E2A7-DB38-FDBD-E6E2-42C94E7891CE}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = Assembly-CSharp.csproj
- Policies = $0
- $0.TextStylePolicy = $1
- $1.inheritsSet = null
- $1.scope = text/x-csharp
- $0.CSharpFormattingPolicy = $2
- $2.inheritsSet = Mono
- $2.inheritsScope = text/x-csharp
- $2.scope = text/x-csharp
- $0.TextStylePolicy = $3
- $3.FileWidth = 120
- $3.TabWidth = 4
- $3.EolMarker = Unix
- $3.inheritsSet = Mono
- $3.inheritsScope = text/plain
- $3.scope = text/plain
- EndGlobalSection
-
-EndGlobal