// Use this for initialization void Start() { var hitClip = mResLoader.LoadSync <AudioClip>("resources://hit"); var coinClip = mResLoader.LoadSync <AudioClip>("resources://hit"); var bgmClip = mResLoader.LoadSync <AudioClip>("resources://bgm"); }
// Use this for initialization void Start() { mBundle = mResLoader.LoadSync <AssetBundle>("gameobject"); var gameObj = mBundle.LoadAsset <GameObject>("GameObject"); Instantiate(gameObj); }
// Use this for initialization void Start() { var squareTexture = mResLoader.LoadSync <Texture2D>("square", "Square"); Debug.Log(squareTexture.name); //mResLoader.LoadAsync<GameObject>("gameobject", "GameObject", gameObjPrefab => //{ // Instantiate(gameObjPrefab); //}); }
// Use this for initialization IEnumerator Start() { yield return(new WaitForSeconds(2f)); mResLoader.LoadAsync <AudioClip>("resources://hit", hitClip => { Debug.Log(hitClip.name); Debug.Log(Time.deltaTime); }); Debug.Log(Time.deltaTime); mResLoader.LoadSync <GameObject>("resources://HomePanel"); yield return(new WaitForSeconds(2f)); mResLoader.LoadSync <AudioClip>("resources://bgm"); mResLoader.LoadSync <AudioClip>("resources://Audio/hit"); yield return(new WaitForSeconds(5f)); mResLoader.ReleaseAll(); }
public override bool LoadSync() { State = ResState.Loading; var dependencyBundleNames = ResData.Instance.GetDirectDependencies(Name); foreach (var dependencyBundleName in dependencyBundleNames) { mResLoader.LoadSync <AssetBundle>(dependencyBundleName); } if (!ResMgr.IsSimulationModeLogic) { AssetBundle = AssetBundle.LoadFromFile(mPath); } State = ResState.Loaded; return(AssetBundle); }
public override bool LoadSync() { State = ResState.Loading; var ownerBundle = mResLoader.LoadSync <AssetBundle>(mOwnerBundleName); if (ResMgr.IsSimulationModeLogic) { #if UNITY_EDITOR var assetPaths = UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(mOwnerBundleName, Name); Asset = UnityEditor.AssetDatabase.LoadAssetAtPath <Object>(assetPaths[0]); #endif } else { Asset = ownerBundle.LoadAsset(Name); } State = ResState.Loaded; return(Asset); }