Exemple #1
0
    public float GetLength(int resId)
    {
        sound_info info = GameDataMgr.soundInfoDatabin.GetDataByKey(resId);

        if (info == null)
        {
            Debug.Log("声音配置表里没有配置: " + resId);
            return(0);
        }
        return(GetLength(SoundType.SE_MAIN, info.name));
    }
Exemple #2
0
 public void SceneSoundData(sound_info soundInfoData)
 {
     if (soundInfoData == null)
     {
         return;
     }
     if (soundInfoData.affiliation_scene == 2 || soundInfoData.affiliation_scene == 0)
     {
         string path = soundInfoData.path + "/" + soundInfoData.name;
         if (!m_soundInfos.Contains(path))
         {
             m_soundInfos.Add(path);
         }
     }
     m_resCount++;
 }
Exemple #3
0
    public bool PlaySE(int resId)
    {
        if (!IsPlaySE)
        {
            return(false);
        }

        sound_info info = GameDataMgr.soundInfoDatabin.GetDataByKey(resId);

        if (info == null)
        {
            Debug.Log("声音配置表里没有配置: " + resId);
            return(false);
        }

        return(Play(info.name, SoundType.SE_MAIN));
    }