1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /****************************
- 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);
- }
- }
- }
|