using UnityEngine;
public class SerializableScriptableObject : ScriptableObject
{
[SerializeField] Guid _guid;
public Guid Guid => _guid;
void OnValidate()
{
#if UNITY_EDITOR // UnityEditor namespace is not available in Release/Builds
var path = UnityEditor.AssetDatabase.GetAssetPath(this);
_guid = new Guid(UnityEditor.AssetDatabase.AssetPathToGUID(path));
#endif
}
}