using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestP6Car : MonoBehaviour { /// /// 擎天柱 /// public GameObject TestObj; public GameObject p6Obj; public Transform p6Man; public GameObject p6Point; [HideInInspector] public bool state; public float interval; float times; private void Update() { if(state) { times += Time.deltaTime; if(times>interval) { times = 0; state = false; if (p6Point.activeSelf) return; p6Obj.SetActive(false); TestObj.SetActive(true); TestObj.transform.position = p6Obj.transform.position; TestObj.transform.eulerAngles = p6Man.transform.eulerAngles; } } } public void CloseTestObj() { TestObj.SetActive(false); } }