Exemplo n.º 1
0
 public static T Load <T>(string path) where T : Object
 {
                 #if UNITY_EDITOR && !LOAD_ASSETBUNDLE_INEDITOR
     path = RES_ROOT_PATH + path;
     return(UnityEditor.AssetDatabase.LoadAssetAtPath <T>(path));
                 #else
     return(AssetbundleLoader.LoadRes <T>(path));
                 #endif
 }
Exemplo n.º 2
0
 public static string LoadLua(string path, string rootPath = Constant.luaRootPath)
 {
                 #if UNITY_EDITOR && !LOAD_ASSETBUNDLE_INEDITOR
     string luaPath = Application.dataPath + "/" + rootPath + path + ".lua";
     return(LoadFileToStr(luaPath));
                 #else
     string luaPath = "Examples/ABResources/Lua/" + path + ".txt";
     //the characters of assetbundle path are lower characters
     //	luaPath = luaPath.ToLower();
     TextAsset content = AssetbundleLoader.LoadRes <TextAsset>(luaPath);
     return(content.text);
                 #endif
 }