override public void Update(Widget parent) { this.currRef += IoManager.DeltaTime; var icon = parent as Icon; if (this.currRef > this.endRef) { //var sprite = ((Icon)parent).sprite; this.currFrame = this.frames.Count - 1; icon.Sprite = this.frames [this.frames.Count - 1].rect; icon.Padding = this.frames [this.frames.Count - 1].offset; if (this.Looping == false) { this.hasEnded = true; return; } else { this.currRef -= this.endRef; } } try { if (this.frames [this.currFrame].millis < this.currRef) { this.currFrame += 1; var sprite = icon.Sprite; icon.Sprite = this.frames [this.currFrame].rect; icon.Padding = this.frames [this.currFrame].offset; if (this.frames[this.currFrame].sfx != "") { IoManager.PlaySound(this.frames[this.currFrame].sfx); } } } catch { this.hasEnded = true; } var p = parent as OutObject; if (p != null) { p.CurrentAnimationFrame = this.currFrame; } }
override public void Apply(Particle particle) { IoManager.PlaySound(this.sfx); }