Beispiel #1
0
 protected override void OnStartRunning()
 {
     Entities
     .WithName("AudioSystem_AudioClip_Collecting")
     .WithoutBurst()
     .ForEach((AudioClipPresetComponent presetComp) => { _audioClipPreset = presetComp.preset; })
     .Run();
 }
Beispiel #2
0
 /// <summary> Static method for stop play sound. </summary>
 public static void StopSound(AudioClipPreset clipPreset)
 {
     if (Instance == null)
     {
         Debug.LogError("SoundController not initialized");
         return;
     }
     if (clipPreset != null)
     {
         Instance.StopSound(clipPreset.Clip);
     }
 }
Beispiel #3
0
 /// <summary> Static method for start play sound with custom volume. </summary>
 public static void PlaySound(AudioClipPreset clipPreset, float multiPlierVolume)
 {
     if (Instance == null)
     {
         Debug.LogError("SoundController not initialized");
         return;
     }
     if (clipPreset != null)
     {
         Instance.PlaySound(clipPreset.Clip, clipPreset.Volume * multiPlierVolume, clipPreset.Priority);
     }
 }
Beispiel #4
0
    protected override void OnStartRunning()
    {
        if (Camera.main != null)
        {
            _cameraTransform = Camera.main.transform;
        }

        Entities
        .WithName("BGMVolumeSystem_AudioClip_Collecting")
        .WithoutBurst()
        .ForEach((in AudioClipPresetComponent presetComp) => {
            _audioClipPreset = presetComp.preset;
        })
Beispiel #5
0
 public AudioClipPresetComponent(AudioClipPreset inPreset)
 {
     preset = inPreset;
 }