Added options and credits tabs for the in-game UI menu. Credits tab is blank for now. Disabled smooth locomotion to address the player controller confusion issues (see my thesis). Smooth locomotion can be reactivated via the options menu.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class ContinuoslocomotionConfigurator : MonoBehaviour
|
||||
{
|
||||
public Button turnOffButton;
|
||||
public Button turnOnButton;
|
||||
public ContinuousMoveProviderBase locomotion;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
turnOnButton.onClick.AddListener(enableLocomotion);
|
||||
turnOffButton.onClick.AddListener(disableLocomotion);
|
||||
turnOffButton.gameObject.SetActive(false); // off by default
|
||||
}
|
||||
public void UpdateSpeed(float speed)
|
||||
{
|
||||
locomotion.moveSpeed = speed;
|
||||
}
|
||||
|
||||
private void enableLocomotion()
|
||||
{
|
||||
locomotion.enabled = true;
|
||||
turnOnButton.gameObject.SetActive(false);
|
||||
turnOffButton.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void disableLocomotion()
|
||||
{
|
||||
locomotion.enabled = false;
|
||||
turnOnButton.gameObject.SetActive(true);
|
||||
turnOffButton.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user