示例#1
0
 /// <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);
 }
示例#2
0
        /// <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);
        }
示例#3
0
 /// <see cref="Animation.IInstruction.Execute"/>
 public bool Execute(Animation.IInstructionContext ctx)
 {
     ctx.InstructionPointer = 0;
     return(false);
 }
示例#4
0
 /// <see cref="Animation.IInstruction.Execute"/>
 public bool Execute(Animation.IInstructionContext ctx)
 {
     ctx.InstructionPointer = this.targetInstructionIdx;
     return(false);
 }