some updates
This commit is contained in:
@@ -50,6 +50,7 @@ public class TrackTouchRegionLayoutController : MonoBehaviour
|
||||
|
||||
if (mobileOnly && !Application.isMobilePlatform)
|
||||
{
|
||||
DisableTouchRegionsForCurrentPlatform();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,4 +116,30 @@ public class TrackTouchRegionLayoutController : MonoBehaviour
|
||||
|
||||
touchRegion.trackIndex = trackIndex;
|
||||
}
|
||||
|
||||
private void DisableTouchRegionsForCurrentPlatform()
|
||||
{
|
||||
EnsureDefaultBindings();
|
||||
|
||||
for (int i = 0; i < regions.Length; i++)
|
||||
{
|
||||
RegionBinding binding = regions[i];
|
||||
if (binding == null || binding.regionObject == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Image image = binding.regionObject.GetComponent<Image>();
|
||||
if (image != null)
|
||||
{
|
||||
image.raycastTarget = false;
|
||||
}
|
||||
|
||||
TrackTouchRegion touchRegion = binding.regionObject.GetComponent<TrackTouchRegion>();
|
||||
if (touchRegion != null)
|
||||
{
|
||||
touchRegion.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user