コード例 #1
0
        public static T LoadAsset <T>(eResBundle eID, string asset_path) where T : UnityEngine.Object
        {
#if !UNITY_EDITOR
            //if (BundleDic.ContainsKey(bundles_dir[(int)eID]))
            return(BundleDic[bundles_dir[(int)eID]].LoadAsset <T>(asset_path));
#else
            //else{
            //return getBundle(eResBundle.Image).LoadAsset<T>(asset_path);
            //Debug.Log(Application.dataPath + "/../" + asset_path);
            return(UnityEditor.AssetDatabase.LoadAssetAtPath <T>(asset_path));
#endif
            //System.IO.File.Open
        }
コード例 #2
0
    static ArrayList fnLoadFile(eResBundle eID, string path)
    {
        //BKTools.Assetbundle_path + BKTools.Assetbundle_Name_By_Platform + BKTools.bundles_dir[(int)eID]
        //var ta = BKTools.getBundle(eID).LoadAsset<TextAsset> (path);
        var       ta           = BKTools.LoadAsset <TextAsset>(eID, path);
        var       xmlText      = ta.text;
        ArrayList t_aArrayList = new ArrayList();         // 容器

        string[] arrs = xmlText.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
        foreach (string str in arrs)
        {
            t_aArrayList.Add(str);
        }
        return(t_aArrayList);
    }
コード例 #3
0
 public static GameObject getBundleObject(eResBundle bundle_id, string asset_path)
 {
     return(getBundle(bundle_id).LoadAsset <GameObject>(asset_path));
 }
コード例 #4
0
 public static AssetBundle getBundle(eResBundle eID)
 {
     return(BundleDic[bundles_dir[(int)eID]]);
 }