private void IOnPlaneCrash(TriggerCutScene scene) { var skipOpeningAnimation = typeof(TriggerCutScene).GetMethod("skipOpeningAnimation", BindingFlags.NonPublic | BindingFlags.Instance); var cleanUp = typeof(TriggerCutScene).GetMethod("CleanUp", BindingFlags.NonPublic | BindingFlags.Instance); try { var gameObject = GameObject.Find("PlayerPlanePosition"); if (gameObject) { LocalPlayer.CamFollowHead.planePos = gameObject.transform; } skipOpeningAnimation.Invoke(scene, null); cleanUp.Invoke(scene, null); } catch { // Ignored } scene.CancelInvoke("beginPlaneCrash"); scene.planeController.CancelInvoke("beginPlaneCrash"); scene.planeController.enabled = false; scene.planeController.gameObject.SetActive(false); scene.enabled = false; scene.gameObject.SetActive(false); //DisableClient(); }
private bool IOnPlaneCrash(TriggerCutScene scene) { var skipOpeningAnimation = typeof(TriggerCutScene).GetMethod("skipOpeningAnimation", BindingFlags.NonPublic | BindingFlags.Instance); var cleanUp = typeof(TriggerCutScene).GetMethod("CleanUp", BindingFlags.NonPublic | BindingFlags.Instance); try { var gameObject = GameObject.Find("PlayerPlanePosition"); if (gameObject) LocalPlayer.CamFollowHead.planePos = gameObject.transform; skipOpeningAnimation.Invoke(scene, null); cleanUp.Invoke(scene, null); } catch (Exception e) { /*Interface.Oxide.LogException("OnTriggerCutSceneAwake: ", e);*/ } scene.CancelInvoke("beginPlaneCrash"); scene.planeController.CancelInvoke("beginPlaneCrash"); scene.planeController.enabled = false; scene.planeController.gameObject.SetActive(false); scene.enabled = false; scene.gameObject.SetActive(false); var amplifyMotionEffectBases = Resources.FindObjectsOfTypeAll<AmplifyMotionEffectBase>(); foreach (var amplifyMotionEffectBase in amplifyMotionEffectBases) UnityEngine.Object.Destroy(amplifyMotionEffectBase); var imageEffectBases = Resources.FindObjectsOfTypeAll<ImageEffectBase>(); foreach (var imageEffectBase in imageEffectBases) UnityEngine.Object.Destroy(imageEffectBase); var imageEffectOptimizers = Resources.FindObjectsOfTypeAll<ImageEffectOptimizer>(); foreach (var imageEffectOptimizer in imageEffectOptimizers) UnityEngine.Object.Destroy(imageEffectOptimizer); var postEffectsBases = Resources.FindObjectsOfTypeAll<PostEffectsBase>(); foreach (var postEffectsBase in postEffectsBases) UnityEngine.Object.Destroy(postEffectsBase); var scionPostProcesses = Resources.FindObjectsOfTypeAll<ScionPostProcess>(); foreach (var scionPostProcess in scionPostProcesses) UnityEngine.Object.Destroy(scionPostProcess); var projectedGrids = Resources.FindObjectsOfTypeAll<ProjectedGrid>(); foreach (var projectedGrid in projectedGrids) UnityEngine.Object.Destroy(projectedGrid); var waveSpectra = Resources.FindObjectsOfTypeAll<WaveSpectrum>(); foreach (var waveSpectrum in waveSpectra) UnityEngine.Object.Destroy(waveSpectrum); var planarReflections = Resources.FindObjectsOfTypeAll<PlanarReflection>(); foreach (var planarReflection in planarReflections) UnityEngine.Object.Destroy(planarReflection); var underWaters = Resources.FindObjectsOfTypeAll<UnderWater>(); foreach (var underWater in underWaters) UnityEngine.Object.Destroy(underWater); var oceans = Resources.FindObjectsOfTypeAll<Ocean>(); foreach (var ocean in oceans) UnityEngine.Object.Destroy(ocean); var behaviours = Resources.FindObjectsOfTypeAll<MonoBehaviour>(); foreach (var behaviour in behaviours) { if (!behaviour.GetType().FullName.StartsWith("UI")) continue; behaviour.enabled = false; behaviour.gameObject.SetActive(false); } return false; }
private bool IOnPlaneCrash(TriggerCutScene scene) { var skipOpeningAnimation = typeof(TriggerCutScene).GetMethod("skipOpeningAnimation", BindingFlags.NonPublic | BindingFlags.Instance); var cleanUp = typeof(TriggerCutScene).GetMethod("CleanUp", BindingFlags.NonPublic | BindingFlags.Instance); try { var gameObject = GameObject.Find("PlayerPlanePosition"); if (gameObject) { LocalPlayer.CamFollowHead.planePos = gameObject.transform; } skipOpeningAnimation.Invoke(scene, null); cleanUp.Invoke(scene, null); } catch (Exception e) { /*Interface.Oxide.LogException("OnTriggerCutSceneAwake: ", e);*/ } scene.CancelInvoke("beginPlaneCrash"); scene.planeController.CancelInvoke("beginPlaneCrash"); scene.planeController.enabled = false; scene.planeController.gameObject.SetActive(false); scene.enabled = false; scene.gameObject.SetActive(false); var amplifyMotionEffectBases = Resources.FindObjectsOfTypeAll <AmplifyMotionEffectBase>(); foreach (var amplifyMotionEffectBase in amplifyMotionEffectBases) { UnityEngine.Object.Destroy(amplifyMotionEffectBase); } var imageEffectBases = Resources.FindObjectsOfTypeAll <ImageEffectBase>(); foreach (var imageEffectBase in imageEffectBases) { UnityEngine.Object.Destroy(imageEffectBase); } var imageEffectOptimizers = Resources.FindObjectsOfTypeAll <ImageEffectOptimizer>(); foreach (var imageEffectOptimizer in imageEffectOptimizers) { UnityEngine.Object.Destroy(imageEffectOptimizer); } var postEffectsBases = Resources.FindObjectsOfTypeAll <PostEffectsBase>(); foreach (var postEffectsBase in postEffectsBases) { UnityEngine.Object.Destroy(postEffectsBase); } var scionPostProcesses = Resources.FindObjectsOfTypeAll <ScionPostProcess>(); foreach (var scionPostProcess in scionPostProcesses) { UnityEngine.Object.Destroy(scionPostProcess); } var projectedGrids = Resources.FindObjectsOfTypeAll <ProjectedGrid>(); foreach (var projectedGrid in projectedGrids) { UnityEngine.Object.Destroy(projectedGrid); } var waveSpectra = Resources.FindObjectsOfTypeAll <WaveSpectrum>(); foreach (var waveSpectrum in waveSpectra) { UnityEngine.Object.Destroy(waveSpectrum); } var planarReflections = Resources.FindObjectsOfTypeAll <PlanarReflection>(); foreach (var planarReflection in planarReflections) { UnityEngine.Object.Destroy(planarReflection); } var underWaters = Resources.FindObjectsOfTypeAll <UnderWater>(); foreach (var underWater in underWaters) { UnityEngine.Object.Destroy(underWater); } var oceans = Resources.FindObjectsOfTypeAll <Ocean>(); foreach (var ocean in oceans) { UnityEngine.Object.Destroy(ocean); } var behaviours = Resources.FindObjectsOfTypeAll <MonoBehaviour>(); foreach (var behaviour in behaviours) { if (!behaviour.GetType().FullName.StartsWith("UI")) { continue; } behaviour.enabled = false; behaviour.gameObject.SetActive(false); } return(false); }
private bool IOnBeginPlaneCrash(TriggerCutScene triggerCutScene) { Interface.Oxide.LogInfo("Disable TriggerCutScene: {0} {1}", triggerCutScene.name, triggerCutScene.GetInstanceID()); var skipOpeningAnimationMethod = typeof (TriggerCutScene).GetMethod("skipOpeningAnimation", BindingFlags.NonPublic | BindingFlags.Instance); var CleanUpMethod = typeof (TriggerCutScene).GetMethod("CleanUp", BindingFlags.NonPublic | BindingFlags.Instance); try { var gameObject = GameObject.Find("PlayerPlanePosition"); if (gameObject) { LocalPlayer.CamFollowHead.planePos = gameObject.transform; } skipOpeningAnimationMethod.Invoke(triggerCutScene, null); CleanUpMethod.Invoke(triggerCutScene, null); } catch (Exception e) { Interface.Oxide.LogException("OnTriggerCutSceneAwake: ", e); } triggerCutScene.CancelInvoke("beginPlaneCrash"); triggerCutScene.planeController.CancelInvoke("beginPlaneCrash"); triggerCutScene.planeController.enabled = false; triggerCutScene.planeController.gameObject.SetActive(false); triggerCutScene.enabled = false; triggerCutScene.gameObject.SetActive(false); var amplifyMotionEffectBases = UnityEngine.Resources.FindObjectsOfTypeAll<AmplifyMotionEffectBase>(); foreach (var amplifyMotionEffectBase in amplifyMotionEffectBases) { Interface.Oxide.LogInfo("Disable AmplifyMotionEffectBase: {0} {1}", amplifyMotionEffectBase.name, amplifyMotionEffectBase.GetInstanceID()); UnityEngine.Object.Destroy(amplifyMotionEffectBase); } var imageEffectOptimizers = UnityEngine.Resources.FindObjectsOfTypeAll<ImageEffectOptimizer>(); foreach (var imageEffectOptimizer in imageEffectOptimizers) { Interface.Oxide.LogInfo("Disable ImageEffectOptimizer: {0} {1}", imageEffectOptimizer.name, imageEffectOptimizer.GetInstanceID()); UnityEngine.Object.Destroy(imageEffectOptimizer); } var scionPostProcesses = UnityEngine.Resources.FindObjectsOfTypeAll<ScionPostProcess>(); foreach (var scionPostProcess in scionPostProcesses) { Interface.Oxide.LogInfo("Disable ScionPostProcess: {0} {1}", scionPostProcess.name, scionPostProcess.GetInstanceID()); UnityEngine.Object.Destroy(scionPostProcess); } var behaviours = UnityEngine.Resources.FindObjectsOfTypeAll<MonoBehaviour>(); foreach (var behaviour in behaviours) { if (!behaviour.GetType().FullName.StartsWith("UI")) continue; Interface.Oxide.LogInfo("Disable {0}: {1} {2}", behaviour.GetType(), behaviour.name, behaviour.GetInstanceID()); behaviour.enabled = false; behaviour.gameObject.SetActive(false); //UnityEngine.Object.Destroy(behaviour); } DisableAudio(); return false; }