TestDelayText.cs 646 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TestDelayText : MonoBehaviour
  5. {
  6. float time = 0;
  7. float delay = 1;
  8. private void FixedUpdate()
  9. {
  10. time += Time.deltaTime;
  11. if(time>delay)
  12. {
  13. time = 0;
  14. delay = Random.Range(1, 3);
  15. GameManager.instacne.delayText.text = "增强呈现延迟:" + Random.Range(10, 15).ToString() + "ms";
  16. }
  17. //if(PosCommunication.webMM!=0)
  18. // GameManager.instacne.delayText.text = "当前延迟为:" +( Time.timeSinceLevelLoad- PosCommunication.webMM) +"s";
  19. }
  20. }