private void WriteConfig(IContent writable, AnimatedCursorConfig config) { using (var stream = writable.GetOutputStream(ConfigFileName)) { xmlSerializer.Serialize(stream, config); } }
/// <summary> /// 从资源合集读取到动画光标; /// </summary> public AnimatedCursor Read(IReadOnlyContent content) { if (content == null) { throw new ArgumentNullException(nameof(content)); } AnimatedCursorConfig config = ReadConfig(content); IEnumerable <Texture2D> textures = ReadTextures(content); return(new AnimatedCursor(config, textures)); }
public AnimatedCursor(AnimatedCursorConfig config, IEnumerable <Texture2D> textures) { this.textures = textures.ToArray(); this.config = config; }