Пример #1
0
        /// <summary>
        /// 实例化address prefab, 且放在parent下面
        /// </summary>
        public static void InstantiatePrefab(string address, Transform parent, Vector3 localPosition,
                                             Action <GameObject> onComplete = null)
        {
            CResourceLoader loader = new CResourceLoader();

            loader.InstantiateGameObject(address, parent, localPosition, onComplete);
        }
Пример #2
0
        /// <summary>
        /// 加载文本
        /// </summary>
        public static void LoadText(string address, Action <string> onComplete)
        {
            CResourceLoader loader = new CResourceLoader();

            loader.LoadObject <UnityEngine.Object>(address, o =>
            {
                if (o == null)
                {
                    Debug.LogWarning(address + "| is null");
                }
                onComplete(o.ToString());
            });
        }
Пример #3
0
        /// <summary>
        /// 加载ui用的sprite
        /// </summary>
        public static void LoadSprite(string address, Action <Sprite> onComplete)
        {
            CResourceLoader loader = new CResourceLoader();

            loader.LoadObject <Sprite>(address, onComplete);
        }
Пример #4
0
        /// <summary>
        /// Loads the prefab.
        /// </summary>
        public static void LoadPrefab(string address, Action <GameObject> onComplete = null)
        {
            CResourceLoader loader = new CResourceLoader();

            loader.LoadGameObject(address, onComplete);
        }