Added interact input
This commit is contained in:
@@ -2,10 +2,11 @@ using System;
|
||||
using Movement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using PlayerInput = Input.PlayerInput;
|
||||
|
||||
namespace Player
|
||||
{
|
||||
public class PlayerController : MonoBehaviour, IMovement, Input.PlayerInput.IPlayerControlActions
|
||||
public class PlayerController : MonoBehaviour, IMovement, PlayerInput.IPlayerControlActions
|
||||
{
|
||||
private const float DefaultJumpForce = 9.81f;
|
||||
private const float DefaultMass = 80.0f;
|
||||
@@ -23,18 +24,19 @@ namespace Player
|
||||
private bool _isOnAir;
|
||||
|
||||
private float _xAxisValue;
|
||||
private PlayerInput.IPlayerControlActions _playerControlActionsImplementation;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
this._playerRigidbody2D = gameObject.GetComponent<Rigidbody2D>();
|
||||
this._playerGroundTrigger = GameObject.Find("PlayerGroundTrigger").GetComponent<CollisionChecker>();
|
||||
this._playerSpriteRenderer = gameObject.GetComponent<SpriteRenderer>();
|
||||
_playerRigidbody2D = gameObject.GetComponent<Rigidbody2D>();
|
||||
_playerGroundTrigger = GameObject.Find("PlayerGroundTrigger").GetComponent<CollisionChecker>();
|
||||
_playerSpriteRenderer = gameObject.GetComponent<SpriteRenderer>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
this._playerRigidbody2D.gravityScale = GravityScale;
|
||||
this._playerRigidbody2D.mass = DefaultMass;
|
||||
_playerRigidbody2D.gravityScale = GravityScale;
|
||||
_playerRigidbody2D.mass = DefaultMass;
|
||||
BaseSpeed = DefaultSpeed;
|
||||
}
|
||||
|
||||
@@ -42,7 +44,7 @@ namespace Player
|
||||
{
|
||||
if (_controls == null)
|
||||
{
|
||||
_controls = new Input.PlayerInput();
|
||||
_controls = new PlayerInput();
|
||||
_controls.PlayerControl.SetCallbacks(this);
|
||||
}
|
||||
|
||||
@@ -72,11 +74,13 @@ namespace Player
|
||||
public void Pause()
|
||||
{
|
||||
IsPaused = true;
|
||||
_playerRigidbody2D.simulated = IsPaused;
|
||||
}
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
IsPaused = false;
|
||||
_playerRigidbody2D.simulated = IsPaused;
|
||||
}
|
||||
|
||||
// MOVE METHODS
|
||||
@@ -134,5 +138,10 @@ namespace Player
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnInteract(InputAction.CallbackContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user