Esempio n. 1
0
 void FixedUpdate()
 {
     if (Side == Player.Player1)
     {
         _grid.DebugDraw(v => Color.Lerp(Color.black, Color.white, v / 250f));
         QAIManager.GetAction(GetState())();
     }
 }
Esempio n. 2
0
 public void FixedUpdate()
 {
     if (_testModel)
     {
         Instantiate(Resources.Load <ModelTest>("ModelTest"));
         _testModel = false;
     }
     _grid.DebugDraw(value => value == 0 ? Color.red : value == 1 ? Color.gray : Color.yellow);
     if (QAIManager.CurrentMode != QAIMode.Imitating)
     {
         var state = GetState();
         QAIManager.GetAction(state)();
         ArchiveState(state);
     }
     else
     {
         Action currentAction = null;
         if (Key(KeyCode.UpArrow, KeyCode.W))
         {
             currentAction = MoveUp;
         }
         if (Key(KeyCode.DownArrow, KeyCode.S))
         {
             currentAction = MoveDown;
         }
         if (Key(KeyCode.RightArrow, KeyCode.D))
         {
             currentAction = MoveRight;
         }
         if (Key(KeyCode.LeftArrow, KeyCode.A))
         {
             currentAction = MoveLeft;
         }
         if (currentAction != null)
         {
             QAIManager.Imitate(this, GetState(), currentAction);
         }
     }
 }
Esempio n. 3
0
 public void Update()
 {
     _grid.DebugDraw(f => f > 0 ? Color.white : Color.black);
     _grid.Bounds.DebugDrawXY(Color.red);
 }