byte[] LuaLoader(ref string filepath) { string absPath = Application.dataPath + @"\Lua\" + filepath + ".lua"; IPathTool.FixedPath(ref absPath); return(File.ReadAllBytes(absPath)); }
/// <summary> /// 读取场景配置文件 /// </summary> /// <param name="scenceName"></param> public void ReadConfiger(string scenceName) { string textFileName = "Record.txt"; string path = IPathTool.GetAssetBundlePath() + "/" + scenceName + textFileName; abManager = new IABManager(scenceName); ReadConfig(path); }
/// <summary> /// /// </summary> /// <param name="bundleName">ab标签</param> /// <param name="tmpFinish">完成时回调</param> /// <param name="tmpProgress">加载时每帧回调</param> public IABLoader(string bundleName, LoadFinish tmpFinish = null, LoadProgrecess tmpProgress = null) { this.bundleName = bundleName; this.commonBundlePath = IPathTool.GetWWWAssetBundlePath() + "/" + bundleName; this.commonResLoaderProgress = 0; this.abResLoader = null; this.loadProgrecess = tmpProgress; this.loadFinish = tmpFinish; }
/// <summary> /// 设置bundle /// </summary> /// <param name="bundleName"></param> public void SetBundleName(string bundleName) { this.bundleName = bundleName; this.commonBundlePath = IPathTool.GetWWWAssetBundlePath() + "/" + bundleName; }
protected override void Start() { UIVariable name = variableTable.FindVariable("ddddd"); //print(name.name); name.SetVlaue("测试一"); cube = nameTable.FindObj("cube"); cube.SetActive(false); //table.ListenEvent("Click", Click); //table.ListenEvent("ClickThree", ClickThree); // GlobalEventSystem.Bind(GlobalEventType.test, ClickThree); // GlobalEventSystem.Bind(GlobalEventType.test2, ClickTwo); //TimeControl timer = TimeControl.CreaterTimer(); //timer.StartTiming(10, Complete, Func, 3, true, false, true); string path = IPathTool.GetAssetBundlePath();//.Substring(IPathTool.GetAssetBundlePath().IndexOf("Assets")); //路径/斜 //AssetBundle ab = AssetBundle.LoadFromFile(Application.dataPath + @"/StreamingAssets/Windows/sceneone/one/cube.unity3d"); //Debug.Log(Application.dataPath + @"/StreamingAssets/Windows/sceneone/one/cube.unity3d"); //Debug.Log(IPathTool.GetAssetBundlePath()); //IABResLoader abloader = new IABResLoader(ab); // GameObject ob = abloader["Cube"] as GameObject; //Instantiate(ob, transform); //abloader.Dispose(); //abScene.LoadAsset("Cube.prefab", ClickTwo, Complete); //abLoader = new IABLoader(path); // print(path); //abLoader.OnLoadFinish(Click); //abLoader.OnLoad(ClickTwo); //StartCoroutine(abLoader.CommonLoad()); //print(IPathTool.GetWWWAssetBundlePath() +"/" + "sceneone/one/cube.unity3d"); //ab = new IABLoader(bundleName, Complete1, null); //StartCoroutine(ab.CommonLoad()); // relation = new IABRelationManager(bundleName, Complete); //StartCoroutine(relation.LoadAssetBundle()); //manifest = new IABManifestLoader(Complect3); //StartCoroutine(manifest.LoadManifet()); //string sceneName = "SceneOne"; //IABScenceManager abScene = new IABScenceManager(sceneName); //abScene.ReadConfiger(sceneName); IABManifestLoader manifest = new IABManifestLoader(ManifestLoadComplete); StartCoroutine(manifest.LoadManifet()); }