Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit cc61539

Browse files
committed
fix: GetModelForEdit from CreateModel
1 parent 3f12a26 commit cc61539

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Packages/com.nuclearband.sodatabase/Runtime/SODatabaseInternal.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ public static void CreateFolder(string path)
4141

4242
public static T CreateModel<T>(string path, string name) where T : DataNode
4343
{
44-
var fullPath = SODatabaseSettings.Path + path + "/" + name;
45-
46-
var model = GetModelForEdit<T>(fullPath);
44+
var model = GetModelForEdit<T>(path + "/" + name);
4745
if (model != null)
4846
return model;
4947

5048
CreateFolder(path);
5149
var obj = ScriptableObject.CreateInstance(typeof(T)) as T;
50+
var fullPath = SODatabaseSettings.Path + path + "/" + name;
5251
AssetDatabase.CreateAsset(obj, fullPath + ".asset");
5352
AssetDatabase.SaveAssets();
5453
AssetDatabase.Refresh();

0 commit comments

Comments
 (0)