12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TestP6Car : MonoBehaviour
- {
- /// <summary>
- /// 擎天柱
- /// </summary>
- 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);
- }
- }
|