forked from zxl/LaboratoryProtection
50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.InputSystem;
|
|||
|
|
|||
|
namespace StarterAssets
|
|||
|
{
|
|||
|
public partial class StarterAssetsInputs
|
|||
|
{
|
|||
|
public bool allowJump = false;
|
|||
|
public bool allowMove = true;
|
|||
|
public bool allowLook = true;
|
|||
|
public bool allowSprint = true;
|
|||
|
|
|||
|
public void OnJump(InputValue value)
|
|||
|
{
|
|||
|
if (allowJump != true)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
JumpInput(value.isPressed);
|
|||
|
}
|
|||
|
|
|||
|
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
|
|||
|
public void OnMove(InputValue value)
|
|||
|
{
|
|||
|
if (allowMove != true)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
MoveInput(value.Get<Vector2>());
|
|||
|
}
|
|||
|
|
|||
|
public void OnLook(InputValue value)
|
|||
|
{
|
|||
|
if (cursorInputForLook)
|
|||
|
{
|
|||
|
LookInput(value.Get<Vector2>());
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void OnSprint(InputValue value)
|
|||
|
{
|
|||
|
if (allowSprint != true)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
SprintInput(value.isPressed);
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
}
|