Skip to main content

LoadAsset

Description

Load a unity asset from our package by project name and wanna load asset name.

Parameters

ParamTypeDescription
TTUnityObject Type
_projectNameStringyour project name
_wannaLoadedAssetNameStringyou wanna load asset name
_loadedCallbackAction<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);
});
}