From 176e38bfd943cf5a2328c33c56525d4c26fb81a3 Mon Sep 17 00:00:00 2001 From: AderKonstantin Date: Sun, 26 Jan 2025 14:14:43 +0300 Subject: [PATCH] refactor: remove obsolete RobotControllerStandart class --- .../Core/Classes/RobotControllerStandart.cs | 174 ------------------ .../Classes/RobotControllerStandart.cs.meta | 2 - 2 files changed, 176 deletions(-) delete mode 100644 Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs delete mode 100644 Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs.meta diff --git a/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs b/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs deleted file mode 100644 index 8baee9a..0000000 --- a/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs +++ /dev/null @@ -1,174 +0,0 @@ -using Unity.Netcode; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.InputSystem; - -public class RobotControllerStandart : NetworkBehaviour -{ - [Header("Objects")] - [SerializeField] private Rigidbody rb; - [SerializeField] protected Camera mainCam; - [SerializeField] private Weapon weapon; - - [SerializeField] private float upDownRange = 90f; - private float verticalRotation; - - [Header("Movement")] - [SerializeField] private float walkSpeed = 5.0f; - [SerializeField] private float sprintMultiplier = 5.0f; - float speedMultiplier = 1f; - - [Header("Gravity / JumpForce")] - [SerializeField] private float gravity = 9.81f; - [SerializeField] private float jumpForce = 5f; - - [Header("Look Sensitivity")] - [SerializeField] private float m_lookSensitivity = 3.0f; - private bool m_cursorIsLocked = true; - - [Header("Input Actions")] - [SerializeField] private PlayerInput playerInput; - - private Vector2 moveInput; - private Vector2 lookInput; - - private bool isMoving; - private Vector3 currentMovement = Vector3.zero; - - private void Awake() - { - rb = GetComponent(); - playerInput = GetComponent(); - rb.isKinematic = true; - } - -// // PlayerInput Events - -// public void OnConsoleButtonPressed(InputAction.CallbackContext context) -// { -// if (context.performed) -// { -// Debug.Log("Console"); -// if (LocalDeveloperConsoleOpened) { -// LocalDeveloperConsoleOpened = false; -// devConsole.CloseConsole(); -// } -// else { -// LocalDeveloperConsoleOpened = true; -// devConsole.OpenConsole(); -// } -// } -// } - -// public void OnMove(InputAction.CallbackContext context) -// { -// moveInput = context.ReadValue(); -// } - -// public void OnLook(InputAction.CallbackContext context) -// { -// lookInput = context.ReadValue(); -// } - -// public void OnSprint(InputAction.CallbackContext context) -// { -// if (context.performed) -// { -// Debug.Log("Running"); -// speedMultiplier = sprintMultiplier; -// } -// else -// { -// speedMultiplier = 1f; -// } -// } - -// public void OnJump(InputAction.CallbackContext context) -// { -// if (context.performed) -// { -// // JumpServerRPC(); -// } -// } - -// public void OnAttack(InputAction.CallbackContext context) -// { -// if (context.performed) -// { -// // ShootServerRPC(); -// } -// } -// private void Update() -// { -// if (!IsOwner) -// { -// return; -// } - -// HandleRotation(); -// } - -// private void HandleMovement() -// { -// float verticalSpeed = moveInput.y * walkSpeed * speedMultiplier; -// float horizontalSpeed = moveInput.x * walkSpeed * speedMultiplier; - -// Vector3 horizontalMovement = new Vector3 (horizontalSpeed, 0, verticalSpeed); -// horizontalMovement = transform.rotation * horizontalMovement; - -// handleGravityAndJumping(); - -// currentMovement.x = horizontalMovement.x; -// currentMovement.z = horizontalMovement.z; - -// characterController.Move(currentMovement * Time.deltaTime); - -// isMoving = moveInput.y != 0 || moveInput.x != 0; -// } - -// private void handleGravityAndJumping() -// { -// if (characterController.isGrounded) -// { -// currentMovement.y = -0.5f; -// } -// else -// { -// currentMovement.y -= gravity * Time.deltaTime; -// } -// } - -// void HandleRotation() -// { -// float mouseXRotation = lookInput.x * m_lookSensitivity; -// transform.Rotate(0, mouseXRotation, 0); - -// verticalRotation -= lookInput.y * m_lookSensitivity; -// verticalRotation = Mathf.Clamp(verticalRotation, -upDownRange, upDownRange); -// mainCam.transform.localRotation = Quaternion.Euler(verticalRotation, 0, 0); -// } - -// // // Networking Staff - -// // [ServerRpc] -// // private void JumpServerRPC() -// // { -// // if (characterController.isGrounded) -// // { -// // currentMovement.y = jumpForce; -// // Debug.Log("Debug.Log(currentMovement.y): " + currentMovement.y); -// // Debug.Log("Jumping triggered."); -// // } -// // } - -// // [ServerRpc] -// // private void ShootServerRPC() -// // { -// // weapon.Shooting(); -// // Debug.Log("Shooting triggered."); -// // } - - - - -} diff --git a/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs.meta b/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs.meta deleted file mode 100644 index e2b646e..0000000 --- a/Assets/Scripts/Runtime/Core/Classes/RobotControllerStandart.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 9c3e8bc9cf50891438d9aa9301c069d3