I encountered problem with error
cs0246 cs(13,17) “InputManager”
and in the error
cs0234 cs(5,21) “Manager”
How can I resolve these?
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityTutorial.Manager;
namespace UnityTutorial.PlayerControl
{
public class PlayerController : MonoBehaviour
{
private Rigidbody _playerRigidbody;
private InputManager _inputManager;
private Animator _animator;
private bool _hasAnimator;
private int _xVelHash;
private int _yVelHash;
private const float _walkSpeed = 2f;
private const float _runSpeed = 6f;
private void start() {
_hasAnimator = TryGetComponent<Animator>(out _animator);
_playerRigidbody = GetComponent<Rigidbody>();
_inputManager = GetComponent<InputManager>();
_xVelHash = Animator.StringToHash("X_Velocity");
_yVelHash = Animator.StringToHash("Y_Velocity");
}
private void FixedUpdate() {
Move();
}
private void Move()
{
if(!_hasAnimator) return;
float targetSpeed = InputManager.Run ? _runSpeed : _walkSpeed;
if(_inputManager.move ==Vector2.zero ) targetSpeed = 0.1f;
_currentVelocity.x = targetSpeed * InputManager.Move.x;
_currentVelocity.y = targetSpeed * InputManager.Move.y;
var xVelDifference = _currentVelocity.x - _playerRigidbody.velocity.x;
var zVelDifference = _currentVelocity.y - _playerRigidbody.velocity.z;
_playerRigidbody.addForce(transform.TransformVector(new Vector3(xVelDifference, 0 , zVelDifference)), ForceMode.VelocityChange);
_animator.SetFloat(_xVelHash , _currentVelocity.x);
_animator.SetFloat(_yVelHash , _currentVelocity.y);
}
}
}