Beispiel #1
0
        public virtual void PostConstruct(params object[] args)
        {
            var resourceLoader = new ResourcesLoader <TData>(DataPath);

            if (!resourceLoader.TryLoadData(out _data))
            {
                Debug.LogException(new Exception($"[{GetType()}] failed to load data."));
            }
        }
        private void LoadAudioResources()
        {
            var resourceLoader = new ResourcesLoader <AudioClip>(GameConstants.DataPaths.Resources.Audio);

            if (!resourceLoader.TryLoadData(out var resources))
            {
                Debug.LogException(new Exception($"[{nameof(AudioServiceController)}] failed to load data."));
            }

            foreach (var audioClip in resources)
            {
                if (Enum.TryParse <Priority>(audioClip.name, out var priority))
                {
                    _audioClips.Add(priority, audioClip);
                }
            }
        }