Example #1
0
        public void Start()
        {
            var audioObject = GameObject.FindGameObjectWithTag(Tag.Audio);

            _audioControl = audioObject.GetComponent <AudioControl>();
            GetComponent <Button>().onClick.AddListener(() => { _audioControl.PlayAudioClip(AudioType); });
        }
Example #2
0
        private void Awake()
        {
            var audioObject = GameObject.FindGameObjectWithTag(Tag.Audio);

            _audioControl = audioObject.GetComponent <AudioControl>();
            if (PlayOnAwake)
            {
                _audioControl.PlayAudioClip(AudioType);
            }
        }