Пример #1
0
        public static int UISoundTypeToIndex(this UISoundType UIsoundType)
        {
            switch (UIsoundType)
            {
            default:
                return(0);

            case UISoundType.ButtonNext:
                return(1);

            case UISoundType.ButtonBack:
                return(2);

            case UISoundType.ButtonError:
                return(3);

            case UISoundType.Access:
                return(4);

            case UISoundType.Success:
                return(5);

            case UISoundType.Switch:
                return(6);

            case UISoundType.SoundCheck:
                return(7);

            case UISoundType.Click:
                return(8);

            case UISoundType.Interrupt:
                return(9);
            }
        }
Пример #2
0
    public static void PlayUISound(UISoundType type)
    {
        AudioClip audioClip = null;

        switch (type)
        {
        case UISoundType.StartGame:
            audioClip = Main.StartSE;
            break;

        case UISoundType.Select:
            audioClip = Main.SelectSE;
            break;

        case UISoundType.Press:
            audioClip = Main.PressSE;
            break;

        case UISoundType.Cancel:
            audioClip = Main.CancelSE;
            break;
        }
        if (IsAudioClipNull(audioClip))
        {
            return;
        }
        Main.UI_SE_Source.clip = audioClip;
        Main.UI_SE_Source.Play();
    }
Пример #3
0
    private String GetTypeSound(UISoundType type)
    {
        switch (type)
        {
        case UISoundType.UIAdd:
            return("snd_ui_add");

        case UISoundType.UIBuy:
            return("snd_ui_buy");

        case UISoundType.UIHit:
            return("snd_ui_hit");

        case UISoundType.UIError:
            return("snd_ui_error");

        case UISoundType.UIOpenBag:
            return("snd_ui_openbag");

        case UISoundType.UIOpen:
            return("snd_ui_open");

        case UISoundType.UIColse:
            return("snd_ui_close");

        case UISoundType.UIYes:
            return("snd_ui_yes");

        case UISoundType.UINo:
            return("snd_ui_no");
        }
        return("");
    }
Пример #4
0
    public override void OnInspectorGUI()
    {
        if (_player == null)
        {
            _player = target as UISoundFXPlayer;
        }
        UISoundType type = (UISoundType)EditorGUILayout.EnumPopup("Clipping", _player.SoundType);

        if (_player.SoundType != type)
        {
            _player.SoundType = type;
        }

        String name = EditorGUILayout.TextField("SoundName", _player.SoundName);

        if (_player.SoundName != name)
        {
            _player.SoundName = name;
        }
    }
Пример #5
0
 void PlayInternal(UISoundType type)
 {
     _ui.pitch = Random.Range(.75f, 1.25f);
     _ui.clip  = _clips[(int)type].Random();
     _ui.Play();
 }
Пример #6
0
 public static void Play(UISoundType type)
 {
     instance.PlayInternal(type);
 }
Пример #7
0
 public UISoundForSO(UISoundType _soundEffectType)
 {
     uISoundType = _soundEffectType;
 }