示例#1
0
        void Start()
        {
            AudioTimeSync = Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().FirstOrDefault();
            AudioTimeSync.forcedAudioSync = true;

            _songAudio = AudioTimeSync.GetField <AudioSource>("_audioSource");

            UpdateTimeScale(_songAudio.pitch);

            //if (mode.specialOptions.timeFluxOptions.Enabled) StartCoroutine(TimeFluxRoutine(mode.specialOptions.timeFluxOptions.fluxSpeed, mode.specialOptions.timeFluxOptions.minTime, mode.specialOptions.timeFluxOptions.maxTime));
        }
        private void Start()
        {
            AudioTimeSync = Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().FirstOrDefault();
            //var ncsem = Resources.FindObjectsOfTypeAll<NoteCutSoundEffectManager>().FirstOrDefault();
            //var ncse = Resources.FindObjectsOfTypeAll<NoteCutSoundEffect>().FirstOrDefault();

            if (AudioTimeSync != null)
            {
                AudioTimeSync.forcedNoAudioSync = true;
                _songAudio = AudioTimeSync.GetField <AudioSource>("_audioSource");
            }
            _gamePauseManager = Resources.FindObjectsOfTypeAll <GamePause>().FirstOrDefault();
        }
        public static IEnumerator FetchObjects()
        {
            yield return(new WaitForSeconds(0.1f));

            soundEffectManager   = Resources.FindObjectsOfTypeAll <NoteCutSoundEffectManager>().LastOrDefault();
            beatmapObjectManager = Resources.FindObjectsOfTypeAll <BeatmapObjectExecutionRatingsRecorder>().LastOrDefault().GetPrivateField <BeatmapObjectManager>("_beatmapObjectManager") as BasicBeatmapObjectManager;
            spawnController      = Resources.FindObjectsOfTypeAll <BeatmapObjectSpawnController>().LastOrDefault();
            energyCounter        = Resources.FindObjectsOfTypeAll <GameEnergyCounter>().LastOrDefault();
            ColorManager         = Resources.FindObjectsOfTypeAll <ColorManager>().LastOrDefault();
            pauseManager         = Resources.FindObjectsOfTypeAll <StandardLevelGameplayManager>().LastOrDefault();
            AudioTimeSync        = Resources.FindObjectsOfTypeAll <AudioTimeSyncController>().LastOrDefault();
            if (AudioTimeSync != null)
            {
                songAudio = AudioTimeSync.GetField <AudioSource>("_audioSource");
                if (songAudio == null)
                {
                    Plugin.Log("Audio null");
                }
            }
            Mixer = soundEffectManager.GetField <AudioManagerSO>("_audioManager");
            GameModifiersController.SetupSpawnCallbacks();
        }