记录一下Addressables-Sample项目中的脚本和学习的笔记,主要是熟悉API及其使用方式.方便日后工作查询.
项目地址:
Unity官方教程
3.ComponentReference
此示例创建一个自己的泛型AssetReference,该AssetReference仅限于具有特定组件。
3.1 Scenes/SampleScene
Scripts/ComponentReference - ComponentReference
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class ComponentReference<TComponent> : AssetReference
{
public ComponentReferen