Controlevents are now working
This commit is contained in:
@@ -11,6 +11,16 @@ namespace Assets.Scripts.Player
|
||||
UIHandler uihandler;
|
||||
GameObject interact;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
ControlEvents.OnLookingInput += LookAround;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
ControlEvents.OnLookingInput -= LookAround;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -43,7 +53,7 @@ namespace Assets.Scripts.Player
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LookAround(float pitch)
|
||||
public void LookAround(float pitch, float yaw)
|
||||
{
|
||||
transform.localRotation = Quaternion.Euler(pitch, 0f, 0f);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,14 @@ namespace Assets.Scripts.Player
|
||||
#if UNITY_EDITOR
|
||||
SceneHandler.switchGameToMenu();
|
||||
#endif
|
||||
ControlEvents.OnLookingInput += rotate;
|
||||
ControlEvents.OnMovingInput += move;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
ControlEvents.OnLookingInput -= rotate;
|
||||
ControlEvents.OnMovingInput -= move;
|
||||
}
|
||||
|
||||
void Start()
|
||||
@@ -179,7 +187,7 @@ namespace Assets.Scripts.Player
|
||||
GameObject.Find("QuestLog").GetComponent<QuestLog>().updateQuests("explore", gameObject, 1);
|
||||
}
|
||||
|
||||
public void rotate(float yaw){
|
||||
public void rotate(float pitch, float yaw){
|
||||
transform.rotation = Quaternion.Euler(0f, yaw, 0f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user