Example #1
0
        private IEnumerator Start()
        {
            yield return(new WaitForSeconds(5));

            mResLoader.LoadSync <Texture2D>("resources://pic1");

            yield return(new WaitForSeconds(2));

            Debug.Log("Start load:" + Time.time);
            mResLoader.LoadAsync <AudioClip>("resources://getcoin", callback =>
            {
                Debug.Log(callback.name);

                Debug.Log("end load:" + Time.time);
            });

            yield return(new WaitForSeconds(2));

            mResLoader.LoadSync <AudioClip>("resources://home");

            yield return(new WaitForSeconds(2));

            mResLoader.LoadSync <AudioClip>("resources://Audio/getcoin");

            yield return(new WaitForSeconds(3));

            var homePanelPrefab = mResLoader.LoadSync <GameObject>("resources://HomePanel");

            yield return(new WaitForSeconds(3));

            mResLoader.ReleaseAll();

            Debug.Log(homePanelPrefab == null);
        }
Example #2
0
        void Start()
        {
            var coinClip = mResLoader.LoadSync <AudioClip>("resources://getcoin");

            //var homeClip = mResLoader.LoadAsset<AudioClip>("home");

            //var bgClip = mResLoader.LoadAsset<AudioClip>("bg");
        }
Example #3
0
        private void Start()
        {
            FullHotUpdateMgr.Instance.CheckState(() =>
            {
                mBundle = mResLoader.LoadSync <AssetBundle>("testgo");

                var go = mBundle.LoadAsset <GameObject>("GameObject");

                Instantiate(go);
            });
        }
Example #4
0
        private void Start()
        {
            var squareTexture = mResLoader.LoadSync <Texture2D>("square", "Square");

            Debug.Log(squareTexture.name);

            //mResLoader.LoadAsync<GameObject>("testgo", "GameObject", gameObjPrefab =>
            //{
            //    Instantiate(gameObjPrefab);
            //});
        }
Example #5
0
        public override bool LoadSync <T>()
        {
            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);
        }
Example #6
0
        public override bool LoadSync <T>()
        {
            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 <T>(Name);
            }

            State = ResState.Loaded;

            return(Asset);
        }
Example #7
0
 void Start()
 {
     var coinClip = mResLoader.LoadSync <AudioClip>("resources://getcoin");
 }