public void RemoveSpriteEvent(GameTime gameTime) { if (spriteEvent != null) { _StateChanged = true; spriteEvent = null; frameChangeTime = gameTime.TotalGameTime.TotalMilliseconds; sheetPos = 0; spriteEventIndex = -1; sheetSpecification = -1; OnEventEnd.Invoke(this, null); OnEventEnd = null; } }
public void SetSpriteEvent(int value, GameTime gameTime, EventHandler OnEventEnd = null, int sheetSpecification = 0) { if (spriteEvent == null) { _StateChanged = true; if (OnEventEnd == null) { this.OnEventEnd = new EventHandler((a, e) => { }); } else { this.OnEventEnd = OnEventEnd; } spriteEvent = new SpriteEvent(TexturePack.EventSheets[value][sheetSpecification].spriteSheet, gameTime, TexturePack.EventSheets[value][sheetSpecification].stickFrame); spriteEventIndex = value; this.sheetSpecification = sheetSpecification; } }