feat: expand editor scripting asset and viewport flow
This commit is contained in:
52
managed/GameScripts/InputProbe.cs
Normal file
52
managed/GameScripts/InputProbe.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public sealed class InputProbe : MonoBehaviour
|
||||
{
|
||||
public int UpdateCount;
|
||||
public bool ObservedKeyA;
|
||||
public bool ObservedKeyADown;
|
||||
public bool ObservedKeyAUp;
|
||||
public bool ObservedKeySpace;
|
||||
public bool ObservedJump;
|
||||
public bool ObservedJumpDown;
|
||||
public bool ObservedJumpUp;
|
||||
public bool ObservedFire1;
|
||||
public bool ObservedFire1Down;
|
||||
public bool ObservedFire1Up;
|
||||
public bool ObservedAnyKey;
|
||||
public bool ObservedAnyKeyDown;
|
||||
public bool ObservedLeftMouse;
|
||||
public bool ObservedLeftMouseDown;
|
||||
public bool ObservedLeftMouseUp;
|
||||
public float ObservedHorizontal;
|
||||
public float ObservedHorizontalRaw;
|
||||
public Vector3 ObservedMousePosition;
|
||||
public Vector2 ObservedMouseScrollDelta;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
UpdateCount += 1;
|
||||
ObservedKeyA = Input.GetKey(KeyCode.A);
|
||||
ObservedKeyADown = Input.GetKeyDown(KeyCode.A);
|
||||
ObservedKeyAUp = Input.GetKeyUp(KeyCode.A);
|
||||
ObservedKeySpace = Input.GetKey(KeyCode.Space);
|
||||
ObservedJump = Input.GetButton("Jump");
|
||||
ObservedJumpDown = Input.GetButtonDown("Jump");
|
||||
ObservedJumpUp = Input.GetButtonUp("Jump");
|
||||
ObservedFire1 = Input.GetButton("Fire1");
|
||||
ObservedFire1Down = Input.GetButtonDown("Fire1");
|
||||
ObservedFire1Up = Input.GetButtonUp("Fire1");
|
||||
ObservedAnyKey = Input.anyKey;
|
||||
ObservedAnyKeyDown = Input.anyKeyDown;
|
||||
ObservedLeftMouse = Input.GetMouseButton(0);
|
||||
ObservedLeftMouseDown = Input.GetMouseButtonDown(0);
|
||||
ObservedLeftMouseUp = Input.GetMouseButtonUp(0);
|
||||
ObservedHorizontal = Input.GetAxis("Horizontal");
|
||||
ObservedHorizontalRaw = Input.GetAxisRaw("Horizontal");
|
||||
ObservedMousePosition = Input.mousePosition;
|
||||
ObservedMouseScrollDelta = Input.mouseScrollDelta;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user