12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ShowTipTime : MonoBehaviour
- {
- public float TimeFloat = 10;
- // Start is called before the first frame update
- void Start()
- {
-
- }
- private void OnEnable()
- {
- t = 0;
- }
- private void OnDisable()
- {
- t = 0;
- TimeFloat = 10;
- }
- public float t;
- // Update is called once per frame
- void Update()
- {
- t = t + Time.deltaTime;
- if(t>TimeFloat)
- {
- this.gameObject.SetActive(false);
- }
- this.transform.position = OpenXRCamera.Instance.head.position;
- this.transform.eulerAngles = OpenXRCamera.Instance.head.eulerAngles;
- }
- }
|