LoadAsset
Description
Load a unity asset from our package by project name and wanna load asset name.
Parameters
Param | Type | Description |
---|---|---|
T | T | UnityObject Type |
_projectName | String | your project name |
_wannaLoadedAssetName | String | you wanna load asset name |
_loadedCallback | Action<T> | call back when loaded |
Method
caution
This api is loading Prefab
from disk into memory. It is not instantiating the Prefab
into the game scene.
public void LoadAsset<T>(string _projectName, string _wannaLoadedAssetName,Action<T> _loadedCallback)
Example
internal static API api = new API(nameof(TestAPI));
public void OnLoad()
{
api.LoadGameObject(nameof(APITest), "Canvas",_canvasPrefab =>{
uiCanvasGameObject = Object.Instantiate(_canvasPrefab);
});
}