void Start() { mAssetBundle = mResLoader.LoadSync <AssetBundle>("red"); GameObject gameObject = mAssetBundle.LoadAsset <GameObject>("red"); Instantiate(gameObject); }
public override bool LoadSync() { State = ResState.Loading; AssetBundle ownerBundle = mResLoader.LoadSync <AssetBundle>(mOwnerBundleName); Asset = ownerBundle.LoadAsset(Name); State = ResState.Loaded; return(Asset); }
private void Start() { Texture2D squareTexture = mResLoader.LoadSync <Texture2D>("square", "Square"); Debug.Log(squareTexture.name); mResLoader.LoadAsync <GameObject>("red", "Red", gameObjectPrefab => { Instantiate(gameObjectPrefab); }); }
/// <summary> /// 同步加载 /// </summary> /// <returns></returns> public override bool LoadSync() { State = ResState.Loading; string[] dependencyBundleNames = Manifest.GetDirectDependencies(Name); foreach (string dependencyBundleName in dependencyBundleNames) { mResLoader.LoadSync <AssetBundle>(dependencyBundleName); } assetBundle = AssetBundle.LoadFromFile(mAssetPath); State = ResState.Loaded; return(assetBundle); }
void Start() { resLoader.LoadSync <AudioClip>("resources://yu"); }
private void Start() { mResLoader.LoadAsync <AssetBundle>("square", squareTexture => { Debug.Log(squareTexture.name); }); mResLoader.LoadSync <AssetBundle>("square"); }