protected override TsAudio _GetAudioEx()
 {
     if (this._audioEx == null)
     {
         this._audioEx = new TsAudioAmbient(EAudioType.AMBIENT);
     }
     return(this._audioEx);
 }
 public override bool _InitAudioEx(TsAudio audioEx)
 {
     if (audioEx == null || audioEx.baseData.AudioType != EAudioType.AMBIENT)
     {
         return(false);
     }
     this._audioEx = (TsAudioAmbient)audioEx;
     return(true);
 }
Exemplo n.º 3
0
    public static TsAudio Create(TsAudio.BaseData baseData)
    {
        if (baseData == null)
        {
            TsLog.LogError("TsAudioCreator.Create() baseData == null   !!!!!", new object[0]);
            return(null);
        }
        TsAudio tsAudio;

        switch (baseData.AudioType)
        {
        case EAudioType.SFX:
            tsAudio = new TsAudioSFX(baseData.AudioType);
            break;

        case EAudioType.BGM:
            tsAudio = new TsAudioBGM(baseData.AudioType);
            break;

        case EAudioType.AMBIENT:
            tsAudio = new TsAudioAmbient(baseData.AudioType);
            break;

        case EAudioType.UI:
            tsAudio = new TsAudioUI(baseData.AudioType);
            break;

        case EAudioType.VOICE:
            tsAudio = new TsAudioVoice(baseData.AudioType);
            break;

        case EAudioType.SYSTEM:
            tsAudio = new TsAudioSystem(baseData.AudioType);
            break;

        case EAudioType.GAME_DRAMA:
            tsAudio = new TsAudioGameDrama(baseData.AudioType);
            break;

        case EAudioType.ENVIRONMENT:
            tsAudio = new TsAudioEnvironment(baseData.AudioType);
            break;

        default:
            TsLog.Log("Check the EAudioType~! is Invalid Value~! EAudioType= " + baseData.AudioType, new object[0]);
            return(null);
        }
        tsAudio._InitBaseData(baseData);
        return(tsAudio);
    }