Esempio n. 1
0
        public override void UpdateInstruction()
        {
            if (robot.CompareItem(compareDirection, comparison, true, -1, -1))
            {
                // Comparison was successful
                instructionExecutor.JumpToInstruction(trueTarget);
            }

            // Comparison failed
            instructionExecutor.ExecuteNextInstruction();
        }
Esempio n. 2
0
 public override void UpdateInstruction()
 {
     if (executeNext)
     {
         instructionExecutor.ExecuteNextInstruction();
     }
     else
     {
         if (Math.Abs(robot.GetComponent <IsoTransform>().Position.x - targetPos.x) < .01f &&
             Math.Abs(robot.GetComponent <IsoTransform>().Position.y - targetPos.y) < .01f)
         {
             executeNext = true;
         }
     }
 }
Esempio n. 3
0
 public override void UpdateInstruction()
 {
     if (executeNext)
     {
         instructionExecutor.ExecuteNextInstruction();
     }
     else
     {
         // Check robot is has reached it's destination
         if (robot.GetComponent <IsoTransform>().Position == targetPos)
         {
             executeNext = true;
         }
     }
 }
Esempio n. 4
0
        public override void UpdateInstruction()
        {
            if (moving)
            {
                t += Time.deltaTime / seconds;

                target.transform.position = Vector3.Lerp(start, end, t);

                if (t >= 1)
                {
                    moving = false;
                    instructionExecutor.ExecuteNextInstruction();
                }
            }
        }
Esempio n. 5
0
 public override void UpdateInstruction()
 {
     instructionExecutor.ExecuteNextInstruction();
 }
Esempio n. 6
0
 public override void UpdateInstruction()
 {
     // Don't do anything, only a placeholder to jump to
     instructionExecutor.ExecuteNextInstruction();
 }
Esempio n. 7
0
 public override void UpdateInstruction()
 {
     // Jump to new position
     instructionExecutor.JumpToInstruction(jumpTarget);
     instructionExecutor.ExecuteNextInstruction();
 }