コード例 #1
0
    // サウンドを鳴らす
    AudioChannelData playSound(AUDIO_TYPE _eAudioType, string _strName, bool _bLoop = false)
    {
        _strName = _strName.ToLower();

        bool             bHit = false;
        AudioChannelData data = new AudioChannelData();

        bHit = getEnableChannnel(_eAudioType, ref data);

        if (bHit == true)
        {
            data.m_strFilename = _strName;
            data.m_bLoop       = _bLoop;
            data.m_eStatus     = AudioChannelData.STATUS.REQUEST;
        }
        else
        {
            Debug.LogError("no hit");
            return(data);
        }

        AudioClipData audioClipData = new AudioClipData();

        if (false == IsAudioClipData(_strName, _eAudioType, ref audioClipData))
        {
            //Debug.LogError ( "audio_type=" +_eAudioType + " " + "playSound:" + _strName);
            return(m_csSoundPlayerSupport.PlaySound(data));
        }

        //Debug.Log ("audio_type:" + _eAudioType + " playSound:" + data.m_strFilename);

        data.Play(audioClipData);
        return(data);
    }
コード例 #2
0
    public void PlaySound(AudioChannelData _channnel)
    {
        AudioClipData audioClipData = new AudioClipData();

        //AudioClipData audioClipData;
        if (false == IsAudioClipData(_channnel.m_strFilename, _channnel.m_eAudioType, ref audioClipData))
        {
            return;
        }
        //Debug.Log ("PlaySound:" + _channnel.m_strFilename);
        _channnel.Play(audioClipData);

        return;
    }