Added touch support for controls
This commit is contained in:
9
Assets/Scripts/GlobalInput.cs
Normal file
9
Assets/Scripts/GlobalInput.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
public static class GlobalInput
|
||||
{
|
||||
public static bool IsScreenClicked()
|
||||
{
|
||||
return Input.GetMouseButtonDown(0) || Input.touchCount > 0;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/GlobalInput.cs.meta
Normal file
11
Assets/Scripts/GlobalInput.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f0047bf5b13c1a49ae952046f359333
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user