static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { // Make sure we empty all our static references every time the new scene is loaded. AnimatedProps = null; CheckpointService = null; NullCheckpointService = null; CoinCointer = null; NullCoinCounter = null; VoiceoverService = null; NullVoiceoverService = null; AllLocations = null; LoadTruck = null; ControllerService = null; UnloadTruck = null; QuaryUpgradable = null; DisplayController = null; }
public static void AnimateProps() { if (AnimatedProps == null) { AnimatedProps = GameObject.FindObjectOfType <AnimatePropsService>(); } #if UNITY_EDITOR if (!HideWarnings && AnimatedProps == null) { Debug.LogError("No '" + nameof(AnimatePropsService) + "' component present in the scene!"); } #endif if (AnimatedProps != null) { AnimatedProps.AnimateProps(); } }