mirror of
https://github.com/xiaopeng12138/MaiDXR.git
synced 2024-11-24 12:00:09 +01:00
25 lines
714 B
C#
25 lines
714 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|