using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AddressableAssets; public class TestUnityObjectReference : MonoBehaviour { private List _testMatList = new(); public List serializableTestMatList = new(); // Start is called before the first frame update void Start() { } public void Test() { var path = "Assets/Art/AutoGen/PostProcessScenes/Assets_Scenes_CampScene/Combined/NLD_URP_NLD_Scene_Lambert/CombieMat.mat"; var mat = Addressables.LoadAssetAsync(path).WaitForCompletion(); _testMatList.Add(mat); Addressables.Release(mat); Debug.LogError($"test reference:{_testMatList[0].name}"); } public void TestSerializable() { var path = "Assets/Art/AutoGen/PostProcessScenes/Assets_Scenes_CampScene/Combined/NLD_URP_NLD_Scene_Lambert/CombieMat.mat"; var mat = Addressables.LoadAssetAsync(path).WaitForCompletion(); serializableTestMatList.Add(mat); Addressables.Release(mat); Debug.LogError($"test reference:{serializableTestMatList[0].name}"); } // Update is called once per frame void Update() { } }