Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

41 lignes
711 B

  1. using System;
  2. using System.Collections;
  3. using SUISS.Core;
  4. using UnityEngine;
  5. public abstract class CIGSoundOnEvent : MonoBehaviour
  6. {
  7. protected virtual void Start()
  8. {
  9. }
  10. protected virtual void Awake()
  11. {
  12. }
  13. protected virtual void OnDestroy()
  14. {
  15. }
  16. protected void PlaySound()
  17. {
  18. base.StartCoroutine(this.PlaySoundCoroutine());
  19. }
  20. private IEnumerator PlaySoundCoroutine()
  21. {
  22. yield return new WaitForSeconds(this.delay);
  23. SingletonMonobehaviour<CIGAudioManager>.Instance.PlayClip(this.sound, this.volume);
  24. yield break;
  25. }
  26. [SerializeField]
  27. private AudioClip sound;
  28. [SerializeField]
  29. private float volume = 1f;
  30. [SerializeField]
  31. private float delay;
  32. }