Managed INput
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
<!-- UNITY CODE ASSIST INSTRUCTIONS START -->
|
<!-- UNITY CODE ASSIST INSTRUCTIONS START -->
|
||||||
- Project name: Ultimate-HelixJump
|
- Project name: Ultimate-HelixJump
|
||||||
- Unity version: Unity 6000.3.0f1
|
- Unity version: Unity 6000.3.0f1
|
||||||
- Active game object:
|
|
||||||
- Name: PlatformManager
|
|
||||||
- Tag: Untagged
|
|
||||||
- Layer: Default
|
|
||||||
<!-- UNITY CODE ASSIST INSTRUCTIONS END -->
|
<!-- UNITY CODE ASSIST INSTRUCTIONS END -->
|
||||||
@@ -25,7 +25,6 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions ,
|
|||||||
if(action == null) action = new GameInputAction();
|
if(action == null) action = new GameInputAction();
|
||||||
action.Enable();
|
action.Enable();
|
||||||
action.Player.SetCallbacks(this);
|
action.Player.SetCallbacks(this);
|
||||||
blockedInput = false;
|
|
||||||
isMouseButtonPressed= false;
|
isMouseButtonPressed= false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,9 +35,7 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions ,
|
|||||||
|
|
||||||
public void OnDrag(InputAction.CallbackContext context)
|
public void OnDrag(InputAction.CallbackContext context)
|
||||||
{
|
{
|
||||||
if (blockedInput) return;
|
|
||||||
dragInput = context.ReadValue<Vector2>();
|
dragInput = context.ReadValue<Vector2>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnMouseClicked(InputAction.CallbackContext context)
|
public void OnMouseClicked(InputAction.CallbackContext context)
|
||||||
@@ -48,11 +45,11 @@ public class InputReaderSO : ScriptableObject, GameInputAction.IPlayerActions ,
|
|||||||
|
|
||||||
public void LockInput()
|
public void LockInput()
|
||||||
{
|
{
|
||||||
blockedInput = true;
|
action.Player.Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnlockInput()
|
public void UnlockInput()
|
||||||
{
|
{
|
||||||
blockedInput = false;
|
action.Player.Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user