updated rkit
This commit is contained in:
@@ -2,5 +2,7 @@
|
||||
public static class GameConsts {
|
||||
public const string k_AddComponentMenu = "Jelycho/";
|
||||
public const string k_CreateAssetMenu = "Jelycho/";
|
||||
|
||||
public const string k_FPPActionMapName = "FPP";
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using System;
|
||||
using RebootKit.Engine.Extensions;
|
||||
using RebootKit.Engine.Foundation;
|
||||
using RebootKit.Engine.Input;
|
||||
using RebootKit.Engine.Main;
|
||||
using RebootKit.Engine.Network;
|
||||
using RebootKit.Engine.Simulation;
|
||||
using RebootReality.jelycho.Main;
|
||||
using RebootReality.jelycho.Player.HUD;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
@@ -18,16 +20,24 @@ namespace RebootReality.jelycho.Player {
|
||||
|
||||
PlayerActor m_Actor;
|
||||
PlayerHUD m_HUD;
|
||||
|
||||
InputState m_InputState;
|
||||
|
||||
IDisposable m_TargetInteractableLabelDisposable;
|
||||
|
||||
IInteractable m_Interactable;
|
||||
|
||||
void Awake() {
|
||||
m_HUD = Instantiate(m_Config.playerHUDPrefab);
|
||||
m_InputState = RR.Input.NewInputState("Player Controller");
|
||||
m_InputState.HideCursor = true;
|
||||
m_InputState.LockCursor = true;
|
||||
m_InputState.AddActiveMap(GameConsts.k_FPPActionMapName);
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
m_InputState?.Dispose();
|
||||
m_InputState = null;
|
||||
|
||||
if (m_HUD != null) {
|
||||
Destroy(m_HUD.gameObject);
|
||||
m_HUD = null;
|
||||
@@ -39,12 +49,12 @@ namespace RebootReality.jelycho.Player {
|
||||
}
|
||||
|
||||
void OnEnable() {
|
||||
RR.Input.LockCursor();
|
||||
m_InputState.IsActive = true;
|
||||
RR.Input.EnableControls();
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
RR.Input.UnlockCursor();
|
||||
m_InputState.IsActive = false;
|
||||
RR.Input.DisableControls();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user