Skip to content

Commit 18d5124

Browse files
committed
added reset of savable component if guid broken
1 parent ab8b2ca commit 18d5124

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Assets/Kekser/SaveSystem/Savable.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public sealed class Savable : MonoBehaviour
1616
public Guid Guid => string.IsNullOrEmpty(_guid) ? Guid.NewGuid() : Guid.Parse(_guid);
1717
public Guid PrefabGuid => string.IsNullOrEmpty(_prefabGuid) ? Guid.NewGuid() : Guid.Parse(_prefabGuid);
1818

19+
private void Reset()
20+
{
21+
_guid = "";
22+
_prefabGuid = "";
23+
24+
OnValidate();
25+
}
26+
1927
private void OnValidate()
2028
{
2129
#if UNITY_EDITOR

0 commit comments

Comments
 (0)