コード例 #1
0
ファイル: Animation.cs プロジェクト: tndwolf/Wizards_Duel
        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;
            }
        }
コード例 #2
0
ファイル: Emitters.cs プロジェクト: tndwolf/Wizards_Duel
 override public void Apply(Particle particle)
 {
     IoManager.PlaySound(this.sfx);
 }