Example #1
0
    /*private void AddLocations(List<Transform> locations)
     * {
     *  int myTransform = -1;
     *  for(int i = 0; i < locations.Count; i++)
     *  {
     *      if(locations[i] != transform)
     *      {
     *          AddVectorObs(locations[i]);
     *      }
     *      else
     *      {
     *          myTransform = i;
     *      }
     *  }
     *  if(myTransform != -1)
     *  {
     *      AddVectorObs(locations[myTransform]);
     *  }
     *  else
     *  {
     *      Debug.LogError("Not found my transform!");
     *  }
     * }*/


    private void MoveTank(float moveAction)
    {
        int index = Mathf.FloorToInt(moveAction);

        if (index == 0)
        {
            tankMovement.AddMovement(-1);
        }
        else if (index == 1)
        {
            tankMovement.AddMovement(1);
        }
    }
Example #2
0
    void Update()
    {
        float movementInput = Input.GetAxis(m_MovementAxisName);
        float turnInput     = Input.GetAxis(m_TurnAxisName);

        tankMovement.AddMovement(movementInput);
        tankMovement.AddRotation(turnInput);
    }
Example #3
0
    private void MoveTank(float moveAction)
    {
        float amount = Mathf.Clamp(moveAction, -1, 1);

        tankMovement.AddMovement(amount);
    }
Example #4
0
 private void FixedUpdate()
 {
     Check();
     tankMovement.AddMovement(percent / 1 * direction);
     //DistanceCheck();
 }