Beispiel #1
0
    public static SoundConfigTable GetConfig(string p_configName)
    {
        SoundConfigTable _config = null;

        if (!configDict.TryGetValue(p_configName, out _config))
        {
            string _path = "SoundTable/" + p_configName;
            _config = Resources.Load <SoundConfigTable>(_path);
            if (_config != null)
            {
                Debug.Log("Load Sound Config [" + _config.name + "]");
                _config.tableList.Clear();
                configDict.Add(p_configName, _config);
            }
            else
            {
                Debug.LogError("No Sound Config : [Resources/" + _path + "]");
            }
        }

        return(_config);
    }
Beispiel #2
0
    public static void SetVolumeByConfigName(string p_configName, float p_volume)
    {
        SoundConfigTable _config = GetConfig(p_configName);

        _config.adjustVolume = p_volume;
    }
Beispiel #3
0
    public static void SetMuteByConfigName(string p_configName, bool p_mute)
    {
        SoundConfigTable _config = GetConfig(p_configName);

        _config.mute = p_mute;
    }