initial commit

This commit is contained in:
Jo 2025-01-07 02:06:59 +01:00
parent 6715289efe
commit 788c3389af
37645 changed files with 2526849 additions and 80 deletions

View file

@ -0,0 +1,34 @@
namespace AddressableAssets.DocExampleCode
{
#region doc_Load
using System.Collections;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
internal class LoadAddress : MonoBehaviour
{
public string key;
AsyncOperationHandle<GameObject> opHandle;
public IEnumerator Start()
{
opHandle = Addressables.LoadAssetAsync<GameObject>(key);
yield return opHandle;
if (opHandle.Status == AsyncOperationStatus.Succeeded)
{
GameObject obj = opHandle.Result;
Instantiate(obj, transform);
}
}
void OnDestroy()
{
Addressables.Release(opHandle);
}
}
#endregion
}