public override void Init() { if (_hasInit) { return; } base.Init(); _spectrumAnalyzer = GameObject.Find(Constants.AbjectAudioInputs).GetComponent <SpectrumAnalyzer>(); _audioLevelTracker = GameObject.Find(Constants.AbjectAudioInputs).GetComponent <AudioLevelTracker>(); _mainIcon = GameObject.Find("MainIcon").GetComponent <SpriteRenderer>(); _singleTapSpawn = GameObject.Find("SingleTapSpawn").transform; _customTapSpawn = GameObject.Find("CustomTapSpawn").transform; _heldSpawn = GameObject.Find("HeldSpawn").transform; _timeHeldSpawn = GameObject.Find("TimeHeldSpawn").transform; //PlayerPrefs _lastSavedDeviceName = PlayerPrefHelper.GetLastSavedDeviceDefault(); _currentChannel = PlayerPrefHelper.GetCurrentChannel(); HzOffset = PlayerPrefHelper.GetHzOffset(); RequiredFrames = PlayerPrefHelper.GetRequiredFrames(); PeaksPriority = PlayerPrefHelper.GetPeaksPriority(); HeldReset = PlayerPrefHelper.GetHeldReset(); SingleTapReset = PlayerPrefHelper.GetSingleTapReset(); _levelDynamicRange = PlayerPrefHelper.GetLevelDynamicRange(); _levelGain = PlayerPrefHelper.GetLevelGain(); _spectrumDynamicRange = PlayerPrefHelper.GetSpectrumDynamicRange(); _spectrumGain = PlayerPrefHelper.GetSpectrumGain(); SpectrumThreshold = PlayerPrefHelper.GetSpectrumThreshold(); //FieldsData _idData = Helper.GetFieldData("Id"); _channelData = Helper.GetFieldData("Channel"); _hzOffsetData = Helper.GetFieldData("HzOffset"); _requiredFramesData = Helper.GetFieldData("RequiredFrames"); _peaksPriorityData = Helper.GetFieldData("PeaksPriority"); _heldResetData = Helper.GetFieldData("HeldReset"); _singleTapResetData = Helper.GetFieldData("TapReset"); _levelDynamicRangeData = Helper.GetFieldData("LevelDynamicRange"); _levelGainData = Helper.GetFieldData("LevelGain"); _spectrumDynamicRangeData = Helper.GetFieldData("SpectrumDynamicRange"); _spectrumGainData = Helper.GetFieldData("SpectrumGain"); _spectrumThresholdData = Helper.GetFieldData("SpectrumThreshold"); Devices = AudioSystem.InputDevices; _hasInit = true; }