/// <see cref="Animation.IInstruction.Execute"/> public bool Execute(Animation.IInstructionContext ctx) { ctx.SetFrame(new int[0]); //if (ctx[0] == 0) { ctx.SetFrame(this.spriteIndices[ctx.Direction]); } ctx[0]++; if (ctx[0] >= this.duration) { ctx.InstructionPointer++; } return(true); }
/// <see cref="Animation.IInstruction.Execute"/> public bool Execute(Animation.IInstructionContext ctx) { MapDirection direction = ctx.Direction; if (direction == MapDirection.Undefined) { throw new InvalidOperationException("IInstructionContext.Direction returned MapDirection.Undefined!"); } ctx.SetFrame(this.spriteIndices[ctx.Direction]); //if (ctx[0] == 0) { ctx.SetFrame(this.spriteIndices[ctx.Direction]); } ctx[0]++; if (ctx[0] >= this.duration) { ctx.InstructionPointer++; } return(true); }