Пример #1
0
    public void PlaySound(BlockSoundLibrary.BlockSound blockSound, Vector3?position = null)
    {
        _audioSource.Stop();

        var sound = BlockSoundLibrary.Get().GetSound(blockSound);

        if (position != null)
        {
            AudioSource.PlayClipAtPoint(sound, position.Value, .02f * GameManager.MasterVolume);
        }
        else
        {
            _audioSource.PlayOneShot(sound, .02f * GameManager.MasterVolume);
        }
    }
Пример #2
0
 void Awake()
 {
     _instance = this;
 }