예제 #1
0
        void Start()
        {
            mAssetBundle = mResLoader.LoadSync <AssetBundle>("red");
            GameObject gameObject = mAssetBundle.LoadAsset <GameObject>("red");

            Instantiate(gameObject);
        }
예제 #2
0
        public override bool LoadSync()
        {
            State = ResState.Loading;
            AssetBundle ownerBundle = mResLoader.LoadSync <AssetBundle>(mOwnerBundleName);

            Asset = ownerBundle.LoadAsset(Name);
            State = ResState.Loaded;

            return(Asset);
        }
예제 #3
0
        private void Start()
        {
            Texture2D squareTexture = mResLoader.LoadSync <Texture2D>("square", "Square");

            Debug.Log(squareTexture.name);

            mResLoader.LoadAsync <GameObject>("red", "Red", gameObjectPrefab =>
            {
                Instantiate(gameObjectPrefab);
            });
        }
예제 #4
0
        /// <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);
        }
예제 #5
0
 void Start()
 {
     resLoader.LoadSync <AudioClip>("resources://yu");
 }
예제 #6
0
 private void Start()
 {
     mResLoader.LoadAsync <AssetBundle>("square",
                                        squareTexture => { Debug.Log(squareTexture.name); });
     mResLoader.LoadSync <AssetBundle>("square");
 }