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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,8 @@ namespace Gameplay
|
||||
|
||||
public float Speed;
|
||||
public float ObservedFixedDeltaTime;
|
||||
public float ObservedConfiguredFixedDeltaTime;
|
||||
public float ObservedConfiguredFixedDeltaTimeInUpdate;
|
||||
public float ObservedUpdateDeltaTime;
|
||||
public float ObservedLateDeltaTime;
|
||||
public string Label = string.Empty;
|
||||
@@ -103,6 +105,7 @@ namespace Gameplay
|
||||
{
|
||||
FixedUpdateCount += 1;
|
||||
ObservedFixedDeltaTime = Time.deltaTime;
|
||||
ObservedConfiguredFixedDeltaTime = Time.fixedDeltaTime;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@@ -110,6 +113,7 @@ namespace Gameplay
|
||||
UpdateCount += 1;
|
||||
Speed += 1.0f;
|
||||
ObservedUpdateDeltaTime = Time.deltaTime;
|
||||
ObservedConfiguredFixedDeltaTimeInUpdate = Time.fixedDeltaTime;
|
||||
ObservedLocalPosition = transform.localPosition;
|
||||
Quaternion rotation = transform.localRotation;
|
||||
ObservedLocalRotation = new Vector4(rotation.x, rotation.y, rotation.z, rotation.w);
|
||||
|
||||
48
managed/GameScripts/TickLogProbe.cs
Normal file
48
managed/GameScripts/TickLogProbe.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public sealed class TickLogProbe : MonoBehaviour
|
||||
{
|
||||
public int FixedUpdateCount;
|
||||
public int UpdateCount;
|
||||
public int LateUpdateCount;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
Debug.Log("[TickLogProbe] Awake");
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Debug.Log("[TickLogProbe] Start");
|
||||
}
|
||||
|
||||
public void FixedUpdate()
|
||||
{
|
||||
FixedUpdateCount += 1;
|
||||
if (FixedUpdateCount <= 3)
|
||||
{
|
||||
Debug.Log("[TickLogProbe] FixedUpdate " + FixedUpdateCount);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
UpdateCount += 1;
|
||||
if (UpdateCount <= 3)
|
||||
{
|
||||
Debug.Log("[TickLogProbe] Update " + UpdateCount);
|
||||
}
|
||||
}
|
||||
|
||||
public void LateUpdate()
|
||||
{
|
||||
LateUpdateCount += 1;
|
||||
if (LateUpdateCount <= 3)
|
||||
{
|
||||
Debug.Log("[TickLogProbe] LateUpdate " + LateUpdateCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user