public void Init() { resourceManager = new MockResourceManager(dictResources); for (int i = 0; i < _params.Length; i++) { dictParams.Add(_params [i].path, _params [i]); } MockDownloaderFactory.Initialize(downloader); MockUnserializerFactory.Initialize((bytes) => { string path = System.Text.Encoding.Default.GetString(bytes); // 文件名被加了一个 .root/的前缀。 path = System.IO.Path.GetFileName(path); if (!hashSetErrorUnserializer.Contains(path)) { MockResourceObject obj = new MockResourceObject(dictParams [path]); return(obj); } return(null); }); CoroutineRunner.Instance.ActRunner = (e) => { bool completed = e.RunCoroutineWithoutYields(int.MaxValue); Assert.IsTrue(completed); }; }
static void DoIt() { /*if(Selection.activeObject is Material) * { * Material mat = Selection.activeObject as Material; * int count = ShaderUtil.GetPropertyCount(mat.shader); * for(int i=0;i<count;i++) * { * string name = ShaderUtil.GetPropertyName(mat.shader,i); * ShaderUtil.ShaderPropertyType type = ShaderUtil.GetPropertyType(mat.shader,i); * UnityEngine.Debug.Log("name:"+name+",type:"+type); * } * }*/ Doubility3D.Resource.Downloader.DownloaderFactory df = Doubility3D.Resource.Downloader.DownloaderFactory.Instance; MockDownloaderFactory.Initialize(new MockDownloader()); Doubility3D.Resource.Downloader.IDownloader idlr = df.Downloader; Debug.Log(idlr.GetType().FullName); MockUnserializerFactory.Initialize((bytes) => { Debug.Log("Unserialize"); return(null); }); UnserializerFactory.Instance.Unserialize(null); }