public void Remove() { UpdateSetting(); AudioTextLoader.RemoveDescription(GameObject.Find("DescriptionsMenu(Clone)") .GetComponent <SoundDescriptionsMenu>().Clip.Name, _desc); Destroy(gameObject); }
public void Select() { AudioTextLoader.SetSelectedDescription( GameObject.Find("DescriptionsMenu(Clone)").GetComponent <SoundDescriptionsMenu>().Clip.Name, transform.Find("DescriptionField").GetComponent <InputField>().text); UpdateSetting(); }
// 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; }
// Use this for initialization private void Start() { transform.Find("SoundName").GetComponent <Text>().text = Clip.Name; var descriptions = AudioTextLoader.GetDescriptions(Clip.Name); var items = GameObject.Find("ScrollView").transform.Find("Viewport").transform.Find("Content"); foreach (var description in descriptions) { var instance = Instantiate(MenuItemPrefab, items.transform); instance.transform.Find("DescriptionField").GetComponent <InputField>().text = description; } }
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); }
public void UpdateSetting() { AudioTextLoader.ChangeDescription(GameObject.Find("DescriptionsMenu(Clone)") .GetComponent <SoundDescriptionsMenu>().Clip.Name, _desc, transform.Find("DescriptionField").GetComponent <InputField>().text); _desc = transform.Find("DescriptionField").GetComponent <InputField>().text; }