1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2024-11-28 04:50:48 +01:00
MaiDXR/Assets/Scripts/ToggleMove.cs

23 lines
654 B
C#
Raw Normal View History

using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class ToggleMove : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(KeyCode.M))
{
if (GetComponent<ContinuousMoveProviderBase>().enabled)
{
GetComponent<ContinuousMoveProviderBase>().enabled = false;
GetComponent<ContinuousTurnProviderBase>().enabled = false;
}
else
{
GetComponent<ContinuousMoveProviderBase>().enabled = true;
GetComponent<ContinuousTurnProviderBase>().enabled = true;
}
}
}
}