Remove dum shit
This commit is contained in:
@@ -182,7 +182,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
{
|
{
|
||||||
doMoveRight = true;
|
doMoveRight = true;
|
||||||
}
|
}
|
||||||
if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || Keyboard.current.downArrowKey.isPressed || Keyboard.current.sKey.isPressed || Keyboard.current.kKey.isPressed || Keyboard.current.iKey.isPressed || Mouse.current.leftButton.isPressed && !Application.isMobilePlatform || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed))
|
if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || Keyboard.current.downArrowKey.isPressed || Keyboard.current.sKey.isPressed || Keyboard.current.kKey.isPressed || Keyboard.current.iKey.isPressed || Mouse.current.leftButton.isPressed || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed))
|
||||||
{
|
{
|
||||||
doJump = true;
|
doJump = true;
|
||||||
}
|
}
|
||||||
@@ -193,62 +193,31 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
if (Application.isMobilePlatform)
|
if (Application.isMobilePlatform)
|
||||||
{
|
{
|
||||||
if (!Application.isMobilePlatform)
|
var touches = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches;
|
||||||
|
for (int i = 0; i < touches.Count; i++)
|
||||||
{
|
{
|
||||||
if (Mouse.current.leftButton.isPressed)
|
var pos = touches[i].screenPosition;
|
||||||
|
UnityEngine.Vector3 clickPosition = Camera.main.ScreenToWorldPoint(new UnityEngine.Vector3(pos.x, pos.y, 0f));
|
||||||
|
clickPosition.z = 0f;
|
||||||
|
if (leftArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
||||||
{
|
{
|
||||||
UnityEngine.Vector3 touchPosition = Camera.main.ScreenToWorldPoint(Pointer.current.position.ReadValue());
|
doMoveLeft = true;
|
||||||
touchPosition.z = 0f;
|
|
||||||
if (leftArrow.GetComponent<SpriteRenderer>().bounds.Contains(touchPosition))
|
|
||||||
{
|
|
||||||
doMoveLeft = true;
|
|
||||||
}
|
|
||||||
if (rightArrow.GetComponent<SpriteRenderer>().bounds.Contains(touchPosition))
|
|
||||||
{
|
|
||||||
doMoveRight = true;
|
|
||||||
}
|
|
||||||
if (jumpArrow.GetComponent<SpriteRenderer>().bounds.Contains(touchPosition))
|
|
||||||
{
|
|
||||||
doJump = true;
|
|
||||||
}
|
|
||||||
if (restartButton.GetComponent<SpriteRenderer>().bounds.Contains(touchPosition))
|
|
||||||
{
|
|
||||||
doRestart = true;
|
|
||||||
}
|
|
||||||
if (backButton.GetComponent<SpriteRenderer>().bounds.Contains(touchPosition))
|
|
||||||
{
|
|
||||||
doBack = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if (rightArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
||||||
else
|
|
||||||
{
|
|
||||||
var touches = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches;
|
|
||||||
for (int i = 0; i < touches.Count; i++)
|
|
||||||
{
|
{
|
||||||
var pos = touches[i].screenPosition;
|
doMoveRight = true;
|
||||||
UnityEngine.Vector3 clickPosition = Camera.main.ScreenToWorldPoint(new UnityEngine.Vector3(pos.x, pos.y, 0f));
|
}
|
||||||
clickPosition.z = 0f;
|
if (jumpArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
||||||
if (leftArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
{
|
||||||
{
|
doJump = true;
|
||||||
doMoveLeft = true;
|
}
|
||||||
}
|
if (restartButton.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
||||||
if (rightArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
{
|
||||||
{
|
doRestart = true;
|
||||||
doMoveRight = true;
|
}
|
||||||
}
|
if (backButton.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
||||||
if (jumpArrow.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
{
|
||||||
{
|
doBack = true;
|
||||||
doJump = true;
|
|
||||||
}
|
|
||||||
if (restartButton.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
|
||||||
{
|
|
||||||
doRestart = true;
|
|
||||||
}
|
|
||||||
if (backButton.GetComponent<SpriteRenderer>().bounds.Contains(clickPosition))
|
|
||||||
{
|
|
||||||
doBack = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user