예제 #1
0
 public void Remove()
 {
     UpdateSetting();
     AudioTextLoader.RemoveDescription(GameObject.Find("DescriptionsMenu(Clone)")
                                       .GetComponent <SoundDescriptionsMenu>().Clip.Name, _desc);
     Destroy(gameObject);
 }
예제 #2
0
 public void Select()
 {
     AudioTextLoader.SetSelectedDescription(
         GameObject.Find("DescriptionsMenu(Clone)").GetComponent <SoundDescriptionsMenu>().Clip.Name,
         transform.Find("DescriptionField").GetComponent <InputField>().text);
     UpdateSetting();
 }
예제 #3
0
 // 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;
 }
예제 #4
0
    // 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;
        }
    }
예제 #5
0
    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);
    }
예제 #6
0
 private void UpdateUi()
 {
     transform.Find("Name").GetComponent <Text>().text    = Clip.Name;
     transform.Find("Current").GetComponent <Text>().text = AudioTextLoader.GetSelectedDescription(Clip.Name);
 }
예제 #7
0
 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;
 }