SteamVR_StatusText.cs 612 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using UnityEngine;
  3. [RequireComponent(typeof(GUIText))]
  4. public class SteamVR_StatusText : SteamVR_Status
  5. {
  6. private void Awake()
  7. {
  8. this.text = base.GetComponent<GUIText>();
  9. if (this.mode == SteamVR_Status.Mode.WhileTrue || this.mode == SteamVR_Status.Mode.WhileFalse)
  10. {
  11. this.timer = this.fade * this.text.color.a;
  12. }
  13. }
  14. protected override void SetAlpha(float a)
  15. {
  16. if (a > 0f)
  17. {
  18. this.text.enabled = true;
  19. this.text.color = new Color(this.text.color.r, this.text.color.g, this.text.color.b, a);
  20. }
  21. else
  22. {
  23. this.text.enabled = false;
  24. }
  25. }
  26. private GUIText text;
  27. }