示例#1
0
 void Start()
 {
     if (keyboardInput)
     {
         moveDirection = new Vector3(keyboardInput.GetHorizontal(), keyboardInput.GetVertical(), 0).normalized;
     }
 }
示例#2
0
    public virtual void GetInput()
    {
        // Calculate steering amout
        Steer = Mathf.Clamp(default_input.GetHorizontal(), -1, 1);

        // How much Accelerator
        Motor = Mathf.Clamp(default_input.GetVertical(), 0, 1);

        // How much Brake
        Brake = -1 * Mathf.Clamp(default_input.GetVertical(), -1, 0);
    }
    public virtual void GetInput()
    {
        // calculate steering amount
        steer = Mathf.Clamp(default_input.GetHorizontal(), -1, 1);

        // how much accelerator?
        motor = Mathf.Clamp(default_input.GetVertical(), 0, 1);

        // how much brake?
        brake = -1 * Mathf.Clamp(default_input.GetVertical(), -1, 0);
    }
示例#4
0
    /// <summary>
    /// Gets the input (left, right, jump), def. invoke in UpdateCharacter.
    /// </summary>
    protected virtual void GetInput()
    {
        // this is just a 'default' function that (if needs be) should be overridden in the glue code
        horizontal_input = default_input.GetHorizontal();
        vertical_input   = default_input.GetVertical();

        if (Input.GetButtonDown("Jump") && grounded && !clickJump)
        {
            clickJump = true;
        }
    }
 public virtual void GetInput()
 {
     // This is just a 'default' function that (if needs be) should be overriden in the glue code
     horizontal_input = default_input.GetHorizontal();
     vertical_input   = default_input.GetVertical();
 }
示例#6
0
 protected virtual void GetInput()
 {
     horz = Mathf.Clamp(default_input.GetHorizontal(), -1, 1);
     vert = Mathf.Clamp(default_input.GetVertical(), -1, 1);
 }
 public virtual void GetInput()
 {
     steer = Mathf.Clamp(default_input.GetHorizontal(), -1, 1);
     motor = Mathf.Clamp(default_input.GetVertical(), 0, 1);
     brake = -1 * Mathf.Clamp(default_input.GetVertical(), -1, 0);
 }
 public virtual void GetInput()
 {
     horizontal_input = default_Input.GetHorizontal();
     vertical_input   = default_Input.GetVertical();
 }