您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
19 行
363 B
19 行
363 B
using UnityEngine;
|
|
|
|
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
#endif
|
|
|
|
public class SerializableScriptableObject : ScriptableObject
|
|
{
|
|
[SerializeField, HideInInspector] private string _guid;
|
|
public string Guid => _guid;
|
|
|
|
#if UNITY_EDITOR
|
|
void OnValidate()
|
|
{
|
|
var path = AssetDatabase.GetAssetPath(this);
|
|
_guid = AssetDatabase.AssetPathToGUID(path);
|
|
}
|
|
#endif
|
|
}
|