public ScenarioInfo ReadZipInfo(string file) { using (var content = new SharpZipLibContent(file)) { var description = ReadDescription(content); var contentInfo = new ZipContentInfo(file); return(new ScenarioInfo(contentInfo, description)); } }
private void Test0() { var animatedCursorFactroy = new AnimatedCursorFactroy(); using (var content = new SharpZipLibContent(Path.Combine(GameCursor.CursorsDirectory, "Wait.zip"))) { animatedCursor = animatedCursorFactroy.Read(content); } WindowCursor.SetCursor(animatedCursor); }
/// <summary> /// 尝试读取到光标文件; /// </summary> private static bool TryReadFromZip(string zipFilePath, out ICustomCursor cursor) { try { using (var content = new SharpZipLibContent(zipFilePath)) { return(TryRead(content, out cursor)); } } catch (Exception ex) { UnityEngine.Debug.Log(ex); cursor = null; return(false); } }
private void Test1() { var animatedCursorFactroy = new AnimatedCursorFactroy(); var staticCursorFactroy = new StaticCursorFactroy(); using (var content = SharpZipLibContent.CreateNew(Path.Combine(GameCursor.CursorsDirectory, "AnimatedCursor.zip"))) { using (content.BeginUpdateAuto()) { animatedCursorFactroy.Write(content, animatedCursor); } } using (var content = SharpZipLibContent.CreateNew(Path.Combine(GameCursor.CursorsDirectory, "StaticCursor.zip"))) { using (content.BeginUpdateAuto()) { staticCursorFactroy.Write(content, staticCursor); } } }