Загрузка данных


using UnityEngine;
using UnityEngine.InputSystem;

[RequireComponent(typeof(CharacterController))]
[RequireComponent(typeof(Animator))]
public class ThirdPersonController : MonoBehaviour
{
	[Header("Movement Settings")]
	public float walkSpeed = 2f;
	public float runSpeed = 4f;
	public float sprintSpeed = 6f;
	public float turnSmoothTime = 0.15f;
	
	[Header("Animation Settings")]
	public float speedSmoothTime = 0.1f;
	
	[Header("Jump & Gravity")]
	public float jumpHeight = 1.2f;
	public float gravity = -9.81f;
	
	private CharacterController controller;
	private Animator animator;
	private Transform cameraTransform;
	
	private float turnSmoothVelocity;
	private float speedSmoothVelocity;
	private float currentSpeed;
	
	private Vector3 velocity;
	private bool isGrounded;
	
	private InputAction moveAction;
	private InputAction jumpAction;
	private InputAction sprintAction;
	
	void Awake() {
		moveAction = new InputAction("Move", binding: "<Gamepad>/leftStick");
		moveAction.AddCompositeBinding("Dpad")
		.With("Up", "<Keyboard>/w")
		.With("Down", "<Keyboard>/s")
		.With("Left", "<Keyboard>/a")
		.With("Right", "<Keyboard>/d");
		
		jumpAction = new InputAction("Jump", binding: "<Keyboard>/space");
		jumpAction.AddBinding("<Gamepad>/buttonSouth");
		
		sprintAction = new InputAction("Sprint", binding: "<Keyboard>/leftShift");
		sprintAction.AddBinding("<Gamepad>leftTrigger");
	}
	
	void OnEnable() 
	{
		moveAction.Enable();
		jumpAction.Enable();
		sprintAction.Enable();
	}
	
	void OnDisable()
	{
		
	}
}

public class ThirdPersonController
{
    
}