added sound script and menu
This commit is contained in:
@@ -5,4 +5,6 @@ public interface IInputReader
|
||||
Vector2 dragInput{get;}
|
||||
float clickInput { get;}
|
||||
bool isclicked { get;}
|
||||
|
||||
bool isBlocked { get; set; }
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using UnityEngine.InputSystem;
|
||||
public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActions
|
||||
{
|
||||
public Action<Vector2> OnDragValueChanged;
|
||||
public bool isBlocked { get; set;}
|
||||
|
||||
public Vector2 _dragInput;
|
||||
public Vector2 dragInput
|
||||
@@ -32,7 +33,7 @@ public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActi
|
||||
inputActions = new GameInput();
|
||||
inputActions.Player.SetCallbacks(this);
|
||||
}
|
||||
|
||||
isBlocked = false;
|
||||
inputActions.Enable();
|
||||
}
|
||||
|
||||
@@ -42,12 +43,13 @@ public class InputReader : ScriptableObject, IInputReader, GameInput.IPlayerActi
|
||||
}
|
||||
|
||||
public void OnDrag(InputAction.CallbackContext context)
|
||||
{
|
||||
{ if (isBlocked) { Debug.Log("InputBlocked"); return; }
|
||||
dragInput = context.ReadValue<Vector2>();
|
||||
}
|
||||
|
||||
public void OnClick(InputAction.CallbackContext context)
|
||||
{
|
||||
if(isBlocked) return;
|
||||
clickInput = context.ReadValue<float>();
|
||||
isclicked = clickInput == 1? true : false;
|
||||
Debug.Log(isclicked);
|
||||
|
||||
Reference in New Issue
Block a user