|
|
|
@ -18,11 +18,15 @@ public class MoveController : MonoBehaviour
|
|
|
|
|
public float MoveSpeed; |
|
|
|
|
public bool CanMove = true; |
|
|
|
|
private bool IsInteratUI; |
|
|
|
|
// public float MaxMoveSpeed=7f; |
|
|
|
|
|
|
|
|
|
private Transform SettingPanel; |
|
|
|
|
private Transform BG; |
|
|
|
|
// public float MaxMoveSpeed=7f; |
|
|
|
|
|
|
|
|
|
// Use this for initialization |
|
|
|
|
void Start() |
|
|
|
|
{ |
|
|
|
|
SettingPanel = GameObject.Find("MenuCanvas").transform.Find("SettingPanel"); |
|
|
|
|
BG = GameObject.Find("SightseeingPlant").transform.Find("TankCanvas/BG"); |
|
|
|
|
steam_VRcamera = GetComponentInChildren<SteamVR_Camera>(); |
|
|
|
|
cc = GetComponent<CharacterController>(); |
|
|
|
|
//m_capsule = transform.Find("Capsule").GetComponent<CapsuleCollider>(); |
|
|
|
@ -91,6 +95,10 @@ public class MoveController : MonoBehaviour
|
|
|
|
|
{ |
|
|
|
|
if (CanMove) |
|
|
|
|
{ |
|
|
|
|
if (BG.gameObject.activeInHierarchy||SettingPanel.gameObject.activeInHierarchy) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
cc.Move(GetMoveForward() * Time.deltaTime * MoveSpeed); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|