forked from cgvr/DeltaVR
added cheat keys to teleport player to minigames
This commit is contained in:
@@ -3,11 +3,15 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class ModelGenerationUtils : MonoBehaviour
|
||||
{
|
||||
public static ModelGenerationUtils Instance { get; private set; }
|
||||
public Transform[] minigamePoints;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -23,9 +27,38 @@ public class ModelGenerationUtils : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
// For teleporting player to different minigames, used during expos
|
||||
|
||||
// No keyboard present (e.g., Quest standalone without a paired keyboard)
|
||||
if (Keyboard.current == null) return;
|
||||
|
||||
if (Keyboard.current.digit1Key.wasPressedThisFrame)
|
||||
{
|
||||
XROrigin xrOrigin = FindObjectOfType<XROrigin>(includeInactive: true);
|
||||
xrOrigin.transform.position = minigamePoints[0].position;
|
||||
}
|
||||
|
||||
|
||||
if (Keyboard.current.digit2Key.wasPressedThisFrame)
|
||||
{
|
||||
XROrigin xrOrigin = FindObjectOfType<XROrigin>(includeInactive: true);
|
||||
xrOrigin.transform.position = minigamePoints[1].position;
|
||||
}
|
||||
|
||||
if (Keyboard.current.digit3Key.wasPressedThisFrame)
|
||||
{
|
||||
XROrigin xrOrigin = FindObjectOfType<XROrigin>(includeInactive: true);
|
||||
xrOrigin.transform.position = minigamePoints[2].position;
|
||||
}
|
||||
|
||||
if (Keyboard.current.digit0Key.wasPressedThisFrame)
|
||||
{
|
||||
string currentSceneName = SceneManager.GetActiveScene().name;
|
||||
SceneManager.LoadScene(currentSceneName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate model by starting a new Python subprocess
|
||||
* NOT USED IN LATEST VERSION
|
||||
|
||||
Reference in New Issue
Block a user