ProgressVolume.cs 495 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ProgressVolume : ProgressEdit
  5. {
  6. public TextMesh text;
  7. public AudioSource audio;
  8. public override void Start()
  9. {
  10. base.Start();
  11. setValue(audio.volume);
  12. }
  13. public override void setValue(float f)
  14. {
  15. audio.volume = f;
  16. string aa = (f * 100).ToString("F0");
  17. text.text = "音量大小:" + aa;
  18. base.setValue(f);
  19. }
  20. }