using Microsoft.MixedReality.Toolkit.UI; using Microsoft.MixedReality.Toolkit.UI.BoundsControl; using UnityEngine; /// /// 安装转接头 /// public class InstalZhuangJieTou : Device { private void OnTriggerStay(Collider other) { if (other.name.Equals("转接头")) { //other.transform.localPosition = new Vector3(other.transform.localPosition.x, 0, 0); other.transform.localEulerAngles = Vector3.zero; if (Mathf.Abs(other.transform.localPosition.x) < 0.03f) { other.GetComponent().enabled = false; other.GetComponent().enabled = false; other.transform.localPosition = new Vector3(0, 0, 0); other.transform.localEulerAngles = Vector3.zero; other.GetComponentInChildren().Active = true; } } } }