/**************************** summary: ****************************/ using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerTrigger : MonoBehaviour { public GameObject SZG; public GameObject SJD; private Transform head = null; void LateUpdate() { if(head ==null) { if (API_GSXR_Slam.GSXR_Is_SlamRunning() && API_GSXR_Slam.GSXR_Get_Head() != null) head = API_GSXR_Slam.GSXR_Get_Head(); } if(head!=null) { transform.position = new Vector3(head.position.x, 0, head.position.z); } } private void OnTriggerEnter(Collider other) { if(other.name == "SZGBox") { SZG.SetActive(true); SJD.SetActive(false); } } private void OnTriggerExit(Collider other) { if(other.name == "SZGBox") { SZG.SetActive(false); SJD.SetActive(true); } } }