Skip to content

Commit c2241e5

Browse files
committed
fix: AssetDatabase.SaveAssets" are restricted during asset importing.
1 parent e062fca commit c2241e5

File tree

11 files changed

+214
-233
lines changed

11 files changed

+214
-233
lines changed

Assets/Code/LevelEditor/BlockDataEditor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public void SetID(string newId)
2727
if (!string.IsNullOrEmpty(assetPath))
2828
{
2929
AssetDatabase.RenameAsset(assetPath, newId);
30-
EditorUtility.SetDirty(this);
31-
AssetDatabase.SaveAssets();
3230
}
3331
#endif
3432
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Code.LevelEditor
66
{
77
[Serializable]
8-
public class BlockEditorDto
8+
public class BlockEditorDTO
99
{
1010
public string Id;
1111
public Sprite Icon;

Assets/Code/LevelEditor/BlockEditorDTO.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Code/LevelEditor/BlockEditorDto.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

Assets/Code/LevelEditor/BlockLibraryWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void ShowWindow()
4343
private SortMode _sortMode = SortMode.ByID;
4444

4545
private BlockDataEditor _selectedBlock;
46-
private BlockEditorDto _blockDraft = new BlockEditorDto();
46+
private BlockEditorDTO _blockDraft = new BlockEditorDTO();
4747
private bool _sortAscending = true;
4848
private Vector2 _scroll;
4949

Assets/Resources/StaticData/BlocksData/BlockLibrary.asset

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
AllBlocks:
1616
- {fileID: 11400000, guid: d7831333fc0fec44f9c7d1e185ca6ba9, type: 2}
17-
- {fileID: 11400000, guid: 39174ad4a8c18074f943c604c8246649, type: 2}
18-
- {fileID: 11400000, guid: 0c775f43ddd810b4e84cee93c7324651, type: 2}
1917
- {fileID: 11400000, guid: 6f840c6e80be02847a36539af4966f44, type: 2}
2018
- {fileID: 11400000, guid: 653a1b7a0d0a7584db631a6d3fe22975, type: 2}
2119
- {fileID: 11400000, guid: 275269e371b517a4c904804a054d498d, type: 2}
@@ -24,3 +22,4 @@ MonoBehaviour:
2422
- {fileID: 11400000, guid: bea2451b1a5ce3a458317800588169f1, type: 2}
2523
- {fileID: 11400000, guid: fec0b7c3518cd74459f0ed42ede2827c, type: 2}
2624
- {fileID: 11400000, guid: 7b0fa29ca43f6c843994988a93b871bc, type: 2}
25+
- {fileID: 11400000, guid: 304b773702014ad4889ec095aebabf09, type: 2}

Assets/Resources/StaticData/BlocksData/Test_1.asset

Lines changed: 0 additions & 17 deletions
This file was deleted.

Assets/Resources/StaticData/BlocksData/Test_1.asset.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

Assets/Resources/StaticData/BlocksData/Test_2.asset renamed to Assets/Resources/StaticData/BlocksData/Test_6.asset

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ MonoBehaviour:
1010
m_Enabled: 1
1111
m_EditorHideFlags: 0
1212
m_Script: {fileID: 11500000, guid: 73698c54e77f2b34ea84f49756a68126, type: 3}
13-
m_Name: Test_2
13+
m_Name: Test_6
1414
m_EditorClassIdentifier:
15-
id: Test_2
16-
icon: {fileID: 21300000, guid: 60b64bb9f8fe2424bbcd1d7d5c414084, type: 3}
15+
id: Test_6
16+
icon: {fileID: 21300000, guid: 1cc5832122ec43a4cbd0c713119107c1, type: 3}
1717
prefab: {fileID: 0}

Assets/Resources/StaticData/BlocksData/Test_2.asset.meta renamed to Assets/Resources/StaticData/BlocksData/Test_6.asset.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)