added player and danger platfroms

This commit is contained in:
Mausham
2025-12-11 12:20:01 -08:00
parent 1014b82c22
commit 60e58082ac
42 changed files with 1070 additions and 2058 deletions

View File

@@ -0,0 +1,40 @@
using System;
using UnityEngine;
using UnityEngine.InputSystem;
[CreateAssetMenu(fileName = "InputReader", menuName = "Scriptable Objects/InputReader")]
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);
}
}
private GameInput inputActions;
private void OnEnable()
{
if(inputActions==null)
{
inputActions = new GameInput();
inputActions.Player.SetCallbacks(this);
}
inputActions.Enable();
}
private void OnDisable()
{
inputActions?.Player.Disable();
}
public void OnDrag(InputAction.CallbackContext context)
{
dragInput = context.ReadValue<Vector2>();
}
}