コード例 #1
0
    private void FixedUpdate()
    {
        float   xDifference = oscX.SampleDelta(data.refs.ts.DeltaTime());
        float   yDifference = oscY.SampleDelta(data.refs.ts.DeltaTime());
        Vector2 change      = new Vector2(xDifference, yDifference);

        mover.OffsetPosition(change);
    }
コード例 #2
0
 private void FixedUpdate()
 {
     if (lerping)
     {
         Vector2 stepVelocity = velocity * timeScale.DeltaTime();
         if (stepVelocity.sqrMagnitude >
             (destination - mover.GetPosition()).sqrMagnitude)
         {
             mover.TeleportPosition(destination);
             OnCompleted();
         }
         else
         {
             mover.OffsetPosition(stepVelocity);
         }
     }
 }
コード例 #3
0
    public void ReceiveInput(InputReader inputReader)
    {
        float   axisH  = inputReader.GetAxisHorizontalRaw();
        float   axisV  = inputReader.GetAxisVerticalRaw();
        Vector2 change = new Vector2(axisH, axisV)
                         * data.movementSpeed * tsGameplay.DeltaTime();

        mover.OffsetPosition(change);

        if (!tsGameplay.IsPaused())
        {
            if (inputReader.GetKeyDown(KeyCode.Space))
            {
                playerPunch.Punch();
            }
        }

        if (inputReader.GetKeyDown(KeyCode.Escape))
        {
            TogglePause();
        }
    }
コード例 #4
0
 private void FixedUpdate()
 {
     mover.OffsetPosition(velocity * timeScale.DeltaTime());
 }
コード例 #5
0
 private void FixedUpdate()
 {
     mover.OffsetPosition(data.velocity * data.refs.ts.DeltaTime());
 }