1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ShowTipTime : MonoBehaviour
- {
- public static ShowTipTime Instance;
- public float TimeFloat = 10;
- // Start is called before the first frame update
- void Awake()
- {
- Instance = this;
- }
- 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;
- }
- }
|