// Update is called once per frame private void Update() { transform.Find("SelectButton").GetComponent <Button>().interactable = AudioTextLoader.GetSelectedDescription(GameObject.Find("DescriptionsMenu(Clone)") .GetComponent <SoundDescriptionsMenu>().Clip.Name) != transform.Find("DescriptionField").GetComponent <InputField>().text; }
private void PlayClip(NamedAudioClip clip, Vector3 position, float minVolume, float maxVolume, float minPitch, float maxPitch) { transform.position = position; _source.clip = clip.Clip; _source.volume = Random.Range(minVolume, maxVolume); _source.pitch = Random.Range(minPitch, maxPitch); _started = true; _source.Play(); ShowText(AudioTextLoader.GetSelectedDescription(clip.Name), position, clip.Clip.length); }
private void UpdateUi() { transform.Find("Name").GetComponent <Text>().text = Clip.Name; transform.Find("Current").GetComponent <Text>().text = AudioTextLoader.GetSelectedDescription(Clip.Name); }