SFXPlayer.cs 472 B

1234567891011121314151617181920212223
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. namespace KairoEngine.SFX
  6. {
  7. public class SFXPlayer : MonoBehaviour
  8. {
  9. public SFXClip sfxClip;
  10. public bool playOnStart = true;
  11. void Start()
  12. {
  13. if(playOnStart) Play();
  14. }
  15. public void Play()
  16. {
  17. SoundController.EmmitSound(sfxClip, this.transform.position);
  18. }
  19. }
  20. }