please organize the script make it a lot more professional and return the entire script…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
please organize the script make it a lot more professional and return the entire script back ty.
using System.Threading; using TMPro; using UnityEngine; using UnityEngine.UI;
public class UI_Helper : MonoBehaviour { public ACEStepRuntimeInference stepRuntimeInference; public TMP_InputField Prompt_Input; public TMP_InputField Lyric_Input; bool CanRun = false; public WaveformPlayer waveformPlayer; public GameObject Loading; public GameObject Wave; public TextMeshProUGUI SliderTextStep; public Slider SliderStep; public TextMeshProUGUI SliderTextLength; public Slider SliderLength;
codepublic void Setup() { stepRuntimeInference.lyrics = Lyric_Input.text; stepRuntimeInference.prompt = Prompt_Input.text; } public void ChangeSliderValueStep() { SliderTextStep.text = "<color=#FFFFFF>Diffusion Steps:</color> <color=#8645FF>" + SliderStep.value.ToString() + "</color>"; stepRuntimeInference.infer_step = (int)SliderStep.value; } public void ChangeSliderValueLength() { SliderTextLength.text = "<color=#FFFFFF>Generation Length:</color> <color=#8645FF>" + SliderLength.value.ToString() + "</color>"; if(SliderLength.value == -1) { SliderTextLength.text = "<color=#FFFFFF>Generation Length:</color> <color=#8645FF>" + SliderLength.value.ToString() + "</color> <color=#FFFFFF>( RANDOM LENGTH )</color>"; } stepRuntimeInference.audio_duration = (int)SliderLength.value; } public void Start() { ChangeSliderValueStep(); ChangeSliderValueLength(); } public void GenerateButton() { stepRuntimeInference.StartGenerate(); } public void Update() { Setup(); if (stepRuntimeInference.IsGenerating) { // Do something while the song is generating. CanRun = true; } if (CanRun) { if(!stepRuntimeInference.IsGenerating) { if(stepRuntimeInference.GenerationResult != null) { waveformPlayer.LoadWavFile(stepRuntimeInference.output_path); CanRun = false; Loading.SetActive(false); Wave.SetActive(true); } } } } - Assistant