Exemplo n.º 1
0
        public static T LoadResource <T>(string resName, string resPath) where T : UnityEngine.Object
        {
            if (string.IsNullOrEmpty(resName))
            {
                return(null);
            }

            return(Resources.Load <T>(C_String.DeleteExpandedName(resPath + resName)));
        }
Exemplo n.º 2
0
        public static UnityEngine.Object LoadResource(string resName, string resPath)
        {
            if (string.IsNullOrEmpty(resName) || string.IsNullOrEmpty(resPath))
            {
                return(null);
            }

            return(Resources.Load(C_String.DeleteExpandedName(resPath + resName)));
        }
Exemplo n.º 3
0
        public static void AsyncLoadResource <T>(string resName, string resPath, Action <T> callback) where T : UnityEngine.Object
        {
            if (callback == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(resName) || string.IsNullOrEmpty(resPath))
            {
                callback(null);
                return;
            }

            C_MonoSingleton <C_GameFramework> .GetInstance().StartCoroutine(ExecuteAsyncLoadResource <T>(C_String.DeleteExpandedName(resPath + resName), callback));
        }