Added touch support for controls

This commit is contained in:
Pasha Bibko
2025-11-25 13:24:31 +00:00
parent 4fe8132656
commit 8b141dcd93
3 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
using UnityEngine;
public static class GlobalInput
{
public static bool IsScreenClicked()
{
return Input.GetMouseButtonDown(0) || Input.touchCount > 0;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1f0047bf5b13c1a49ae952046f359333
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -30,7 +30,7 @@ public class PlayerController : OrbitalPositionBehaviour
{
m_ScoreText.text = PlayerScore.ToString();
if (Input.GetKeyDown(KeyCode.Space) && GlobalOrbitalPositionManager.AllowPlayerInput)
if (GlobalInput.IsScreenClicked() && GlobalOrbitalPositionManager.AllowPlayerInput)
{
m_OrbitalPosition.m_AttachedRing += 1;
}