🥪应用场景
按照命名规则拼装资源路径,自动给ScriptableObject中的自动进行自动赋值:预制体、图片…
🍱Demo
private void UpdateUIPrefab()
{
string uiPrefabAssetPath ="Assets/UI/xxx.prefab";
var uiPrefab = AssetDatabase.LoadAssetAtPath<GameObject>(uiPrefabAssetPath);
if (uiPrefab != null)
{
this.uiPrefab = uiPrefab;
}
else
{
Debug.LogError($"没有找到预制体:{uiPrefabAssetPath}");
}
}