1118OPSSNew/Assets/Zion/Scripts/GameScene/Processes/InstalZhuangJieTou.cs

26 lines
944 B
C#

using Microsoft.MixedReality.Toolkit.UI;
using Microsoft.MixedReality.Toolkit.UI.BoundsControl;
using UnityEngine;
/// <summary>
/// 安装转接头
/// </summary>
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<ManipulationHandler>().enabled = false;
other.GetComponent<BoxCollider>().enabled = false;
other.transform.localPosition = new Vector3(0, 0, 0);
other.transform.localEulerAngles = Vector3.zero;
other.GetComponentInChildren<BoundsControl>().Active = true;
}
}
}
}