first commit
This commit is contained in:
52
Assets/Scripts/Player/PlayerControls.cs
Normal file
52
Assets/Scripts/Player/PlayerControls.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UIElements;
|
||||
using NodeCanvas;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion;
|
||||
|
||||
public class PlayerControls : MonoBehaviour{
|
||||
// References
|
||||
private Player thisPlayer;
|
||||
|
||||
// TODO: Turn these into accessors
|
||||
public Vector2 rawMoveInput;
|
||||
public Vector2 rawLookInput;
|
||||
|
||||
public GraphOwner graph;
|
||||
|
||||
void Awake(){
|
||||
thisPlayer = GetComponent<Player>();
|
||||
graph = GetComponent<GraphOwner>();
|
||||
}
|
||||
|
||||
void Start(){
|
||||
}
|
||||
|
||||
public void OnMove(InputValue value){
|
||||
rawMoveInput.x = value.Get<Vector2>().x;
|
||||
rawMoveInput.y = value.Get<Vector2>().y;
|
||||
}
|
||||
|
||||
public void OnLook(InputValue value){
|
||||
rawLookInput.x = value.Get<Vector2>().x;
|
||||
rawLookInput.y = value.Get<Vector2>().y;
|
||||
}
|
||||
|
||||
public void OnSprint(){
|
||||
SendMessage("StartSprint");
|
||||
graph.SendEvent<string>("InputEvent", "Sprint", null);
|
||||
}
|
||||
|
||||
public void OnJump(){
|
||||
SendMessage("StartJump");
|
||||
graph.SendEvent<string>("InputEvent", "Jump", null);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user