Game UI ready
This commit is contained in:
@@ -5,7 +5,9 @@ public interface IInputReader
|
||||
{
|
||||
event Action<Vector2> OnDragValueChanged;
|
||||
bool isMouseButtonPressed { get; }
|
||||
bool blockedInput { get; set; }
|
||||
Vector2 dragInput { get; }
|
||||
|
||||
void LockInput();
|
||||
void UnlockInput();
|
||||
|
||||
}
|
||||
|
||||
@@ -15,10 +15,9 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions ,
|
||||
}
|
||||
|
||||
public bool isMouseButtonPressed { get;private set; }
|
||||
public bool blockedInput { get; set; }
|
||||
|
||||
private bool blockedInput = false;
|
||||
private Vector2 _dragInput;
|
||||
|
||||
private GameInputAction action;
|
||||
|
||||
private void OnEnable()
|
||||
@@ -44,7 +43,16 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions ,
|
||||
|
||||
public void OnMouseClicked(InputAction.CallbackContext context)
|
||||
{
|
||||
if (blockedInput) return;
|
||||
isMouseButtonPressed = context.ReadValue<float>() == 1 ? true : false;
|
||||
}
|
||||
|
||||
public void LockInput()
|
||||
{
|
||||
blockedInput = true;
|
||||
}
|
||||
|
||||
public void UnlockInput()
|
||||
{
|
||||
blockedInput = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user