private AudioLayer InitRuntimeLayer() { AudioLayer layer = CreateLayer("Runtime Layer " + RuntimeLayers.Count); RuntimeLayers.Add(layer); return(layer); }
private AudioLayer InitInbuiltLayer(AudioLayerType _layerType) { AudioLayer layer = CreateLayer(_layerType.ToString()); InbuiltLayers.Add(layer); return(layer); }
/// <summary> /// TODO: We shouldn't do this kind of hard coded init. /// </summary> private void Init() { ReadAllAudioList(); // Bgm InitInbuiltLayer(AudioLayerType.Bgm); // Dialogue InitInbuiltLayer(AudioLayerType.Dialogue); // Undefined m_tempLayer = InitInbuiltLayer(AudioLayerType.Undefined); }
private AudioLayer CreateLayer(string _layerName = "") { //string layerName = _layerName != "" ? _layerName : "Runtime Layer " + RuntimeLayers.Count; GameObject layerObj = new GameObject(_layerName); layerObj.transform.SetParent(transform); AudioLayer layer = layerObj.AddComponent <AudioLayer>(); layer.Init(); //if (_layerName == "") // RuntimeLayers.Add(layer); return(layer); }
public void Init(AudioLayer _layer) { m_mainSource = gameObject.AddComponent <AudioSource>(); m_secondSource = gameObject.AddComponent <AudioSource>(); m_layer = _layer; }