simple UI added

This commit is contained in:
Mausham
2025-12-11 18:20:42 -08:00
parent 60e58082ac
commit 2118bb7c36
576 changed files with 126744 additions and 13 deletions

View File

@@ -6,16 +6,23 @@ using UnityEngine.InputSystem;
public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActions
{
public Action<Vector2> OnDragValueChanged;
public Vector2 _dragInput;
public Vector2 dragInput
{
get=> _dragInput;
private set
{
_dragInput = value;
OnDragValueChanged?.Invoke(_dragInput);
}
}
public float clickInput { get; private set; }
public bool isclicked {get; private set; }
private GameInput inputActions;
private void OnEnable()
@@ -25,10 +32,11 @@ public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActi
inputActions = new GameInput();
inputActions.Player.SetCallbacks(this);
}
inputActions.Enable();
}
private void OnDisable()
public void OnDisable()
{
inputActions?.Player.Disable();
}
@@ -37,4 +45,11 @@ public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActi
{
dragInput = context.ReadValue<Vector2>();
}
public void OnClick(InputAction.CallbackContext context)
{
clickInput = context.ReadValue<float>();
isclicked = clickInput == 1? true : false;
Debug.Log(isclicked);
}
}