1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RtkTrigger : MonoBehaviour
- {
- public List<GameObject> list_Obj;
- public List<GameObject> list_Box;
- public List<GameObject> list_Point;
- public bool finish;
- private void Start()
- {
-
- }
- private void Update()
- {
- if (API_SVR.GetHead() != null)
- if (transform.position != API_SVR.GetHead().position)
- {
- transform.position = API_SVR.GetHead().position;
- }
- }
-
- private void OnTriggerEnter(Collider other)
- {
- QueryBox(other, true);
- }
- private void OnTriggerExit(Collider other)
- {
- QueryBox(other, false);
- }
-
-
-
-
-
- private void QueryBox(Collider other, bool state)
- {
- Debug.Log(other.name);
- for (int i = 0; i < list_Box.Count; i++)
- {
- if (other.name == list_Box[i].name)
- {
- SetShowObject(list_Point[i], list_Obj[i], state);
- break;
- }
- }
- }
-
-
-
- private void SetShowObject(GameObject Obj, GameObject Effect, bool state)
- {
- finish = state;
- Effect.SetActive(state);
- Obj.SetActive(!state);
- }
- }
|