Пример #1
0
    void DoSwingAction()
    {
        if (Input.GetKey(KeyCode.W))
        {
            webManager.webController.velocity += camTransform.forward * 0.6f;
        }
        if (Input.GetKey(KeyCode.A))
        {
            webManager.webController.velocity -= camTransform.right * 0.6f;
        }
        if (Input.GetKey(KeyCode.D))
        {
            webManager.webController.velocity += camTransform.right * 0.6f;
        }
        if (Input.GetKey(KeyCode.S))
        {
            webManager.webController.velocity -= camTransform.forward * 0.6f;
        }

        controller.Move(webManager.MoveBob(playerTransform.localPosition, previousPosition, Time.deltaTime));
        previousPosition = playerTransform.localPosition;
    }