public static void TempChangeToPlatform(int index) { Plugin.Log(); Plugin.Log(index); if (kyleBuffer != null) { errBuffer = index; throw new StackedRequestsException(); } else { kyleBuffer = index; } try { if (!GetCurrentEnvironment().name.StartsWith("Menu") && platformSpawned) { DestroyCustomLights(); InternalTempChangeToPlatform(); PlatformLoader.AddManagers(); SpawnCustomLights(); Instance.StartCoroutine(ReplaceAllMaterialsAfterOneFrame()); EnvironmentArranger.RearrangeEnvironment(); } } catch (EnvironmentSceneNotFoundException e) { IPA.Logging.Logger.Level L = IPA.Logging.Logger.Level.Warning; Plugin.Log("TempChangeToPlatform was called out of place. Please send me a bug report.", L); Plugin.Log(e, L); } }
void TransitionFinalize(ScenesTransitionSetupDataSO ignored1, DiContainer ignored2) { try { if (!GetCurrentEnvironment().name.StartsWith("Menu")) { try { FindManager(); if (!Resources.FindObjectsOfTypeAll <PlayerDataModel>()[0].playerData.overrideEnvironmentSettings.overrideEnvironments) { InternalTempChangeToPlatform(); PlatformLoader.AddManagers(); SpawnCustomLights(); Instance.StartCoroutine(ReplaceAllMaterialsAfterOneFrame()); EnvironmentArranger.RearrangeEnvironment(); TubeLightManager.CreateAdditionalLightSwitchControllers(); } } catch (ManagerNotFoundException e) { Plugin.Log(e); } } else { Heart.SetActive(showHeart); Heart.GetComponent <LightWithId>().ColorWasSet(Color.magenta); } } catch (EnvironmentSceneNotFoundException e) { Plugin.Log(e); } }