Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Scripts/Editor/EditorWindows/CreateCollectionWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private enum Fields
private const string WAITING_SCRIPTS_TO_RECOMPILE_TO_CONTINUE_KEY = "WaitingScriptsToRecompileToContinueKey";
private const string LAST_COLLECTION_SCRIPTABLE_OBJECT_PATH_KEY = "CollectionScriptableObjectPathKey";
private const string LAST_COLLECTION_FULL_NAME_KEY = "CollectionFullNameKey";
private const string LAST_COLLECTION_NAMESPACE_KEY = "CollectionNamespaceKey";
private const string LAST_GENERATED_COLLECTION_SCRIPT_PATH_KEY = "CollectionScriptPathKey";
private const string LAST_TARGET_SCRIPTS_FOLDER_KEY = "LastTargetScriptsFolder";
private const string GENERATE_INDIRECT_ACCESS_KEY = "GenerateIndirectAccess";
Expand Down Expand Up @@ -265,6 +266,9 @@ private int MaximumNamespaceDepth

private static readonly EditorPreferenceString LastCollectionFullName =
new EditorPreferenceString(LAST_COLLECTION_FULL_NAME_KEY, null, true);

private static readonly EditorPreferenceString LastCollectionNamespace =
new EditorPreferenceString(LAST_COLLECTION_NAMESPACE_KEY, null, true);

private static readonly EditorPreferenceString LastScriptsTargetFolder =
new EditorPreferenceString(LAST_TARGET_SCRIPTS_FOLDER_KEY, null, true);
Expand Down Expand Up @@ -593,6 +597,8 @@ private string InferScriptFolderFromScriptableObjectFolder(string pathToInferFro

private void CreateNewCollection()
{
LastCollectionNamespace.Value = Namespace;

bool scriptsGenerated = false;
scriptsGenerated |= CreateCollectionItemScript();
scriptsGenerated |= CreateCollectionScript();
Expand Down Expand Up @@ -701,6 +707,9 @@ private static void AfterScriptsAreReady()
ScriptableObjectCollectionUtility.CreateScriptableObjectOfType(targetType,
windowInstance.ScriptableObjectFolderPath, windowInstance.CollectionName) as ScriptableObjectCollection;

if (!string.IsNullOrEmpty(LastCollectionNamespace.Value))
SOCSettings.Instance.SetNamespaceForCollection(collectionAsset, LastCollectionNamespace.Value);

Selection.objects = new Object[] {collectionAsset};
EditorGUIUtility.PingObject(collectionAsset);

Expand Down