Decompiled source of ModmasMap 2023 v1.1.0
Modmas2023DigitalMap.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using HarmonyLib; using LuxWater; using OtherLoader; using Sodalite.Api; using Sodalite.Utilities; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Profiling; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace LuxWater.Demo { public class LuxWater_ExtendedFlycam : MonoBehaviour { public float cameraSensitivity = 90f; public float climbSpeed = 4f; public float normalMoveSpeed = 10f; public float slowMoveFactor = 0.25f; public float fastMoveFactor = 3f; private float rotationX = 0f; private float rotationY = 0f; private bool isOrtho = false; private Camera cam; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) rotationX = ((Component)this).transform.eulerAngles.y; cam = ((Component)this).GetComponent<Camera>(); if ((Object)(object)cam != (Object)null) { isOrtho = cam.orthographic; } } private void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; rotationX += Input.GetAxis("Mouse X") * cameraSensitivity * deltaTime; rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity * deltaTime; rotationY = Mathf.Clamp(rotationY, -90f, 90f); Quaternion val = Quaternion.AngleAxis(rotationX, Vector3.up); val *= Quaternion.AngleAxis(rotationY, Vector3.left); ((Component)this).transform.localRotation = Quaternion.Slerp(((Component)this).transform.localRotation, val, deltaTime * 6f); if (Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303)) { Transform transform = ((Component)this).transform; transform.position += ((Component)this).transform.forward * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Vertical") * deltaTime; Transform transform2 = ((Component)this).transform; transform2.position += ((Component)this).transform.right * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("Horizontal") * deltaTime; } else if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305)) { Transform transform3 = ((Component)this).transform; transform3.position += ((Component)this).transform.forward * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Vertical") * deltaTime; Transform transform4 = ((Component)this).transform; transform4.position += ((Component)this).transform.right * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("Horizontal") * deltaTime; } else { if (isOrtho) { Camera obj = cam; obj.orthographicSize *= 1f - Input.GetAxis("Vertical") * deltaTime; } else { Transform transform5 = ((Component)this).transform; transform5.position += ((Component)this).transform.forward * normalMoveSpeed * Input.GetAxis("Vertical") * deltaTime; } Transform transform6 = ((Component)this).transform; transform6.position += ((Component)this).transform.right * normalMoveSpeed * Input.GetAxis("Horizontal") * deltaTime; } if (Input.GetKey((KeyCode)113)) { Transform transform7 = ((Component)this).transform; transform7.position -= ((Component)this).transform.up * climbSpeed * deltaTime; } if (Input.GetKey((KeyCode)101)) { Transform transform8 = ((Component)this).transform; transform8.position += ((Component)this).transform.up * climbSpeed * deltaTime; } } } } public class LuxWater_SetToGerstnerHeight : MonoBehaviour { public Material WaterMaterial; public Vector3 Damping = new Vector3(0.3f, 1f, 0.3f); public float TimeOffset = 0f; public bool UpdateWaterMaterialPerFrame = false; [Space(8f)] public bool AddCircleAnim = false; public float Radius = 6f; public float Speed = 1f; [Space(8f)] public Transform[] ManagedWaterProjectors; [Header("Debug")] public float MaxDisp; private Transform trans; private LuxWaterUtils.GersterWavesDescription Description; private bool ObjectIsVisible = false; private Vector3 Offset = Vector3.zero; private void Start() { trans = ((Component)this).transform; LuxWaterUtils.GetGersterWavesDescription(ref Description, WaterMaterial); } private void OnBecameVisible() { ObjectIsVisible = true; } private void OnBecameInvisible() { ObjectIsVisible = false; } private void LateUpdate() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) if ((!ObjectIsVisible && !AddCircleAnim) || (Object)(object)WaterMaterial == (Object)null) { return; } if (UpdateWaterMaterialPerFrame) { LuxWaterUtils.GetGersterWavesDescription(ref Description, WaterMaterial); } Vector3 position = trans.position; position -= Offset; if (AddCircleAnim) { position.x += Mathf.Sin(Time.time * Speed) * Time.deltaTime * Radius; position.z += Mathf.Cos(Time.time * Speed) * Time.deltaTime * Radius; } int num = ManagedWaterProjectors.Length; if (num > 0) { for (int i = 0; i != num; i++) { Vector3 position2 = ManagedWaterProjectors[i].position; position2.x = position.x; position2.z = position.z; ManagedWaterProjectors[i].position = position2; } } Offset = LuxWaterUtils.GetGestnerDisplacement(position, Description, TimeOffset); float magnitude = ((Vector3)(ref Offset)).magnitude; if (magnitude > MaxDisp) { MaxDisp = magnitude; } ref Vector3 offset = ref Offset; offset.x += Offset.x * Damping.x; ref Vector3 offset2 = ref Offset; offset2.y += Offset.y * Damping.y; ref Vector3 offset3 = ref Offset; offset3.z += Offset.z * Damping.z; trans.position = position + Offset; } } public class LuxWater_WaterVolumeListener : MonoBehaviour { private void OnEnable() { LuxWater_WaterVolume.OnEnterWaterVolume += Enter; LuxWater_WaterVolume.OnExitWaterVolume += Exit; } private void OnDisable() { LuxWater_WaterVolume.OnEnterWaterVolume -= Enter; LuxWater_WaterVolume.OnExitWaterVolume -= Exit; } private void Enter() { Debug.Log((object)"Entered."); } private void Exit() { Debug.Log((object)"Exited."); } } namespace LuxWater { [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class LuxWater_CameraDepthMode : MonoBehaviour { public bool GrabDepthTexture = false; private Camera cam; private Material CopyDepthMat; private RenderTextureFormat format; private Dictionary<Camera, CommandBuffer> m_cmdBuffer = new Dictionary<Camera, CommandBuffer>(); private bool CamCallBackAdded = false; [HideInInspector] public bool ShowShaderWarning = true; private void OnEnable() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) cam = ((Component)this).GetComponent<Camera>(); Camera obj = cam; obj.depthTextureMode = (DepthTextureMode)(obj.depthTextureMode | 1); if ((int)SystemInfo.graphicsDeviceType == 16) { Camera.onPreCull = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(OnPrecull)); CamCallBackAdded = true; CopyDepthMat = new Material(Shader.Find("Hidden/Lux Water/CopyDepth")); format = (RenderTextureFormat)14; if (!SystemInfo.SupportsRenderTextureFormat(format)) { format = (RenderTextureFormat)15; } if (!SystemInfo.SupportsRenderTextureFormat(format)) { format = (RenderTextureFormat)2; } } } private void OnDisable() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (CamCallBackAdded) { Camera.onPreCull = (CameraCallback)Delegate.Remove((Delegate?)(object)Camera.onPreCull, (Delegate?)new CameraCallback(OnPrecull)); foreach (KeyValuePair<Camera, CommandBuffer> item in m_cmdBuffer) { if ((Object)(object)item.Key != (Object)null) { item.Key.RemoveCommandBuffer((CameraEvent)7, item.Value); } } m_cmdBuffer.Clear(); } ShowShaderWarning = true; } private void OnPrecull(Camera camera) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown if (!GrabDepthTexture) { return; } RenderingPath actualRenderingPath = cam.actualRenderingPath; if ((int)actualRenderingPath == 3 && (int)SystemInfo.graphicsDeviceType == 16) { if (!m_cmdBuffer.TryGetValue(camera, out var value)) { value = new CommandBuffer(); value.name = "Lux Water Grab Depth"; camera.AddCommandBuffer((CameraEvent)14, value); m_cmdBuffer[camera] = value; } value.Clear(); int pixelWidth = camera.pixelWidth; int pixelHeight = camera.pixelHeight; int num = Shader.PropertyToID("_Lux_GrabbedDepth"); value.GetTemporaryRT(num, pixelWidth, pixelHeight, 0, (FilterMode)0, format, (RenderTextureReadWrite)1); value.Blit(RenderTargetIdentifier.op_Implicit((BuiltinRenderTextureType)1), RenderTargetIdentifier.op_Implicit(num), CopyDepthMat, 0); value.ReleaseTemporaryRT(num); return; } GrabDepthTexture = false; foreach (KeyValuePair<Camera, CommandBuffer> item in m_cmdBuffer) { if ((Object)(object)item.Key != (Object)null) { item.Key.RemoveCommandBuffer((CameraEvent)7, item.Value); } } m_cmdBuffer.Clear(); ShowShaderWarning = true; } } public class LuxWater_HelpBtn : PropertyAttribute { public string URL; public LuxWater_HelpBtn(string URL) { this.URL = URL; } } [CustomPropertyDrawer(typeof(LuxWater_HelpBtn))] public class LuxWater_HelpBtnDrawer : DecoratorDrawer { private static string baseURL = "https://docs.google.com/document/d/1NDtUpVBgd3UYEI8LRNI4teFF3qm38h-u3Az-ozaaOX0/view#heading="; private LuxWater_HelpBtn help => (LuxWater_HelpBtn)(object)((DecoratorDrawer)this).attribute; public override float GetHeight() { return ((DecoratorDrawer)this).GetHeight() + 2f; } public override void OnGUI(Rect position) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) Color blue = default(Color); ((Color)(ref blue))..ctor(0.3f, 0.47f, 1f, 1f); if (!EditorGUIUtility.isProSkin) { blue = Color.blue; } GUIStyle val = new GUIStyle(EditorStyles.miniButton); val.padding = new RectOffset(0, 0, 2, 2); val.normal.background = null; val.normal.textColor = blue; val.onNormal.textColor = blue; val.active.textColor = blue; val.onActive.textColor = blue; val.focused.textColor = blue; val.onFocused.textColor = blue; ((Rect)(ref position)).x = ((Rect)(ref position)).x + ((Rect)(ref position)).width - 30f; ((Rect)(ref position)).width = 30f; if (GUI.Button(position, "Help", val)) { Application.OpenURL(baseURL + help.URL); } } } public class LuxWater_InfiniteOcean : MonoBehaviour { [Space(6f)] [LuxWater_HelpBtn("h.c1utuz9up55r")] public Camera MainCam; public float GridSize = 10f; private Transform trans; private Transform camTrans; private void OnEnable() { trans = ((Component)this).GetComponent<Transform>(); } private void LateUpdate() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MainCam == (Object)null) { Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } MainCam = main; } if ((Object)(object)camTrans == (Object)null) { camTrans = ((Component)MainCam).transform; } Vector3 position = camTrans.position; Vector3 position2 = trans.position; Vector3 lossyScale = trans.lossyScale; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(GridSize * lossyScale.x, GridSize * lossyScale.z); float num = (float)Math.Round(position.x / val.x); float num2 = val.x * num; num = (float)Math.Round(position.z / val.y); float num3 = val.y * num; position2.x = num2 + position2.x % val.x; position2.z = num3 + position2.z % val.y; trans.position = position2; } } [ExecuteInEditMode] public class LuxWater_PlanarReflection : MonoBehaviour { public enum ReflectionResolution { Full = 1, Half = 2, Quarter = 4, Eighth = 8 } public enum NumberOfShadowCascades { One = 1, Two = 2, Four = 4 } [Space(6f)] [LuxWater_HelpBtn("h.5c3jy4qfh163")] public bool UpdateSceneView = true; [Space(5f)] public bool isMaster = false; public Material[] WaterMaterials; [Space(5f)] public LayerMask reflectionMask = LayerMask.op_Implicit(-1); public ReflectionResolution Resolution = ReflectionResolution.Half; public Color clearColor = Color.black; public bool reflectSkybox = true; [Space(5f)] public bool disablePixelLights = false; [Space(5f)] public bool renderShadows = true; public float shadowDistance = 0f; public NumberOfShadowCascades ShadowCascades = NumberOfShadowCascades.One; [Space(5f)] public float WaterSurfaceOffset = 0f; public float clipPlaneOffset = 0.07f; private string reflectionSampler = "_LuxWater_ReflectionTex"; private Vector3 m_Oldpos; private Camera m_ReflectionCamera; private Material m_SharedMaterial; private Dictionary<Camera, bool> m_HelperCameras; private RenderTexture m_reflectionMap; private void OnEnable() { ((Component)this).gameObject.layer = LayerMask.NameToLayer("Water"); Renderer component = ((Component)this).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { m_SharedMaterial = ((Component)this).GetComponent<Renderer>().sharedMaterial; } } private void OnDisable() { if ((Object)(object)m_ReflectionCamera != (Object)null) { Object.DestroyImmediate((Object)(object)m_ReflectionCamera.targetTexture); Object.DestroyImmediate((Object)(object)m_ReflectionCamera); } if (m_HelperCameras != null) { m_HelperCameras.Clear(); } } private Camera CreateReflectionCameraFor(Camera cam) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) string text = ((Object)((Component)this).gameObject).name + "Reflection" + ((Object)cam).name; GameObject val = GameObject.Find(text); if (!Object.op_Implicit((Object)(object)val)) { val = new GameObject(text, new Type[1] { typeof(Camera) }); ((Object)val).hideFlags = (HideFlags)61; } if (!Object.op_Implicit((Object)(object)val.GetComponent(typeof(Camera)))) { val.AddComponent(typeof(Camera)); } Camera component = val.GetComponent<Camera>(); component.backgroundColor = clearColor; component.clearFlags = (CameraClearFlags)(reflectSkybox ? 1 : 2); SetStandardCameraParameter(component, reflectionMask); if (!Object.op_Implicit((Object)(object)component.targetTexture)) { component.targetTexture = CreateTextureFor(cam); } return component; } private void SetStandardCameraParameter(Camera cam, LayerMask mask) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) cam.cullingMask = LayerMask.op_Implicit(mask) & ~(1 << LayerMask.NameToLayer("Water")); cam.backgroundColor = Color.black; ((Behaviour)cam).enabled = false; } private RenderTexture CreateTextureFor(Camera cam) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown int num = Mathf.FloorToInt((float)(cam.pixelWidth / (int)Resolution)); int num2 = Mathf.FloorToInt((float)(cam.pixelHeight / (int)Resolution)); RenderTexture val = new RenderTexture(num, num2, 24); ((Object)val).hideFlags = (HideFlags)52; return val; } public void RenderHelpCameras(Camera currentCam) { if (m_HelperCameras == null) { m_HelperCameras = new Dictionary<Camera, bool>(); } if (!m_HelperCameras.ContainsKey(currentCam)) { m_HelperCameras.Add(currentCam, value: false); } if (((Object.op_Implicit((Object)(object)SceneView.currentDrawingSceneView) && (Object)(object)SceneView.currentDrawingSceneView.camera == (Object)(object)Camera.current) || !m_HelperCameras[currentCam]) && !((Object)currentCam).name.Contains("Reflection Probes")) { if (!Object.op_Implicit((Object)(object)m_ReflectionCamera)) { m_ReflectionCamera = CreateReflectionCameraFor(currentCam); } RenderReflectionFor(currentCam, m_ReflectionCamera); m_HelperCameras[currentCam] = true; } } public void LateUpdate() { if (m_HelperCameras != null) { m_HelperCameras.Clear(); } } public void WaterTileBeingRendered(Transform tr, Camera currentCam) { RenderHelpCameras(currentCam); if (Object.op_Implicit((Object)(object)m_ReflectionCamera) && Object.op_Implicit((Object)(object)m_SharedMaterial)) { m_SharedMaterial.SetTexture(reflectionSampler, (Texture)(object)m_ReflectionCamera.targetTexture); } } public void OnWillRenderObject() { WaterTileBeingRendered(((Component)this).transform, Camera.current); } private void RenderReflectionFor(Camera cam, Camera reflectCamera) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)reflectCamera) || (Object.op_Implicit((Object)(object)m_SharedMaterial) && !m_SharedMaterial.HasProperty(reflectionSampler))) { return; } int num = Mathf.FloorToInt((float)(cam.pixelWidth / (int)Resolution)); int num2 = Mathf.FloorToInt((float)(cam.pixelHeight / (int)Resolution)); if (((Texture)reflectCamera.targetTexture).width != num || ((Texture)reflectCamera.targetTexture).height != num2) { Object.DestroyImmediate((Object)(object)reflectCamera.targetTexture); reflectCamera.targetTexture = CreateTextureFor(cam); } reflectCamera.cullingMask = LayerMask.op_Implicit(reflectionMask) & ~(1 << LayerMask.NameToLayer("Water")); SaneCameraSettings(reflectCamera); reflectCamera.backgroundColor = clearColor; reflectCamera.clearFlags = (CameraClearFlags)(reflectSkybox ? 1 : 2); GL.invertCulling = true; Transform transform = ((Component)this).transform; Vector3 eulerAngles = ((Component)cam).transform.eulerAngles; ((Component)reflectCamera).transform.eulerAngles = new Vector3(0f - eulerAngles.x, eulerAngles.y, eulerAngles.z); ((Component)reflectCamera).transform.position = ((Component)cam).transform.position; reflectCamera.orthographic = cam.orthographic; reflectCamera.orthographicSize = cam.orthographicSize; Vector3 position = ((Component)transform).transform.position; position.y = transform.position.y + WaterSurfaceOffset; Vector3 up = ((Component)transform).transform.up; float num3 = 0f - Vector3.Dot(up, position) - clipPlaneOffset; Vector4 plane = default(Vector4); ((Vector4)(ref plane))..ctor(up.x, up.y, up.z, num3); Matrix4x4 val = Matrix4x4.zero; val = CalculateReflectionMatrix(val, plane); m_Oldpos = ((Component)cam).transform.position; Vector3 position2 = ((Matrix4x4)(ref val)).MultiplyPoint(m_Oldpos); reflectCamera.worldToCameraMatrix = cam.worldToCameraMatrix * val; Vector4 clipPlane = CameraSpacePlane(reflectCamera, position, up, 1f); Matrix4x4 projectionMatrix = cam.projectionMatrix; projectionMatrix = CalculateObliqueMatrix(projectionMatrix, clipPlane); reflectCamera.projectionMatrix = projectionMatrix; ((Component)reflectCamera).transform.position = position2; Vector3 eulerAngles2 = ((Component)cam).transform.eulerAngles; ((Component)reflectCamera).transform.eulerAngles = new Vector3(0f - eulerAngles2.x, eulerAngles2.y, eulerAngles2.z); int pixelLightCount = QualitySettings.pixelLightCount; if (disablePixelLights) { QualitySettings.pixelLightCount = 0; } float num4 = QualitySettings.shadowDistance; int shadowCascades = QualitySettings.shadowCascades; if (!renderShadows) { QualitySettings.shadowDistance = 0f; } else if (shadowDistance > 0f) { QualitySettings.shadowDistance = shadowDistance; } QualitySettings.shadowCascades = (int)ShadowCascades; reflectCamera.Render(); GL.invertCulling = false; if (disablePixelLights) { QualitySettings.pixelLightCount = pixelLightCount; } if (!renderShadows || shadowDistance > 0f) { QualitySettings.shadowDistance = num4; } QualitySettings.shadowCascades = shadowCascades; if (isMaster) { for (int i = 0; i < WaterMaterials.Length; i++) { WaterMaterials[i].SetTexture(reflectionSampler, (Texture)(object)reflectCamera.targetTexture); } } } private void SaneCameraSettings(Camera helperCam) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) helperCam.depthTextureMode = (DepthTextureMode)0; helperCam.backgroundColor = Color.black; helperCam.clearFlags = (CameraClearFlags)2; helperCam.renderingPath = (RenderingPath)1; } private static Matrix4x4 CalculateObliqueMatrix(Matrix4x4 projection, Vector4 clipPlane) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) Vector4 val = ((Matrix4x4)(ref projection)).inverse * new Vector4(Sgn(clipPlane.x), Sgn(clipPlane.y), 1f, 1f); Vector4 val2 = clipPlane * (2f / Vector4.Dot(clipPlane, val)); ((Matrix4x4)(ref projection))[2] = val2.x - ((Matrix4x4)(ref projection))[3]; ((Matrix4x4)(ref projection))[6] = val2.y - ((Matrix4x4)(ref projection))[7]; ((Matrix4x4)(ref projection))[10] = val2.z - ((Matrix4x4)(ref projection))[11]; ((Matrix4x4)(ref projection))[14] = val2.w - ((Matrix4x4)(ref projection))[15]; return projection; } private static Matrix4x4 CalculateReflectionMatrix(Matrix4x4 reflectionMat, Vector4 plane) { //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) reflectionMat.m00 = 1f - 2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[0]; reflectionMat.m01 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[1]; reflectionMat.m02 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[2]; reflectionMat.m03 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[0]; reflectionMat.m10 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[0]; reflectionMat.m11 = 1f - 2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[1]; reflectionMat.m12 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[2]; reflectionMat.m13 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[1]; reflectionMat.m20 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[0]; reflectionMat.m21 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[1]; reflectionMat.m22 = 1f - 2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[2]; reflectionMat.m23 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[2]; reflectionMat.m30 = 0f; reflectionMat.m31 = 0f; reflectionMat.m32 = 0f; reflectionMat.m33 = 1f; return reflectionMat; } private static float Sgn(float a) { if (a > 0f) { return 1f; } if (a < 0f) { return -1f; } return 0f; } private Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos + normal * clipPlaneOffset; Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix; Vector3 val2 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyPoint(val); Vector3 val3 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyVector(normal); Vector3 val4 = ((Vector3)(ref val3)).normalized * sideSign; return new Vector4(val4.x, val4.y, val4.z, 0f - Vector3.Dot(val2, val4)); } } [ExecuteInEditMode] public class LuxWater_PlanarWaterTile : MonoBehaviour { [Space(6f)] [LuxWater_HelpBtn("h.nu6w5ylbucb7")] public LuxWater_PlanarReflection reflection; public void OnEnable() { AcquireComponents(); } private void AcquireComponents() { if (!Object.op_Implicit((Object)(object)reflection)) { if (Object.op_Implicit((Object)(object)((Component)this).transform.parent)) { reflection = ((Component)((Component)this).transform.parent).GetComponent<LuxWater_PlanarReflection>(); } else { reflection = ((Component)((Component)this).transform).GetComponent<LuxWater_PlanarReflection>(); } } } public void Update() { AcquireComponents(); } public void OnWillRenderObject() { if (Object.op_Implicit((Object)(object)reflection)) { reflection.WaterTileBeingRendered(((Component)this).transform, Camera.current); } } } public class LuxWater_Projector : MonoBehaviour { public enum ProjectorType { FoamProjector, NormalProjector } [Space(8f)] public ProjectorType Type = ProjectorType.FoamProjector; [NonSerialized] public static List<LuxWater_Projector> FoamProjectors = new List<LuxWater_Projector>(); [NonSerialized] public static List<LuxWater_Projector> NormalProjectors = new List<LuxWater_Projector>(); [NonSerialized] public Renderer m_Rend; [NonSerialized] public Material m_Mat; private bool added = false; private Vector3 origPos; private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; position.y = origPos.y; } private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) origPos = ((Component)this).transform.position; Renderer component = ((Component)this).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { m_Rend = ((Component)this).GetComponent<Renderer>(); m_Mat = m_Rend.sharedMaterials[0]; m_Rend.enabled = false; if (Type == ProjectorType.FoamProjector) { FoamProjectors.Add(this); } else { NormalProjectors.Add(this); } added = true; } } private void OnDisable() { if (added) { if (Type == ProjectorType.FoamProjector) { FoamProjectors.Remove(this); } else { NormalProjectors.Remove(this); } m_Rend.enabled = true; } } } [RequireComponent(typeof(Camera))] [ExecuteInEditMode] public class LuxWater_ProjectorRenderer : MonoBehaviour { public enum BufferResolution { Full = 1, Half = 2, Quarter = 4, Eighth = 8 } [Space(8f)] public BufferResolution FoamBufferResolution = BufferResolution.Full; public BufferResolution NormalBufferResolution = BufferResolution.Full; [Space(2f)] [Header("Debug")] [Space(4f)] public bool DebugFoamBuffer = false; public bool DebugNormalBuffer = false; public bool DebugStats = false; private int drawnFoamProjectors = 0; private int drawnNormalProjectors = 0; private static CommandBuffer cb_Foam; private static CommandBuffer cb_Normals; private Camera cam; private Transform camTransform; private RenderTexture ProjectedFoam; private RenderTexture ProjectedNormals; private Texture2D defaultBump; private Bounds tempBounds; private int _LuxWater_FoamOverlayPID; private int _LuxWater_NormalOverlayPID; private Plane[] frustumPlanes = (Plane[])(object)new Plane[6]; private Material DebugMat; private Material DebugNormalMat; private void OnEnable() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown _LuxWater_FoamOverlayPID = Shader.PropertyToID("_LuxWater_FoamOverlay"); _LuxWater_NormalOverlayPID = Shader.PropertyToID("_LuxWater_NormalOverlay"); cb_Foam = new CommandBuffer(); cb_Foam.name = "Lux Water: Foam Overlay Buffer"; cb_Normals = new CommandBuffer(); cb_Normals.name = "Lux Water: Normal Overlay Buffer"; } private void OnDisable() { if ((Object)(object)ProjectedFoam != (Object)null) { Object.DestroyImmediate((Object)(object)ProjectedFoam); } if ((Object)(object)ProjectedNormals != (Object)null) { Object.DestroyImmediate((Object)(object)ProjectedNormals); } if ((Object)(object)defaultBump != (Object)null) { Object.DestroyImmediate((Object)(object)defaultBump); } if ((Object)(object)DebugMat != (Object)null) { Object.DestroyImmediate((Object)(object)DebugMat); } if (cb_Foam != null && cb_Foam.sizeInBytes > 0) { cb_Foam.Clear(); cb_Foam.Dispose(); } if (cb_Normals != null && cb_Normals.sizeInBytes > 0) { cb_Normals.Clear(); cb_Normals.Dispose(); } Shader.DisableKeyword("USINGWATERPROJECTORS"); } private void OnPreCull() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Expected O, but got Unknown //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Expected O, but got Unknown //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) if (!Application.isPlaying) { if ((Object)(object)defaultBump == (Object)null) { defaultBump = new Texture2D(1, 1, (TextureFormat)4, false); Texture2D obj = defaultBump; Color val = default(Color); ((Color)(ref val))..ctor(0.5f, 0.5f, 1f, 0.5f); obj.SetPixel(0, 0, ((Color)(ref val)).gamma); defaultBump.Apply(false); } Shader.SetGlobalTexture(_LuxWater_NormalOverlayPID, (Texture)(object)defaultBump); Shader.SetGlobalTexture(_LuxWater_FoamOverlayPID, (Texture)(object)Texture2D.blackTexture); return; } cam = ((Component)this).GetComponent<Camera>(); if ((Object)(object)SceneView.currentDrawingSceneView != (Object)null && (Object)(object)SceneView.currentDrawingSceneView.camera == (Object)(object)cam) { return; } int count = LuxWater_Projector.FoamProjectors.Count; int count2 = LuxWater_Projector.NormalProjectors.Count; if (count + count2 == 0) { if (cb_Foam != null) { cb_Foam.Clear(); } if (cb_Normals != null) { cb_Normals.Clear(); } Shader.DisableKeyword("USINGWATERPROJECTORS"); return; } Shader.EnableKeyword("USINGWATERPROJECTORS"); Matrix4x4 projectionMatrix = cam.projectionMatrix; Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix; Matrix4x4 worldToProjectMatrix = projectionMatrix * worldToCameraMatrix; int pixelWidth = cam.pixelWidth; int pixelHeight = cam.pixelHeight; GeomUtil.CalculateFrustumPlanes(frustumPlanes, worldToProjectMatrix); int num = Mathf.FloorToInt((float)(pixelWidth / (int)FoamBufferResolution)); int num2 = Mathf.FloorToInt((float)(pixelHeight / (int)FoamBufferResolution)); if (!Object.op_Implicit((Object)(object)ProjectedFoam)) { ProjectedFoam = new RenderTexture(num, num2, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)1); } else if (((Texture)ProjectedFoam).width != num) { Object.DestroyImmediate((Object)(object)ProjectedFoam); ProjectedFoam = new RenderTexture(num, num2, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)1); } GL.PushMatrix(); GL.modelview = worldToCameraMatrix; GL.LoadProjectionMatrix(projectionMatrix); cb_Foam.Clear(); cb_Foam.SetRenderTarget(RenderTargetIdentifier.op_Implicit((Texture)(object)ProjectedFoam)); cb_Foam.ClearRenderTarget(true, true, new Color(0f, 0f, 0f, 0f), 1f); drawnFoamProjectors = 0; for (int i = 0; i < count; i++) { LuxWater_Projector luxWater_Projector = LuxWater_Projector.FoamProjectors[i]; tempBounds = luxWater_Projector.m_Rend.bounds; if (GeometryUtility.TestPlanesAABB(frustumPlanes, tempBounds)) { cb_Foam.DrawRenderer(luxWater_Projector.m_Rend, luxWater_Projector.m_Mat); drawnFoamProjectors++; } } Graphics.ExecuteCommandBuffer(cb_Foam); Shader.SetGlobalTexture(_LuxWater_FoamOverlayPID, (Texture)(object)ProjectedFoam); num = Mathf.FloorToInt((float)(pixelWidth / (int)NormalBufferResolution)); num2 = Mathf.FloorToInt((float)(pixelHeight / (int)NormalBufferResolution)); if (!Object.op_Implicit((Object)(object)ProjectedNormals)) { ProjectedNormals = new RenderTexture(num, num2, 0, (RenderTextureFormat)2, (RenderTextureReadWrite)1); } else if (((Texture)ProjectedNormals).width != num) { Object.DestroyImmediate((Object)(object)ProjectedNormals); ProjectedNormals = new RenderTexture(num, num2, 0, (RenderTextureFormat)2, (RenderTextureReadWrite)1); } cb_Normals.Clear(); cb_Normals.SetRenderTarget(RenderTargetIdentifier.op_Implicit((Texture)(object)ProjectedNormals)); cb_Normals.ClearRenderTarget(true, true, new Color(0f, 0f, 0f, 0f), 1f); drawnNormalProjectors = 0; for (int j = 0; j < count2; j++) { LuxWater_Projector luxWater_Projector2 = LuxWater_Projector.NormalProjectors[j]; tempBounds = luxWater_Projector2.m_Rend.bounds; if (GeometryUtility.TestPlanesAABB(frustumPlanes, tempBounds)) { cb_Normals.DrawRenderer(luxWater_Projector2.m_Rend, luxWater_Projector2.m_Mat); drawnNormalProjectors++; } } Graphics.ExecuteCommandBuffer(cb_Normals); Shader.SetGlobalTexture(_LuxWater_NormalOverlayPID, (Texture)(object)ProjectedNormals); GL.PopMatrix(); } private void OnDrawGizmos() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) Camera component = ((Component)this).GetComponent<Camera>(); int num = 0; int num2 = (int)(component.aspect * 128f); if ((Object)(object)DebugMat == (Object)null) { DebugMat = new Material(Shader.Find("Hidden/LuxWater_Debug")); } if ((Object)(object)DebugNormalMat == (Object)null) { DebugNormalMat = new Material(Shader.Find("Hidden/LuxWater_DebugNormals")); } if (DebugFoamBuffer) { if ((Object)(object)ProjectedFoam == (Object)null) { return; } GL.PushMatrix(); GL.LoadPixelMatrix(0f, (float)Screen.width, (float)Screen.height, 0f); Graphics.DrawTexture(new Rect((float)num, 0f, (float)num2, 128f), (Texture)(object)ProjectedFoam, DebugMat); GL.PopMatrix(); num = num2; } if (DebugNormalBuffer && !((Object)(object)ProjectedNormals == (Object)null)) { GL.PushMatrix(); GL.LoadPixelMatrix(0f, (float)Screen.width, (float)Screen.height, 0f); Graphics.DrawTexture(new Rect((float)num, 0f, (float)num2, 128f), (Texture)(object)ProjectedNormals, DebugNormalMat); GL.PopMatrix(); } } private void OnGUI() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (DebugStats) { int count = LuxWater_Projector.FoamProjectors.Count; int count2 = LuxWater_Projector.NormalProjectors.Count; TextAnchor alignment = GUI.skin.label.alignment; GUI.skin.label.alignment = (TextAnchor)3; GUI.Label(new Rect(10f, 0f, 300f, 40f), "Foam Projectors [Registered] " + count + " [Drawn] " + drawnFoamProjectors); GUI.Label(new Rect(10f, 18f, 300f, 40f), "Normal Projectors [Registered] " + count2 + " [Drawn] " + drawnNormalProjectors); GUI.skin.label.alignment = alignment; } } } public static class GeomUtil { private static Action<Plane[], Matrix4x4> _calculateFrustumPlanes_Imp; public static void CalculateFrustumPlanes(Plane[] planes, Matrix4x4 worldToProjectMatrix) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (_calculateFrustumPlanes_Imp == null) { MethodInfo method = typeof(GeometryUtility).GetMethod("Internal_ExtractPlanes", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[2] { typeof(Plane[]), typeof(Matrix4x4) }, null); if ((object)method == null) { throw new Exception("Failed to reflect internal method. Your Unity version may not contain the presumed named method in GeometryUtility."); } _calculateFrustumPlanes_Imp = Delegate.CreateDelegate(typeof(Action<Plane[], Matrix4x4>), method) as Action<Plane[], Matrix4x4>; if (_calculateFrustumPlanes_Imp == null) { throw new Exception("Failed to reflect internal method. Your Unity version may not contain the presumed named method in GeometryUtility."); } } _calculateFrustumPlanes_Imp(planes, worldToProjectMatrix); } } [RequireComponent(typeof(Camera))] public class LuxWater_UnderWaterBlur : MonoBehaviour { [Space(6f)] [LuxWater_HelpBtn("h.3a2840a53u5j")] public float blurSpread = 0.6f; public int blurDownSample = 4; public int blurIterations = 4; private Vector2[] m_offsets = (Vector2[])(object)new Vector2[4]; private Material blurMaterial; private Material blitMaterial; private LuxWater_UnderWaterRendering waterrendermanager; private bool doBlur = false; private bool initBlur = true; private void OnEnable() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown blurMaterial = new Material(Shader.Find("Hidden/Lux Water/BlurEffectConeTap")); blitMaterial = new Material(Shader.Find("Hidden/Lux Water/UnderWaterPost")); ((MonoBehaviour)this).Invoke("GetWaterrendermanagerInstance", 0f); } private void OnDisable() { if (Object.op_Implicit((Object)(object)blurMaterial)) { Object.DestroyImmediate((Object)(object)blurMaterial); } if (Object.op_Implicit((Object)(object)blitMaterial)) { Object.DestroyImmediate((Object)(object)blitMaterial); } } private void GetWaterrendermanagerInstance() { waterrendermanager = LuxWater_UnderWaterRendering.instance; } private void OnRenderImage(RenderTexture src, RenderTexture dest) { if ((Object)(object)waterrendermanager == (Object)null) { Graphics.Blit((Texture)(object)src, dest); return; } doBlur = waterrendermanager.activeWaterVolume > -1; if (doBlur || initBlur) { initBlur = false; int num = ((Texture)src).width / blurDownSample; int num2 = ((Texture)src).height / blurDownSample; RenderTexture val = RenderTexture.GetTemporary(num, num2, 0, (RenderTextureFormat)9); DownSample(src, val); for (int i = 0; i < blurIterations; i++) { RenderTexture temporary = RenderTexture.GetTemporary(num, num2, 0, (RenderTextureFormat)9); FourTapCone(val, temporary, i); RenderTexture.ReleaseTemporary(val); val = temporary; } Shader.SetGlobalTexture("_UnderWaterTex", (Texture)(object)val); Graphics.Blit((Texture)(object)src, dest, blitMaterial, 1); RenderTexture.ReleaseTemporary(val); } else { Graphics.Blit((Texture)(object)src, dest); } } private void FourTapCone(RenderTexture source, RenderTexture dest, int iteration) { float num = 0.5f + (float)iteration * blurSpread; m_offsets[0].x = 0f - num; m_offsets[0].y = 0f - num; m_offsets[1].x = 0f - num; m_offsets[1].y = num; m_offsets[2].x = num; m_offsets[2].y = num; m_offsets[3].x = num; m_offsets[3].y = 0f - num; if (iteration == 0) { Graphics.BlitMultiTap((Texture)(object)source, dest, blurMaterial, m_offsets); } else { Graphics.BlitMultiTap((Texture)(object)source, dest, blurMaterial, m_offsets); } } private void DownSample(RenderTexture source, RenderTexture dest) { float num = 1f; m_offsets[0].x = 0f - num; m_offsets[0].y = 0f - num; m_offsets[1].x = 0f - num; m_offsets[1].y = num; m_offsets[2].x = num; m_offsets[2].y = num; m_offsets[3].x = num; m_offsets[3].y = 0f - num; Graphics.BlitMultiTap((Texture)(object)source, dest, blurMaterial, m_offsets); } } [RequireComponent(typeof(Camera))] public class LuxWater_UnderWaterRendering : MonoBehaviour { public static LuxWater_UnderWaterRendering instance; [Space(6f)] [LuxWater_HelpBtn("h.d0q6uguuxpy")] public Transform Sun; [Space(4f)] public bool FindSunOnEnable = false; public string SunGoName = ""; public string SunTagName = ""; private Light SunLight; [Space(2f)] [Header("Deep Water Lighting")] [Space(4f)] public bool EnableDeepwaterLighting = false; public float DefaultWaterSurfacePosition = 0f; public float DirectionalLightingFadeRange = 64f; public float FogLightingFadeRange = 64f; [Space(2f)] [Header("Advanced Deferred Fog")] [Space(4f)] public bool EnableAdvancedDeferredFog = false; public float FogDepthShift = 1f; public float FogEdgeBlending = 0.125f; [NonSerialized] [Space(8f)] public int activeWaterVolume = -1; [NonSerialized] public List<Camera> activeWaterVolumeCameras = new List<Camera>(); [NonSerialized] public float activeGridSize = 0f; [NonSerialized] public float WaterSurfacePos = 0f; [NonSerialized] [Space(8f)] public List<int> RegisteredWaterVolumesIDs = new List<int>(); [NonSerialized] public List<LuxWater_WaterVolume> RegisteredWaterVolumes = new List<LuxWater_WaterVolume>(); private List<Mesh> WaterMeshes = new List<Mesh>(); private List<Transform> WaterTransforms = new List<Transform>(); private List<Material> WaterMaterials = new List<Material>(); private List<bool> WaterIsOnScreen = new List<bool>(); private List<bool> WaterUsesSlidingVolume = new List<bool>(); private RenderTexture UnderWaterMask; [Space(2f)] [Header("Managed transparent Materials")] [Space(4f)] public List<Material> m_aboveWatersurface = new List<Material>(); public List<Material> m_belowWatersurface = new List<Material>(); [Space(2f)] [Header("Optimize")] [Space(4f)] public ShaderVariantCollection PrewarmedShaders; public int ListCapacity = 10; [Space(2f)] [Header("Debug")] [Space(4f)] public bool enableDebug = false; [Space(8f)] private Material mat; private Material blurMaterial; private Material blitMaterial; private Camera cam; private bool UnderwaterIsSetUp = false; private Transform camTransform; private Matrix4x4 frustumCornersArray = Matrix4x4.identity; private SphericalHarmonicsL2 ambientProbe; private Vector3[] directions = (Vector3[])(object)new Vector3[1] { new Vector3(0f, 1f, 0f) }; private Color[] AmbientLightingSamples = (Color[])(object)new Color[1]; private bool DoUnderWaterRendering = false; private Matrix4x4 camProj; private Vector3[] frustumCorners = (Vector3[])(object)new Vector3[4]; private float Projection; private bool islinear = false; private Matrix4x4 WatervolumeMatrix; private int UnderWaterMaskPID; private int Lux_FrustumCornersWSPID; private int Lux_CameraWSPID; private int GerstnerEnabledPID; private int LuxWaterMask_GerstnerVertexIntensityPID; private int GerstnerVertexIntensityPID; private int LuxWaterMask_GAmplitudePID; private int GAmplitudePID; private int LuxWaterMask_GFinalFrequencyPID; private int GFinalFrequencyPID; private int LuxWaterMask_GSteepnessPID; private int GSteepnessPID; private int LuxWaterMask_GFinalSpeedPID; private int GFinalSpeedPID; private int LuxWaterMask_GDirectionABPID; private int GDirectionABPID; private int LuxWaterMask_GDirectionCDPID; private int GDirectionCDPID; private int LuxWaterMask_GerstnerSecondaryWaves; private int GerstnerSecondaryWaves; private int Lux_UnderWaterAmbientSkyLightPID; private int Lux_UnderWaterSunColorPID; private int Lux_UnderWaterSunDirPID; private int Lux_UnderWaterSunDirViewSpacePID; private int Lux_EdgeLengthPID; private int Lux_CausticsEnabledPID; private int Lux_CausticModePID; private int Lux_UnderWaterFogColorPID; private int Lux_UnderWaterFogDensityPID; private int Lux_UnderWaterFogAbsorptionCancellationPID; private int Lux_UnderWaterAbsorptionHeightPID; private int Lux_UnderWaterAbsorptionMaxHeightPID; private int Lux_MaxDirLightDepthPID; private int Lux_MaxFogLightDepthPID; private int Lux_UnderWaterAbsorptionDepthPID; private int Lux_UnderWaterAbsorptionColorStrengthPID; private int Lux_UnderWaterAbsorptionStrengthPID; private int Lux_UnderWaterUnderwaterScatteringPowerPID; private int Lux_UnderWaterUnderwaterScatteringIntensityPID; private int Lux_UnderWaterUnderwaterScatteringColorPID; private int Lux_UnderWaterUnderwaterScatteringOcclusionPID; private int Lux_UnderWaterCausticsPID; private int Lux_UnderWaterDeferredFogParams; private int CausticTexPID; private void OnEnable() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Invalid comparison between Unknown and I4 if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); } else { instance = this; } mat = new Material(Shader.Find("Hidden/Lux Water/WaterMask")); blurMaterial = new Material(Shader.Find("Hidden/Lux Water/BlurEffectConeTap")); blitMaterial = new Material(Shader.Find("Hidden/Lux Water/UnderWaterPost")); if ((Object)(object)cam == (Object)null) { cam = ((Component)this).GetComponent<Camera>(); } Camera obj = cam; obj.depthTextureMode = (DepthTextureMode)(obj.depthTextureMode | 1); camTransform = ((Component)cam).transform; if (FindSunOnEnable) { if (SunGoName != "") { Sun = GameObject.Find(SunGoName).transform; } else if (SunTagName != "") { Sun = GameObject.FindWithTag(SunTagName).transform; } } if (SystemInfo.usesReversedZBuffer) { Projection = -1f; } else { Projection = 1f; } UnderWaterMaskPID = Shader.PropertyToID("_UnderWaterMask"); Lux_FrustumCornersWSPID = Shader.PropertyToID("_Lux_FrustumCornersWS"); Lux_CameraWSPID = Shader.PropertyToID("_Lux_CameraWS"); GerstnerEnabledPID = Shader.PropertyToID("_GerstnerEnabled"); LuxWaterMask_GerstnerVertexIntensityPID = Shader.PropertyToID("_LuxWaterMask_GerstnerVertexIntensity"); GerstnerVertexIntensityPID = Shader.PropertyToID("_GerstnerVertexIntensity"); LuxWaterMask_GAmplitudePID = Shader.PropertyToID("_LuxWaterMask_GAmplitude"); GAmplitudePID = Shader.PropertyToID("_GAmplitude"); LuxWaterMask_GFinalFrequencyPID = Shader.PropertyToID("_LuxWaterMask_GFinalFrequency"); GFinalFrequencyPID = Shader.PropertyToID("_GFinalFrequency"); LuxWaterMask_GSteepnessPID = Shader.PropertyToID("_LuxWaterMask_GSteepness"); GSteepnessPID = Shader.PropertyToID("_GSteepness"); LuxWaterMask_GFinalSpeedPID = Shader.PropertyToID("_LuxWaterMask_GFinalSpeed"); GFinalSpeedPID = Shader.PropertyToID("_GFinalSpeed"); LuxWaterMask_GDirectionABPID = Shader.PropertyToID("_LuxWaterMask_GDirectionAB"); GDirectionABPID = Shader.PropertyToID("_GDirectionAB"); LuxWaterMask_GDirectionCDPID = Shader.PropertyToID("_LuxWaterMask_GDirectionCD"); GDirectionCDPID = Shader.PropertyToID("_GDirectionCD"); LuxWaterMask_GerstnerSecondaryWaves = Shader.PropertyToID("_LuxWaterMask_GerstnerSecondaryWaves"); GerstnerSecondaryWaves = Shader.PropertyToID("_GerstnerSecondaryWaves"); Lux_UnderWaterAmbientSkyLightPID = Shader.PropertyToID("_Lux_UnderWaterAmbientSkyLight"); Lux_UnderWaterSunColorPID = Shader.PropertyToID("_Lux_UnderWaterSunColor"); Lux_UnderWaterSunDirPID = Shader.PropertyToID("_Lux_UnderWaterSunDir"); Lux_UnderWaterSunDirViewSpacePID = Shader.PropertyToID("_Lux_UnderWaterSunDirViewSpace"); Lux_EdgeLengthPID = Shader.PropertyToID("_LuxWater_EdgeLength"); Lux_MaxDirLightDepthPID = Shader.PropertyToID("_MaxDirLightDepth"); Lux_MaxFogLightDepthPID = Shader.PropertyToID("_MaxFogLightDepth"); Lux_CausticsEnabledPID = Shader.PropertyToID("_CausticsEnabled"); Lux_CausticModePID = Shader.PropertyToID("_CausticMode"); Lux_UnderWaterFogColorPID = Shader.PropertyToID("_Lux_UnderWaterFogColor"); Lux_UnderWaterFogDensityPID = Shader.PropertyToID("_Lux_UnderWaterFogDensity"); Lux_UnderWaterFogAbsorptionCancellationPID = Shader.PropertyToID("_Lux_UnderWaterFogAbsorptionCancellation"); Lux_UnderWaterAbsorptionHeightPID = Shader.PropertyToID("_Lux_UnderWaterAbsorptionHeight"); Lux_UnderWaterAbsorptionMaxHeightPID = Shader.PropertyToID("_Lux_UnderWaterAbsorptionMaxHeight"); Lux_UnderWaterAbsorptionDepthPID = Shader.PropertyToID("_Lux_UnderWaterAbsorptionDepth"); Lux_UnderWaterAbsorptionColorStrengthPID = Shader.PropertyToID("_Lux_UnderWaterAbsorptionColorStrength"); Lux_UnderWaterAbsorptionStrengthPID = Shader.PropertyToID("_Lux_UnderWaterAbsorptionStrength"); Lux_UnderWaterUnderwaterScatteringPowerPID = Shader.PropertyToID("_Lux_UnderWaterUnderwaterScatteringPower"); Lux_UnderWaterUnderwaterScatteringIntensityPID = Shader.PropertyToID("_Lux_UnderWaterUnderwaterScatteringIntensity"); Lux_UnderWaterUnderwaterScatteringColorPID = Shader.PropertyToID("_Lux_UnderWaterUnderwaterScatteringColor"); Lux_UnderWaterUnderwaterScatteringOcclusionPID = Shader.PropertyToID("_Lux_UnderwaterScatteringOcclusion"); Lux_UnderWaterCausticsPID = Shader.PropertyToID("_Lux_UnderWaterCaustics"); Lux_UnderWaterDeferredFogParams = Shader.PropertyToID("_LuxUnderWaterDeferredFogParams"); CausticTexPID = Shader.PropertyToID("_CausticTex"); islinear = (int)QualitySettings.desiredColorSpace == 1; if ((Object)(object)PrewarmedShaders != (Object)null && !PrewarmedShaders.isWarmedUp) { PrewarmedShaders.WarmUp(); } if ((Object)(object)Sun != (Object)null) { SunLight = ((Component)Sun).GetComponent<Light>(); } RegisteredWaterVolumesIDs.Capacity = ListCapacity; RegisteredWaterVolumes.Capacity = ListCapacity; WaterMeshes.Capacity = ListCapacity; WaterTransforms.Capacity = ListCapacity; WaterMaterials.Capacity = ListCapacity; WaterIsOnScreen.Capacity = ListCapacity; WaterUsesSlidingVolume.Capacity = ListCapacity; activeWaterVolumeCameras.Capacity = 2; SetDeepwaterLighting(); SetDeferredFogParams(); } private void CleanUp() { instance = null; if ((Object)(object)UnderWaterMask != (Object)null) { UnderWaterMask.Release(); Object.Destroy((Object)(object)UnderWaterMask); } if (Object.op_Implicit((Object)(object)mat)) { Object.Destroy((Object)(object)mat); } if (Object.op_Implicit((Object)(object)blurMaterial)) { Object.Destroy((Object)(object)blurMaterial); } if (Object.op_Implicit((Object)(object)blitMaterial)) { Object.Destroy((Object)(object)blitMaterial); } Shader.DisableKeyword("LUXWATER_DEEPWATERLIGHTING"); Shader.DisableKeyword("LUXWATER_DEFERREDFOG"); } private void OnDisable() { CleanUp(); } private void OnDestroy() { CleanUp(); } private void OnValidate() { SetDeepwaterLighting(); SetDeferredFogParams(); } public void SetDeferredFogParams() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (EnableAdvancedDeferredFog) { Shader.EnableKeyword("LUXWATER_DEFERREDFOG"); Vector4 val = default(Vector4); ((Vector4)(ref val))..ctor((float)(DoUnderWaterRendering ? 1 : 0), FogDepthShift, FogEdgeBlending, 0f); Shader.SetGlobalVector(Lux_UnderWaterDeferredFogParams, val); } else { Shader.DisableKeyword("LUXWATER_DEFERREDFOG"); } } public void SetDeepwaterLighting() { if (EnableDeepwaterLighting) { Shader.EnableKeyword("LUXWATER_DEEPWATERLIGHTING"); if (activeWaterVolume != -1) { Shader.SetGlobalFloat("_Lux_UnderWaterWaterSurfacePos", WaterSurfacePos); } else { Shader.SetGlobalFloat("_Lux_UnderWaterWaterSurfacePos", DefaultWaterSurfacePosition); } Shader.SetGlobalFloat("_Lux_UnderWaterDirLightingDepth", DirectionalLightingFadeRange); Shader.SetGlobalFloat("_Lux_UnderWaterFogLightingDepth", FogLightingFadeRange); } else { Shader.DisableKeyword("LUXWATER_DEEPWATERLIGHTING"); } } public void RegisterWaterVolume(LuxWater_WaterVolume item, int ID, bool visible, bool SlidingVolume) { RegisteredWaterVolumesIDs.Add(ID); RegisteredWaterVolumes.Add(item); WaterMeshes.Add(item.WaterVolumeMesh); WaterMaterials.Add(((Component)((Component)item).transform).GetComponent<Renderer>().sharedMaterial); WaterTransforms.Add(((Component)item).transform); WaterIsOnScreen.Add(visible); WaterUsesSlidingVolume.Add(SlidingVolume); int num = WaterMaterials.Count - 1; Shader.SetGlobalTexture(Lux_UnderWaterCausticsPID, WaterMaterials[num].GetTexture(CausticTexPID)); SetGerstnerWaves(num); } public void DeRegisterWaterVolume(LuxWater_WaterVolume item, int ID) { int num = RegisteredWaterVolumesIDs.IndexOf(ID); if (activeWaterVolume == num) { activeWaterVolume = -1; } RegisteredWaterVolumesIDs.RemoveAt(num); RegisteredWaterVolumes.RemoveAt(num); WaterMeshes.RemoveAt(num); WaterMaterials.RemoveAt(num); WaterTransforms.RemoveAt(num); WaterIsOnScreen.RemoveAt(num); WaterUsesSlidingVolume.RemoveAt(num); } public void SetWaterVisible(int ID) { int index = RegisteredWaterVolumesIDs.IndexOf(ID); WaterIsOnScreen[index] = true; } public void SetWaterInvisible(int ID) { int index = RegisteredWaterVolumesIDs.IndexOf(ID); WaterIsOnScreen[index] = false; } public void EnteredWaterVolume(LuxWater_WaterVolume item, int ID, Camera triggerCam, float GridSize) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) DoUnderWaterRendering = true; int num = RegisteredWaterVolumesIDs.IndexOf(ID); if (num != activeWaterVolume) { activeWaterVolume = num; activeGridSize = GridSize; WaterSurfacePos = WaterTransforms[activeWaterVolume].position.y; for (int i = 0; i < m_aboveWatersurface.Count; i++) { m_aboveWatersurface[i].renderQueue = 2997; } for (int j = 0; j < m_belowWatersurface.Count; j++) { m_belowWatersurface[j].renderQueue = 3001; } } if (!activeWaterVolumeCameras.Contains(triggerCam)) { activeWaterVolumeCameras.Add(triggerCam); } } public void LeftWaterVolume(LuxWater_WaterVolume item, int ID, Camera triggerCam) { DoUnderWaterRendering = false; int num = RegisteredWaterVolumesIDs.IndexOf(ID); if (activeWaterVolume == num) { activeWaterVolume = -1; for (int i = 0; i < m_aboveWatersurface.Count; i++) { m_aboveWatersurface[i].renderQueue = 3000; } for (int j = 0; j < m_belowWatersurface.Count; j++) { m_belowWatersurface[j].renderQueue = 2997; } } if (activeWaterVolumeCameras.Contains(triggerCam)) { activeWaterVolumeCameras.Remove(triggerCam); } } private void OnPreCull() { SetDeferredFogParams(); RenderWaterMask(cam, SecondaryCameraRendering: false); } [ImageEffectOpaque] private void OnRenderImage(RenderTexture src, RenderTexture dest) { RenderUnderWater(src, dest, cam, SecondaryCameraRendering: false); } public void SetGerstnerWaves(int index) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) if (WaterMaterials[index].GetFloat(GerstnerEnabledPID) == 1f) { mat.EnableKeyword("GERSTNERENABLED"); mat.SetVector(LuxWaterMask_GerstnerVertexIntensityPID, WaterMaterials[index].GetVector(GerstnerVertexIntensityPID)); mat.SetVector(LuxWaterMask_GAmplitudePID, WaterMaterials[index].GetVector(GAmplitudePID)); mat.SetVector(LuxWaterMask_GFinalFrequencyPID, WaterMaterials[index].GetVector(GFinalFrequencyPID)); mat.SetVector(LuxWaterMask_GSteepnessPID, WaterMaterials[index].GetVector(GSteepnessPID)); mat.SetVector(LuxWaterMask_GFinalSpeedPID, WaterMaterials[index].GetVector(GFinalSpeedPID)); mat.SetVector(LuxWaterMask_GDirectionABPID, WaterMaterials[index].GetVector(GDirectionABPID)); mat.SetVector(LuxWaterMask_GDirectionCDPID, WaterMaterials[index].GetVector(GDirectionCDPID)); mat.SetVector(LuxWaterMask_GerstnerSecondaryWaves, WaterMaterials[index].GetVector(GerstnerSecondaryWaves)); } else { mat.DisableKeyword("GERSTNERENABLED"); } } public void RenderWaterMask(Camera currentCamera, bool SecondaryCameraRendering) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) Shader.SetGlobalFloat("_Lux_Time", Time.timeSinceLevelLoad); currentCamera.depthTextureMode = (DepthTextureMode)(currentCamera.depthTextureMode | 1); camTransform = ((Component)currentCamera).transform; Profiler.BeginSample("Create UnderWaterMask Tex"); if (!Object.op_Implicit((Object)(object)UnderWaterMask)) { UnderWaterMask = new RenderTexture(currentCamera.pixelWidth, currentCamera.pixelHeight, 24, (RenderTextureFormat)0, (RenderTextureReadWrite)1); } else if (((Texture)UnderWaterMask).width != currentCamera.pixelWidth && !SecondaryCameraRendering) { UnderWaterMask = new RenderTexture(currentCamera.pixelWidth, currentCamera.pixelHeight, 24, (RenderTextureFormat)0, (RenderTextureReadWrite)1); } Shader.SetGlobalTexture(UnderWaterMaskPID, (Texture)(object)UnderWaterMask); Graphics.SetRenderTarget(UnderWaterMask); Profiler.EndSample(); Profiler.BeginSample("Set up Frustum Corners"); currentCamera.CalculateFrustumCorners(new Rect(0f, 0f, 1f, 1f), currentCamera.farClipPlane, currentCamera.stereoActiveEye, frustumCorners); Vector3 val = camTransform.TransformVector(frustumCorners[0]); Vector3 val2 = camTransform.TransformVector(frustumCorners[1]); Vector3 val3 = camTransform.TransformVector(frustumCorners[2]); Vector3 val4 = camTransform.TransformVector(frustumCorners[3]); ((Matrix4x4)(ref frustumCornersArray)).SetRow(0, Vector4.op_Implicit(val)); ((Matrix4x4)(ref frustumCornersArray)).SetRow(1, Vector4.op_Implicit(val4)); ((Matrix4x4)(ref frustumCornersArray)).SetRow(2, Vector4.op_Implicit(val2)); ((Matrix4x4)(ref frustumCornersArray)).SetRow(3, Vector4.op_Implicit(val3)); Shader.SetGlobalMatrix(Lux_FrustumCornersWSPID, frustumCornersArray); Shader.SetGlobalVector(Lux_CameraWSPID, Vector4.op_Implicit(camTransform.position)); Profiler.EndSample(); Profiler.BeginSample("Set up ambient lighting"); ambientProbe = RenderSettings.ambientProbe; ((SphericalHarmonicsL2)(ref ambientProbe)).Evaluate(directions, AmbientLightingSamples); if (islinear) { int lux_UnderWaterAmbientSkyLightPID = Lux_UnderWaterAmbientSkyLightPID; Color val5 = AmbientLightingSamples[0] * RenderSettings.ambientIntensity; Shader.SetGlobalColor(lux_UnderWaterAmbientSkyLightPID, ((Color)(ref val5)).linear); } else { Shader.SetGlobalColor(Lux_UnderWaterAmbientSkyLightPID, AmbientLightingSamples[0] * RenderSettings.ambientIntensity); } Profiler.EndSample(); if (activeWaterVolumeCameras.Contains(currentCamera) || !EnableAdvancedDeferredFog) { } if (activeWaterVolume > -1) { Shader.EnableKeyword("LUXWATERENABLED"); if (!EnableDeepwaterLighting) { Shader.SetGlobalFloat("_Lux_UnderWaterDirLightingDepth", WaterMaterials[activeWaterVolume].GetFloat(Lux_MaxDirLightDepthPID)); Shader.SetGlobalFloat("_Lux_UnderWaterFogLightingDepth", WaterMaterials[activeWaterVolume].GetFloat(Lux_MaxFogLightDepthPID)); } Shader.SetGlobalFloat("_Lux_UnderWaterWaterSurfacePos", WaterSurfacePos); } else { Shader.DisableKeyword("LUXWATERENABLED"); } GL.PushMatrix(); GL.Clear(true, true, Color.black, 1f); camProj = currentCamera.projectionMatrix; GL.LoadProjectionMatrix(camProj); Shader.SetGlobalVector("_WorldSpaceCameraPos", Vector4.op_Implicit(camTransform.position)); Shader.SetGlobalVector("_ProjectionParams", new Vector4(Projection, currentCamera.nearClipPlane, currentCamera.farClipPlane, 1f / currentCamera.farClipPlane)); Shader.SetGlobalVector("_ScreenParams", new Vector4((float)currentCamera.pixelWidth, (float)currentCamera.pixelHeight, 1f + 1f / (float)currentCamera.pixelWidth, 1f + 1f / (float)currentCamera.pixelHeight)); Vector2 val6 = default(Vector2); for (int i = 0; i < RegisteredWaterVolumes.Count; i++) { if ((!WaterIsOnScreen[i] && i != activeWaterVolume) || (!EnableAdvancedDeferredFog && i != activeWaterVolume)) { continue; } WatervolumeMatrix = WaterTransforms[i].localToWorldMatrix; if (WaterUsesSlidingVolume[i]) { Vector3 position = camTransform.position; Vector4 column = ((Matrix4x4)(ref WatervolumeMatrix)).GetColumn(3); Vector3 lossyScale = WaterTransforms[i].lossyScale; ((Vector2)(ref val6))..ctor(activeGridSize * lossyScale.x, activeGridSize * lossyScale.z); float num = (float)Math.Round(position.x / val6.x); float num2 = val6.x * num; num = (float)Math.Round(position.z / val6.y); float num3 = val6.y * num; column.x = num2 + column.x % val6.x; column.z = num3 + column.z % val6.y; ((Matrix4x4)(ref WatervolumeMatrix)).SetColumn(3, column); } Material val7 = WaterMaterials[i]; Profiler.BeginSample("Set up Gerstner"); if (val7.GetFloat(GerstnerEnabledPID) == 1f) { mat.EnableKeyword("GERSTNERENABLED"); mat.SetVector(LuxWaterMask_GerstnerVertexIntensityPID, val7.GetVector(GerstnerVertexIntensityPID)); mat.SetVector(LuxWaterMask_GAmplitudePID, val7.GetVector(GAmplitudePID)); mat.SetVector(LuxWaterMask_GFinalFrequencyPID, val7.GetVector(GFinalFrequencyPID)); mat.SetVector(LuxWaterMask_GSteepnessPID, val7.GetVector(GSteepnessPID)); mat.SetVector(LuxWaterMask_GFinalSpeedPID, val7.GetVector(GFinalSpeedPID)); mat.SetVector(LuxWaterMask_GDirectionABPID, val7.GetVector(GDirectionABPID)); mat.SetVector(LuxWaterMask_GDirectionCDPID, val7.GetVector(GDirectionCDPID)); mat.SetVector(LuxWaterMask_GerstnerSecondaryWaves, val7.GetVector(GerstnerSecondaryWaves)); } else { mat.DisableKeyword("GERSTNERENABLED"); } Profiler.EndSample(); Profiler.BeginSample("Draw Water Mask"); bool flag = val7.HasProperty(Lux_EdgeLengthPID) && SystemInfo.graphicsShaderLevel >= 46; if (flag) { mat.SetFloat(Lux_EdgeLengthPID, val7.GetFloat(Lux_EdgeLengthPID)); } Profiler.BeginSample("Draw Water Volume"); if (i == activeWaterVolume && activeWaterVolumeCameras.Contains(currentCamera)) { if (WaterUsesSlidingVolume[i] && flag) { mat.SetPass(5); } else { mat.SetPass(0); } Graphics.DrawMeshNow(WaterMeshes[i], WatervolumeMatrix, 0); } Profiler.EndSample(); if ((i == activeWaterVolume && activeWaterVolumeCameras.Contains(currentCamera)) || EnableAdvancedDeferredFog) { if (flag) { if (i == activeWaterVolume) { mat.SetPass(3); } else { mat.SetPass(4); } } else if (i == activeWaterVolume) { mat.SetPass(1); } else { mat.SetPass(2); } Graphics.DrawMeshNow(WaterMeshes[i], WatervolumeMatrix, 1); } Profiler.EndSample(); } GL.PopMatrix(); } public void RenderUnderWater(RenderTexture src, RenderTexture dest, Camera currentCamera, bool SecondaryCameraRendering) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) if (activeWaterVolumeCameras.Contains(currentCamera)) { if (DoUnderWaterRendering && activeWaterVolume > -1) { if (!UnderwaterIsSetUp) { if (Object.op_Implicit((Object)(object)Sun)) { Vector3 val = -Sun.forward; Color val2 = SunLight.color * SunLight.intensity; if (islinear) { val2 = ((Color)(ref val2)).linear; } Shader.SetGlobalColor(Lux_UnderWaterSunColorPID, val2 * Mathf.Clamp01(Vector3.Dot(val, Vector3.up))); Shader.SetGlobalVector(Lux_UnderWaterSunDirPID, Vector4.op_Implicit(-val)); Shader.SetGlobalVector(Lux_UnderWaterSunDirViewSpacePID, Vector4.op_Implicit(currentCamera.WorldToViewportPoint(((Component)currentCamera).transform.position - val * 1000f))); } if (WaterMaterials[activeWaterVolume].GetFloat(Lux_CausticsEnabledPID) == 1f) { blitMaterial.EnableKeyword("GEOM_TYPE_FROND"); if (WaterMaterials[activeWaterVolume].GetFloat(Lux_CausticModePID) == 1f) { blitMaterial.EnableKeyword("GEOM_TYPE_LEAF"); } else { blitMaterial.DisableKeyword("GEOM_TYPE_LEAF"); } } else { blitMaterial.DisableKeyword("GEOM_TYPE_FROND"); } if (islinear) { int lux_UnderWaterFogColorPID = Lux_UnderWaterFogColorPID; Color color = WaterMaterials[activeWaterVolume].GetColor("_Color"); Shader.SetGlobalColor(lux_UnderWaterFogColorPID, ((Color)(ref color)).linear); } else { Shader.SetGlobalColor(Lux_UnderWaterFogColorPID, WaterMaterials[activeWaterVolume].GetColor("_Color")); } Shader.SetGlobalFloat(Lux_UnderWaterFogDensityPID, WaterMaterials[activeWaterVolume].GetFloat("_Density")); Shader.SetGlobalFloat(Lux_UnderWaterFogAbsorptionCancellationPID, WaterMaterials[activeWaterVolume].GetFloat("_FogAbsorptionCancellation")); Shader.SetGlobalFloat(Lux_UnderWaterAbsorptionHeightPID, WaterMaterials[activeWaterVolume].GetFloat("_AbsorptionHeight")); Shader.SetGlobalFloat(Lux_UnderWaterAbsorptionMaxHeightPID, WaterMaterials[activeWaterVolume].GetFloat("_AbsorptionMaxHeight")); Shader.SetGlobalFloat(Lux_UnderWaterAbsorptionDepthPID, WaterMaterials[activeWaterVolume].GetFloat("_AbsorptionDepth")); Shader.SetGlobalFloat(Lux_UnderWaterAbsorptionColorStrengthPID, WaterMaterials[activeWaterVolume].GetFloat("_AbsorptionColorStrength")); Shader.SetGlobalFloat(Lux_UnderWaterAbsorptionStrengthPID, WaterMaterials[activeWaterVolume].GetFloat("_AbsorptionStrength")); Shader.SetGlobalFloat(Lux_UnderWaterUnderwaterScatteringPowerPID, WaterMaterials[activeWaterVolume].GetFloat("_ScatteringPower")); Shader.SetGlobalFloat(Lux_UnderWaterUnderwaterScatteringIntensityPID, WaterMaterials[activeWaterVolume].GetFloat("_UnderwaterScatteringIntensity")); if (islinear) { int lux_UnderWaterUnderwaterScatteringColorPID = Lux_UnderWaterUnderwaterScatteringColorPID; Color color2 = WaterMaterials[activeWaterVolume].GetColor("_TranslucencyColor"); Shader.SetGlobalColor(lux_UnderWaterUnderwaterScatteringColorPID, ((Color)(ref color2)).linear); } else { Shader.SetGlobalColor(Lux_UnderWaterUnderwaterScatteringColorPID, WaterMaterials[activeWaterVolume].GetColor("_TranslucencyColor")); } Shader.SetGlobalFloat(Lux_UnderWaterUnderwaterScatteringOcclusionPID, WaterMaterials[activeWaterVolume].GetFloat("_ScatterOcclusion")); Shader.SetGlobalTexture(Lux_UnderWaterCausticsPID, WaterMaterials[activeWaterVolume].GetTexture(CausticTexPID)); Shader.SetGlobalFloat("_Lux_UnderWaterCausticsTiling", WaterMaterials[activeWaterVolume].GetFloat("_CausticsTiling")); Shader.SetGlobalFloat("_Lux_UnderWaterCausticsScale", WaterMaterials[activeWaterVolume].GetFloat("_CausticsScale")); Shader.SetGlobalFloat("_Lux_UnderWaterCausticsSpeed", WaterMaterials[activeWaterVolume].GetFloat("_CausticsSpeed")); Shader.SetGlobalFloat("_Lux_UnderWaterCausticsTiling", WaterMaterials[activeWaterVolume].GetFloat("_CausticsTiling")); Shader.SetGlobalFloat("_Lux_UnderWaterCausticsSelfDistortion", WaterMaterials[activeWaterVolume].GetFloat("_CausticsSelfDistortion")); Shader.SetGlobalVector("_Lux_UnderWaterFinalBumpSpeed01", WaterMaterials[activeWaterVolume].GetVector("_FinalBumpSpeed01")); Shader.SetGlobalVector("_Lux_UnderWaterFogDepthAtten", WaterMaterials[activeWaterVolume].GetVector("_DepthAtten")); } Graphics.Blit((Texture)(object)src, dest, blitMaterial, 0); } else { Graphics.Blit((Texture)(object)src, dest); } } else { Graphics.Blit((Texture)(object)src, dest); } } private void OnDrawGizmos() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (enableDebug && !((Object)(object)cam == (Object)null) && !((Object)(object)UnderWaterMask == (Object)null)) { int num = (int)(cam.aspect * 128f); GL.PushMatrix(); GL.LoadPixelMatrix(0f, (float)Screen.width, (float)Screen.height, 0f); Graphics.DrawTexture(new Rect(0f, 0f, (float)num, 128f), (Texture)(object)UnderWaterMask); GL.PopMatrix(); } } private void OnGUI() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (enableDebug) { TextAnchor alignment = GUI.skin.label.alignment; GUI.skin.label.alignment = (TextAnchor)3; if (activeWaterVolume == -1) { GUI.Label(new Rect(10f, 0f, 160f, 40f), "Active water volume: none\nRegistered volumes: " + RegisteredWaterVolumes.Count); } else { GUI.Label(new Rect(10f, 0f, 400f, 40f), "Active water volume: " + ((Object)((Component)((Component)RegisteredWaterVolumes[activeWaterVolume]).transform).gameObject).name + "\nRegistered volumes: " + RegisteredWaterVolumes.Count); } GUI.skin.label.alignment = alignment; } } } [RequireComponent(typeof(Camera))] public class LuxWater_UnderwaterRenderingSlave : MonoBehaviour { private LuxWater_UnderWaterRendering waterrendermanager; private bool readyToGo = false; public Camera cam; private void OnEnable() { cam = ((Component)this).GetComponent<Camera>(); ((MonoBehaviour)this).Invoke("GetWaterrendermanager", 0f); } private void GetWaterrendermanager() { LuxWater_UnderWaterRendering instance = LuxWater_UnderWaterRendering.instance; if ((Object)(object)instance != (Object)null) { waterrendermanager = instance; readyToGo = true; } } private void OnPreCull() { if (readyToGo) { waterrendermanager.RenderWaterMask(cam, SecondaryCameraRendering: true); } } [ImageEffectOpaque] private void OnRenderImage(RenderTexture src, RenderTexture dest) { if (readyToGo) { waterrendermanager.RenderUnderWater(src, dest, cam, SecondaryCameraRendering: true); } else { Graphics.Blit((Texture)(object)src, dest); } } } public class LuxWater_WaterVolume : MonoBehaviour { public delegate void TriggerEnter(); public delegate void TriggerExit(); [Space(6f)] [LuxWater_HelpBtn("h.86taxuhovssb")] public Mesh WaterVolumeMesh; [Space(8f)] public bool SlidingVolume = false; public float GridSize = 10f; private LuxWater_UnderWaterRendering waterrendermanager; private bool readyToGo = false; private int ID; public static event TriggerEnter OnEnterWaterVolume; public static event TriggerExit OnExitWaterVolume; private void OnEnable() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)WaterVolumeMesh == (Object)null) { Debug.Log((object)"No WaterVolumeMesh assigned."); return; } ID = ((Object)this).GetInstanceID(); ((MonoBehaviour)this).Invoke("Register", 0f); Renderer component = ((Component)this).GetComponent<Renderer>(); component.shadowCastingMode = (ShadowCastingMode)0; Material sharedMaterial = component.sharedMaterial; sharedMaterial.EnableKeyword("USINGWATERVOLUME"); sharedMaterial.SetFloat("_WaterSurfaceYPos", ((Component)this).transform.position.y); } private void OnDisable() { if (Object.op_Implicit((Object)(object)waterrendermanager)) { waterrendermanager.DeRegisterWaterVolume(this, ID); } readyToGo = false; ((Component)this).GetComponent<Renderer>().sharedMaterial.DisableKeyword("USINGWATERVOLUME"); } private void Register() { LuxWater_UnderWaterRendering instance = LuxWater_UnderWaterRendering.instance; if ((Object)(object)instance != (Object)null) { waterrendermanager = LuxWater_UnderWaterRendering.instance; bool isVisible = ((Component)this).GetComponent<Renderer>().isVisible; waterrendermanager.RegisterWaterVolume(this, ID, isVisible, SlidingVolume); readyToGo = true; } else { ((MonoBehaviour)this).Invoke("Register", 0f); } } private void OnBecameVisible() { if (readyToGo) { waterrendermanager.SetWaterVisible(ID); } } private void OnBecameInvisible() { if (readyToGo) { waterrendermanager.SetWaterInvisible(ID); } } private void OnTriggerEnter(Collider other) { LuxWater_WaterVolumeTrigger component = ((Component)other).GetComponent<LuxWater_WaterVolumeTrigger>(); if ((Object)(object)component != (Object)null && (Object)(object)waterrendermanager != (Object)null && readyToGo && component.active) { waterrendermanager.EnteredWaterVolume(this, ID, component.cam, GridSize); if (LuxWater_WaterVolume.OnEnterWaterVolume != null) { LuxWater_WaterVolume.OnEnterWaterVolume(); } }
ModmasMap_2023.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using System.Text; using Atlas; using BepInEx; using BepInEx.Logging; using FistVR; using UnityEditor; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Windows.Speech; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] public class CameraRange : MonoBehaviour { public float minDistance = 0.02f; public float maxDistance = 2000f; private Camera[] cameras; private GameObject[] dndObjects; private void Start() { ((MonoBehaviour)this).Invoke("DelayedStart", 5f); } private void DelayedStart() { Debug.Log((object)"Attempting to find cameras"); dndObjects = GetDontDestroyOnLoadObjects(); cameras = Object.FindObjectsOfType<Camera>(); for (int i = 0; i < cameras.Length; i++) { Debug.Log((object)("Camera " + i + " default Near/Far values: " + cameras[i].nearClipPlane + " / " + cameras[i].farClipPlane)); cameras[i].nearClipPlane = minDistance; cameras[i].farClipPlane = maxDistance; } if (dndObjects == null) { return; } for (int j = 0; j < dndObjects.Length; j++) { Camera component = dndObjects[j].GetComponent<Camera>(); if ((Object)(object)component != (Object)null) { Debug.Log((object)("Camera " + j + " default Near/Far values: " + component.nearClipPlane + " / " + component.farClipPlane)); component.nearClipPlane = minDistance; component.farClipPlane = maxDistance; } } } public static GameObject[] GetDontDestroyOnLoadObjects() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; try { val = new GameObject(); Object.DontDestroyOnLoad((Object)(object)val); Scene scene = val.scene; Object.DestroyImmediate((Object)(object)val); val = null; return ((Scene)(ref scene)).GetRootGameObjects(); } finally { if ((Object)(object)val != (Object)null) { Object.DestroyImmediate((Object)(object)val); } } } } public class NonVerbalPuller : MonoBehaviour { public TrapThrower House; public LayerMask CheckForAim; public float FillTime; public float FillMultiplier; public float FillAmount; public Image fillBar; private float m_fillDelayTimer = 0f; public AudioClip pullConfirmation; private void Start() { } private void Update() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) if (House.isPlaying) { fillBar.fillAmount = FillAmount; if (m_fillDelayTimer <= 0f) { FVRFireArm val = null; bool flag = false; if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable != (Object)null) { Component component = ((Component)GM.CurrentMovementManager.Hands[1].CurrentInteractable).GetComponent(typeof(FVRFireArm)); val = (FVRFireArm)(object)((component is FVRFireArm) ? component : null); RaycastHit val2 = default(RaycastHit); if ((Object)(object)val != (Object)null && Physics.Raycast(val.MuzzlePos.position, val.MuzzlePos.forward, ref val2, 100f, LayerMask.op_Implicit(CheckForAim)) && ((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name == "Non-Verbal Puller") { flag = true; } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].CurrentInteractable != (Object)null) { Component component2 = ((Component)GM.CurrentMovementManager.Hands[0].CurrentInteractable).GetComponent(typeof(FVRFireArm)); val = (FVRFireArm)(object)((component2 is FVRFireArm) ? component2 : null); RaycastHit val3 = default(RaycastHit); if ((Object)(object)val != (Object)null && Physics.Raycast(val.MuzzlePos.position, val.MuzzlePos.forward, ref val3, 100f, LayerMask.op_Implicit(CheckForAim)) && ((Object)((Component)((RaycastHit)(ref val3)).collider).gameObject).name == "Non-Verbal Puller") { flag = true; } } if (!flag) { if (FillAmount > 0f) { FillAmount -= Time.deltaTime * FillMultiplier; } else { FillAmount = 0f; } } else if (flag) { FillAmount += Time.deltaTime * FillMultiplier; } } else if (m_fillDelayTimer >= 0f) { m_fillDelayTimer -= Time.deltaTime; } } if (FillAmount >= 1f) { filled(); } } public void filled() { House.LaunchSoundSource.PlayOneShot(pullConfirmation, 0.4f); m_fillDelayTimer = 2f; fillBar.fillAmount = 0f; FillAmount = 0f; ((MonoBehaviour)House).StartCoroutine(House.TickToThrow(House.timeToFire)); } } public class NonverbalSkeetPuller : MonoBehaviour { public SkeetRange House; public LayerMask CheckForAim; public float FillTime; public float FillMultiplier; public float FillAmount; public Image fillBar; private float m_fillDelayTimer = 0f; public AudioClip pullConfirmation; private void Update() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) if (House.isPlaying || House.isPracticing) { fillBar.fillAmount = FillAmount; if (m_fillDelayTimer <= 0f) { FVRFireArm val = null; bool flag = false; if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable != (Object)null) { Component component = ((Component)GM.CurrentMovementManager.Hands[1].CurrentInteractable).GetComponent(typeof(FVRFireArm)); val = (FVRFireArm)(object)((component is FVRFireArm) ? component : null); RaycastHit val2 = default(RaycastHit); if ((Object)(object)val != (Object)null && Physics.Raycast(val.MuzzlePos.position, val.MuzzlePos.forward, ref val2, 100f, LayerMask.op_Implicit(CheckForAim)) && ((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name == "Non-Verbal Puller") { flag = true; } } if ((Object)(object)GM.CurrentMovementManager.Hands[0].CurrentInteractable != (Object)null) { Component component2 = ((Component)GM.CurrentMovementManager.Hands[0].CurrentInteractable).GetComponent(typeof(FVRFireArm)); val = (FVRFireArm)(object)((component2 is FVRFireArm) ? component2 : null); RaycastHit val3 = default(RaycastHit); if ((Object)(object)val != (Object)null && Physics.Raycast(val.MuzzlePos.position, val.MuzzlePos.forward, ref val3, 100f, LayerMask.op_Implicit(CheckForAim)) && ((Object)((Component)((RaycastHit)(ref val3)).collider).gameObject).name == "Non-Verbal Puller") { flag = true; } } if (!flag) { if (FillAmount > 0f) { FillAmount -= Time.deltaTime * FillMultiplier; } else { FillAmount = 0f; } } else if (flag) { FillAmount += Time.deltaTime * FillMultiplier; } } else if (m_fillDelayTimer >= 0f) { m_fillDelayTimer -= Time.deltaTime; } } if (FillAmount >= 1f) { filled(); } } public void filled() { House.LoudSpeaker.PlayOneShot(pullConfirmation, 0.4f); m_fillDelayTimer = 2f; fillBar.fillAmount = 0f; FillAmount = 0f; ((MonoBehaviour)House).StartCoroutine(House.TickToThrow(House.timeToFire)); } } public class PlayerMarker : MonoBehaviour { public GameObject OutsideMesh; public void OnTriggerEnter(Collider other) { if (((Component)other).gameObject.layer == 15) { OutsideMesh.SetActive(false); } } public void OnTriggerExit(Collider other) { if (((Component)other).gameObject.layer == 15) { OutsideMesh.SetActive(true); } } } public class SkeetFieldCollider : MonoBehaviour { public SkeetRange House; public void OnTriggerEnter(Collider other) { Debug.Log((object)((Object)(object)((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>() != (Object)null)); if ((Object)(object)((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>() != (Object)null && ((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>().ObjectWrapper.ItemID == House.Things[House.m_currentThingToThrow].ItemID) { House.TargetReachedGround(((Component)((Component)other).transform.root).gameObject); } } } public class SkeetRange : MonoBehaviour { public enum WhereToThrowFrom { high, low, both } public bool isInSequence = false; public bool isPlaying = false; public int ThrowCount = 0; public int currentThrows = 0; public int currentScore = 0; private int lastScore = 0; public FVRObject[] Things; public int m_currentThingToThrow = 0; [Tooltip("Material to apply to thrown targets for easier visibility")] public Material thingMaterial; public List<UberShatterable> targets; public List<WhereToThrowFrom> Sequence; private WhereToThrowFrom currentThrowPos; public SkeetTablet Tablet; [Header("Throw Positions")] public Transform HighHouseTrap; public Transform LowHouseTrap; public Transform CrossPoint; [Header("Audio Things")] public List<AudioClip> StationChangingVoiceLines; public List<AudioClip> FinalOption; public AudioSource HighHouseSource; public AudioSource LowHouseSource; public AudioClip ThrowSound; public AudioSource LoudSpeaker; public AudioClip StartSound; public AudioClip FinishSound; public string[] wordsToRecognize; [Header("Throwing Modifiers")] public float timeToFire = 0.3f; public float velocityRange = 1f; public float m_VelocityBase = 18f; public float AngularRangeX; public float AngularRangeY = 1f; public float rigidbodyDrag = 1f; public float UpwardForce = 1f; private GravityMode gravityType; [Header("Marker")] public GameObject Marker; public List<Transform> MarkerLocations; [Header("Debug")] public bool isDebug = false; public WhereToThrowFrom debugThrowLocation; [Header("Practice Stuff")] private WhereToThrowFrom PRL; public bool isPracticing = false; private void Start() { HighHouseTrap.LookAt(CrossPoint); LowHouseTrap.LookAt(CrossPoint); } private void M_Recognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args) { } public void Recognized(float TimeTooken) { if (!isInSequence) { float num = timeToFire; num -= TimeTooken; ((MonoBehaviour)this).StartCoroutine(TickToThrow(num)); } } public void RecognizedPractice(float TimeTooken) { float num = timeToFire; num -= TimeTooken; ((MonoBehaviour)this).StartCoroutine(PacticeTickToThrow(num)); } private void Update() { if (isDebug) { ((MonoBehaviour)this).StartCoroutine(TickToThrow(0f)); } if (!isPlaying) { return; } if (lastScore != currentScore) { Tablet.Score.text = currentScore.ToString(); lastScore = currentScore; } if (isInSequence && targets.Count == 0) { SequenceUpdate(); } foreach (UberShatterable target in targets) { if ((Object)(object)target == (Object)null || target.HasShattered()) { currentScore++; targets.Remove(target); break; } } } public IEnumerator TickToThrow(float time) { if (time > 0f) { yield return (object)new WaitForSeconds(time); TimeIsUp(); } else if (time <= 0f) { TimeIsUp(); } yield return null; } public void TimeIsUp() { if (isPlaying && !isDebug) { ThrowThing(currentThrowPos); } else if (isDebug) { ThrowThing(debugThrowLocation); } } private void ThrowThing(WhereToThrowFrom pos) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; isInSequence = true; switch (pos) { case WhereToThrowFrom.high: { val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), HighHouseTrap.position, HighHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; HighHouseSource.pitch = Random.Range(0.97f, 1.03f); HighHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; UberShatterable component3 = val.GetComponent<UberShatterable>(); targets.Add(component3); currentThrows++; ThrowCount++; break; } case WhereToThrowFrom.low: { val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), LowHouseTrap.position, LowHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; LowHouseSource.pitch = Random.Range(0.97f, 1.03f); LowHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; UberShatterable component4 = val.GetComponent<UberShatterable>(); targets.Add(component4); currentThrows++; ThrowCount++; break; } case WhereToThrowFrom.both: { val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), HighHouseTrap.position, HighHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; HighHouseSource.pitch = Random.Range(0.97f, 1.03f); HighHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; UberShatterable component = val.GetComponent<UberShatterable>(); targets.Add(component); GameObject val2 = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), LowHouseTrap.position, LowHouseTrap.rotation); val2.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val2.GetComponent<Rigidbody>().velocity = val2.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val2.GetComponent<Rigidbody>().angularVelocity = val2.transform.up * 10f; val2.GetComponent<Rigidbody>().drag = rigidbodyDrag; val2.AddComponent<KillAfter>().DieTime = 12f; if ((Object)(object)thingMaterial != (Object)null) { ((Renderer)val2.GetComponentInChildren<MeshRenderer>()).material = thingMaterial; } LowHouseSource.pitch = Random.Range(0.97f, 1.03f); LowHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; UberShatterable component2 = val2.GetComponent<UberShatterable>(); targets.Add(component2); currentThrows++; ThrowCount++; ThrowCount++; break; } } if ((Object)(object)thingMaterial != (Object)null) { ((Renderer)val.GetComponentInChildren<MeshRenderer>()).material = thingMaterial; } isInSequence = true; Tablet.ThrowCount.text = ThrowCount.ToString(); } public void SequenceUpdate() { isInSequence = false; if (currentThrows < Sequence.Count - 1) { currentThrowPos = Sequence[currentThrows]; NextStation(); } else if (currentThrows == 24 && currentScore == 24) { currentThrowPos = Sequence[Sequence.Count - 1]; } else { FinishGame(); } } public void StartGame() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) TrapThrower.I.StartStopRecognizer(start: true); gravityType = GM.Options.SimulationOptions.ObjectGravityMode; GM.Options.SimulationOptions.ObjectGravityMode = (GravityMode)1; isPlaying = true; Marker.SetActive(true); Marker.transform.SetPositionAndRotation(MarkerLocations[0].position, MarkerLocations[0].rotation); ThrowCount = 0; currentThrows = 0; currentScore = 0; LoudSpeaker.PlayOneShot(StartSound, 0.4f); Tablet.Score.text = currentScore.ToString(); Tablet.ThrowCount.text = currentThrows.ToString(); Tablet.GameScreenMainMenu.SetActive(false); currentThrowPos = WhereToThrowFrom.high; } public void FinishGame() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) Marker.SetActive(false); isPlaying = false; TrapThrower.I.StartStopRecognizer(start: false); Tablet.GameScreenMainMenu.SetActive(true); Tablet.addScore(currentScore); LoudSpeaker.PlayOneShot(FinishSound, 0.4f); GM.Options.SimulationOptions.ObjectGravityMode = gravityType; } public int chooseVoiceLIne() { return Random.Range(0, StationChangingVoiceLines.Count - 1); } public void NextStation() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) if (currentThrows != 0) { if (ThrowCount == 4) { Marker.transform.SetPositionAndRotation(MarkerLocations[1].position, MarkerLocations[1].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 8) { Marker.transform.SetPositionAndRotation(MarkerLocations[2].position, MarkerLocations[2].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 10) { Marker.transform.SetPositionAndRotation(MarkerLocations[3].position, MarkerLocations[3].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 12) { Marker.transform.SetPositionAndRotation(MarkerLocations[4].position, MarkerLocations[4].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 14) { Marker.transform.SetPositionAndRotation(MarkerLocations[5].position, MarkerLocations[5].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 18) { Marker.transform.SetPositionAndRotation(MarkerLocations[6].position, MarkerLocations[6].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 22) { Marker.transform.SetPositionAndRotation(MarkerLocations[7].position, MarkerLocations[7].rotation); LoudSpeaker.PlayOneShot(StationChangingVoiceLines[chooseVoiceLIne()], 1f); } else if (ThrowCount == 24) { LoudSpeaker.PlayOneShot(FinalOption[chooseVoiceLIne()], 1f); } } } public void TargetReachedGround(GameObject target) { UberShatterable component = target.GetComponent<UberShatterable>(); if ((Object)(object)component != (Object)null && targets.Contains(component)) { targets.Remove(component); } } public void StartPractice() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) isPracticing = true; TrapThrower.I.StartStopRecognizer(start: true); Tablet.changeTab(Tablet.PracticeTab); gravityType = GM.Options.SimulationOptions.ObjectGravityMode; GM.Options.SimulationOptions.ObjectGravityMode = (GravityMode)1; isInSequence = true; isInSequence = false; } public void StopPractice() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) isPracticing = false; Tablet.changeTab(Tablet.MainMenu); TrapThrower.I.StartStopRecognizer(start: false); GM.Options.SimulationOptions.ObjectGravityMode = gravityType; } public void ChangePracticeThrowPosition(WhereToThrowFrom pos) { PRL = pos; switch (pos) { case WhereToThrowFrom.high: Tablet.CurrentThrowPos.text = "Currently throwing from the high house"; break; case WhereToThrowFrom.low: Tablet.CurrentThrowPos.text = "Currently throwing from the low house"; break; case WhereToThrowFrom.both: Tablet.CurrentThrowPos.text = "Currently throwing from both houses"; break; } } public IEnumerator PacticeTickToThrow(float time) { if (time > 0f) { yield return (object)new WaitForSeconds(time); PracticeThrow(PRL); } else if (time <= 0f) { PracticeThrow(PRL); } yield return null; } public void PracticeThrow(WhereToThrowFrom pos) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; switch (pos) { case WhereToThrowFrom.high: val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), HighHouseTrap.position, HighHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; HighHouseSource.pitch = Random.Range(0.97f, 1.03f); HighHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; break; case WhereToThrowFrom.low: val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), LowHouseTrap.position, LowHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; LowHouseSource.pitch = Random.Range(0.97f, 1.03f); LowHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; break; case WhereToThrowFrom.both: { val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), HighHouseTrap.position, HighHouseTrap.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; HighHouseSource.pitch = Random.Range(0.97f, 1.03f); HighHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; GameObject val2 = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), LowHouseTrap.position, LowHouseTrap.rotation); val2.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngularRangeY, AngularRangeY), 0f)); val2.GetComponent<Rigidbody>().velocity = val2.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val2.GetComponent<Rigidbody>().angularVelocity = val2.transform.up * 10f; val2.GetComponent<Rigidbody>().drag = rigidbodyDrag; val2.AddComponent<KillAfter>().DieTime = 12f; if ((Object)(object)thingMaterial != (Object)null) { ((Renderer)val2.GetComponentInChildren<MeshRenderer>()).material = thingMaterial; } LowHouseSource.pitch = Random.Range(0.97f, 1.03f); LowHouseSource.PlayOneShot(ThrowSound, 0.4f); HighHouseSource.pitch = 1f; break; } } if ((Object)(object)thingMaterial != (Object)null) { ((Renderer)val.GetComponentInChildren<MeshRenderer>()).material = thingMaterial; } } } public class SkeetTablet : MonoBehaviour { public SkeetRange range; public Text Score; public Text ThrowCount; public GameObject MainMenu; public GameObject ActiveGameScreen; public GameObject GameScreenMainMenu; public List<GameObject> tabs; public List<string> Previous10Scores; public Text ScoreDisplay; [Header("practice stuff")] public GameObject PracticeTab; public Text CurrentThrowPos; private void Start() { } private void Update() { } public void startSequence() { foreach (GameObject tab in tabs) { if ((Object)(object)tab != (Object)(object)ActiveGameScreen) { tab.SetActive(false); } else if ((Object)(object)tab == (Object)(object)ActiveGameScreen) { tab.SetActive(true); } } range.StartGame(); } public void changeTab(GameObject tablet) { foreach (GameObject tab in tabs) { if ((Object)(object)tab != (Object)(object)tablet) { tab.SetActive(false); } else { tab.SetActive(true); } } } public void addScore(int score) { for (int num = 9; num > 0; num--) { Previous10Scores[num] = Previous10Scores[num - 1]; } Previous10Scores[0] = score.ToString(); ScoreDisplay.text = ListToText(Previous10Scores); } private string ListToText(List<string> list) { string text = ""; foreach (string item in list) { text = text + item.ToString() + "\n"; } return text; } } public class SkeetTabletButton : MonoBehaviour { public int arrayPositionOfSpawnable; public SkeetRange House; public SkeetTablet tablet; public GameObject TabToChangeTo; [Header("What location will this button make the clay throw from. requires the House to be filled out")] public SkeetRange.WhereToThrowFrom practiceThrowLocation; public void changeThrowingItem() { House.m_currentThingToThrow = arrayPositionOfSpawnable; } public void changeTab() { tablet.changeTab(TabToChangeTo); } public void changePracticeThrowLocation() { House.ChangePracticeThrowPosition(practiceThrowLocation); } } public class TrapCollider : MonoBehaviour { public TrapThrower House; public GameObject OutsideMesh; private bool isPlayerin = false; public void OnTriggerEnter(Collider other) { if (((Component)other).gameObject.layer == 15) { OutsideMesh.SetActive(false); House.isPlayerInCollider = true; } } public void OnTriggerExit(Collider other) { if (((Component)other).gameObject.layer == 15) { OutsideMesh.SetActive(true); House.isPlayerInCollider = false; } } } public class TrapField : MonoBehaviour { public TrapThrower House; public void OnTriggerEnter(Collider other) { Debug.Log((object)((Object)(object)((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>() != (Object)null)); if ((Object)(object)((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>() != (Object)null && ((Component)((Component)other).transform.root).GetComponent<FVRPhysicalObject>().ObjectWrapper.ItemID == House.Things[House.m_currentThingToThrow].ItemID) { House.TargetReachedGround(((Component)((Component)other).transform.root).gameObject); } } } public class TrapTablet : MonoBehaviour { public TrapThrower House; public Text Score; public Text ThrowCount; public GameObject MainMenu; public GameObject ActiveGameScreen; public GameObject GameScreenMainMenu; public List<GameObject> tabs; public List<string> Previous10Scores; public Text ScoreDisplay; private void Update() { if (House.currentThrows >= 25) { House.FinishGame(); } } public void startSequence() { foreach (GameObject tab in tabs) { if ((Object)(object)tab != (Object)(object)ActiveGameScreen) { tab.SetActive(false); } else if ((Object)(object)tab == (Object)(object)ActiveGameScreen) { tab.SetActive(true); } } House.StartGame(); } public void changeTab(GameObject tablet) { foreach (GameObject tab in tabs) { if ((Object)(object)tab != (Object)(object)tablet) { tab.SetActive(false); } else { tab.SetActive(true); } } } public void addScore(int score) { for (int num = 9; num > 0; num--) { Previous10Scores[num] = Previous10Scores[num - 1]; } Previous10Scores[0] = score.ToString(); ScoreDisplay.text = ListToText(Previous10Scores); } private string ListToText(List<string> list) { string text = ""; foreach (string item in list) { text = text + item.ToString() + "\n"; } return text; } } public class TrapTabletButton : MonoBehaviour { public int arrayPositionOfSpawnable; public TrapThrower House; public TrapTablet tablet; public GameObject TabToChangeTo; public void changeThrowingItem() { House.m_currentThingToThrow = arrayPositionOfSpawnable; } public void changeTab() { tablet.changeTab(TabToChangeTo); } } public class TrapThrower : MonoBehaviour { public enum ShotgunGames { TRAP, SKEET, WOBBLETRAP } public string[] wordsToRecognize; public bool isPlaying = false; public TrapTablet Tablet; public ShotgunGames GameType; public Transform LaunchPos1; public Transform LaunchPos2; public FVRObject[] Things; public int m_currentThingToThrow = 0; [Tooltip("Material to apply to thrown targets for easier visibility")] public Material thingMaterial; public AudioSource LoudSpeaker; public AudioSource LaunchSoundSource; public AudioClip LaunchSound; public float velocityRange = 1f; public float m_VelocityBase = 18f; public float AngularRangeX; public float AngulatRangeY = 5f; public KeywordRecognizer m_Recognizer; public static TrapThrower I; public float timeToFire = 1f; public List<UberShatterable> targets; public int currentScore = 0; private int lastScore = 0; public int currentThrows = 0; public bool waitingForFinish = false; public AudioClip StartBuzzer; public AudioClip FinishBuzzer; public List<AudioClip> FiveThrowVoiceLines; [Header("Tutorial stuff")] public bool isTutorial = false; public bool isPlayerInCollider = false; public GameObject PlaceMarker; public List<Transform> TRAPcolliderPoints; public List<AudioClip> EnterTheCollisionBox; public bool isdebug = false; public float debugTime = 1f; public float rigidbodyDrag = 1f; public float UpwardForce = 1f; private GravityMode gravityType; public SkeetRange SkeetRange; private bool isKeywordListenerUsed = false; private void Start() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown I = this; m_Recognizer = new KeywordRecognizer(wordsToRecognize, (ConfidenceLevel)2); if (m_Recognizer != null) { ((PhraseRecognizer)m_Recognizer).OnPhraseRecognized += new PhraseRecognizedDelegate(M_Recognizer_OnPhraseRecognized); } } public void StartStopRecognizer(bool start) { if (m_Recognizer == null) { return; } if (start && !isKeywordListenerUsed) { if (!((PhraseRecognizer)m_Recognizer).IsRunning) { ((PhraseRecognizer)m_Recognizer).Start(); } isKeywordListenerUsed = true; } else if (!start) { if (((PhraseRecognizer)m_Recognizer).IsRunning) { ((PhraseRecognizer)m_Recognizer).Stop(); } isKeywordListenerUsed = false; } else if (start && isKeywordListenerUsed) { Debug.Log((object)"Keyword Listener is already in use. Please report how you got this message to Arpy"); } } private void M_Recognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args) { if (SkeetRange.isPlaying) { SkeetRange skeetRange = SkeetRange; TimeSpan phraseDuration = args.phraseDuration; skeetRange.Recognized(phraseDuration.Seconds); return; } if (SkeetRange.isPracticing) { SkeetRange skeetRange2 = SkeetRange; TimeSpan phraseDuration2 = args.phraseDuration; skeetRange2.RecognizedPractice(phraseDuration2.Seconds); return; } Debug.Log((object)"recognized"); float num = timeToFire; float num2 = num; TimeSpan phraseDuration3 = args.phraseDuration; num = num2 - (float)phraseDuration3.Seconds; ((MonoBehaviour)this).StartCoroutine(TickToThrow(num)); } private void Update() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (isdebug) { ((MonoBehaviour)this).StartCoroutine(TickToThrow(debugTime)); } if (lastScore != currentScore) { Tablet.Score.text = currentScore.ToString(); lastScore = currentScore; } if (isPlaying) { } foreach (UberShatterable target in targets) { if ((Object)(object)target == (Object)null || target.HasShattered()) { currentScore++; targets.Remove(target); break; } if ((int)gravityType == 0) { ((Component)target).gameObject.GetComponent<Rigidbody>().AddForce(Vector3.up * UpwardForce, (ForceMode)0); } } } private void ThrowThing() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(((AnvilAsset)Things[m_currentThingToThrow]).GetGameObject(), Vector3.Lerp(LaunchPos1.position, LaunchPos2.position, Random.Range(0f, 1f)), LaunchPos1.rotation); val.transform.Rotate(new Vector3(Random.Range(0f - AngularRangeX, AngularRangeX), Random.Range(0f - AngulatRangeY, AngulatRangeY), 0f)); val.GetComponent<Rigidbody>().velocity = val.transform.forward * (m_VelocityBase + Random.Range(0f - velocityRange, velocityRange)); val.GetComponent<Rigidbody>().angularVelocity = val.transform.up * 10f; val.GetComponent<Rigidbody>().drag = rigidbodyDrag; val.AddComponent<KillAfter>().DieTime = 12f; if ((Object)(object)thingMaterial != (Object)null) { ((Renderer)val.GetComponentInChildren<MeshRenderer>()).material = thingMaterial; } LaunchSoundSource.pitch = Random.Range(0.97f, 1.03f); LaunchSoundSource.PlayOneShot(LaunchSound, 0.4f); UberShatterable component = val.GetComponent<UberShatterable>(); targets.Add(component); currentThrows++; NextStation(); Tablet.ThrowCount.text = currentThrows.ToString(); } public void TimeIsUp() { if (isPlaying && !isdebug) { if (!isTutorial && GameType == ShotgunGames.TRAP) { ThrowThing(); } } else if (isdebug) { ThrowThing(); } } public IEnumerator TickToThrow(float time) { if (time > 0f) { yield return (object)new WaitForSeconds(time); TimeIsUp(); } else if (time <= 0f) { TimeIsUp(); } yield return null; } public void TargetReachedGround(GameObject target) { UberShatterable component = target.GetComponent<UberShatterable>(); if ((Object)(object)component != (Object)null && targets.Contains(component)) { targets.Remove(component); } } public void StartGame() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) gravityType = GM.Options.SimulationOptions.ObjectGravityMode; isPlaying = true; currentScore = 0; Tablet.Score.text = currentScore.ToString(); currentThrows = 0; Tablet.ThrowCount.text = currentThrows.ToString(); Tablet.GameScreenMainMenu.SetActive(false); LoudSpeaker.pitch = Random.Range(0.97f, 1.03f); PlaceMarker.SetActive(true); PlaceMarker.transform.SetPositionAndRotation(TRAPcolliderPoints[0].position, TRAPcolliderPoints[0].rotation); LoudSpeaker.PlayOneShot(StartBuzzer, 0.4f); StartStopRecognizer(start: true); } public void FinishGame() { PlaceMarker.SetActive(false); isPlaying = false; StartStopRecognizer(start: false); Tablet.GameScreenMainMenu.SetActive(true); Tablet.addScore(currentScore); LoudSpeaker.PlayOneShot(FinishBuzzer, 0.3f); currentThrows = 0; } public int chooseVoiceLIne() { return Random.Range(0, FiveThrowVoiceLines.Count - 1); } public void NextStation() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) if (GameType == ShotgunGames.TRAP && currentThrows != 0) { if (currentThrows == 5) { PlaceMarker.transform.SetPositionAndRotation(TRAPcolliderPoints[1].position, TRAPcolliderPoints[1].rotation); LoudSpeaker.pitch = Random.Range(0.97f, 1.03f); LoudSpeaker.PlayOneShot(FiveThrowVoiceLines[chooseVoiceLIne()], 1f); } else if (currentThrows == 10) { PlaceMarker.transform.SetPositionAndRotation(TRAPcolliderPoints[2].position, TRAPcolliderPoints[2].rotation); LoudSpeaker.pitch = Random.Range(0.97f, 1.03f); LoudSpeaker.PlayOneShot(FiveThrowVoiceLines[chooseVoiceLIne()], 1f); } else if (currentThrows == 15) { PlaceMarker.transform.SetPositionAndRotation(TRAPcolliderPoints[3].position, TRAPcolliderPoints[3].rotation); LoudSpeaker.pitch = Random.Range(0.97f, 1.03f); LoudSpeaker.PlayOneShot(FiveThrowVoiceLines[chooseVoiceLIne()], 1f); } else if (currentThrows == 20) { PlaceMarker.transform.SetPositionAndRotation(TRAPcolliderPoints[4].position, TRAPcolliderPoints[4].rotation); LoudSpeaker.pitch = Random.Range(0.97f, 1.03f); LoudSpeaker.PlayOneShot(FiveThrowVoiceLines[chooseVoiceLIne()], 1f); } } } } namespace Modmas2023.ModmasMap_2023 { [BepInPlugin("Modmas2023.ModmasMap_2023", "ModmasMap_2023", "1.0.5")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("nrgill28.Atlas", "1.0.1")] public class ModmasMap_2023Plugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { AtlasPlugin.RegisterScene(Path.Combine(BasePath, "maptest3")); } } } namespace Modmas2023.Modmas_2023 { public class Nuke : MonoBehaviour, IFVRDamageable { [Header("Nuke-Specific Parameters")] [SerializeField] private float health = 10000f; [SerializeField] private GameObject mesh; [Header("Explosion parameters")] [SerializeField] private AudioEvent explosionSound; [Tooltip("What material the bomb is set to during the explosion.")] [SerializeField] private Material explosionMaterial; [SerializeField] private float expansionSpeed = 10f; [SerializeField] private GameObject[] enableOnExplode; [SerializeField] private GameObject[] disableOnExplode; private bool hasExploded; private IEnumerator expansionCoroutine; private float bombScale = 1f; public void Start() { expansionCoroutine = bombExpansion(); } public void Damage(Damage d) { health -= d.Dam_TotalKinetic; if ((health <= 0f || d.Dam_EMP > 0f) && !hasExploded) { hasExploded = true; Detonate(); } } private void Detonate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) SM.PlayCoreSound((FVRPooledAudioType)5, explosionSound, ((Component)this).transform.position); ScreenShake.TriggerShake(new ShakeProfile(3.5f, 0.4f), new VignetteProfile(3.4f, 1f, 0.35f, Color.black)); if (enableOnExplode.Length > 0) { GameObject[] array = enableOnExplode; foreach (GameObject val in array) { val.SetActive(true); } } if (disableOnExplode.Length > 0) { GameObject[] array2 = disableOnExplode; foreach (GameObject val2 in array2) { val2.SetActive(false); } } if ((Object)(object)mesh.GetComponent<MeshRenderer>() != (Object)null && (Object)(object)explosionMaterial != (Object)null) { ((Renderer)mesh.GetComponent<MeshRenderer>()).material = explosionMaterial; ((MonoBehaviour)this).StartCoroutine(expansionCoroutine); } Scene activeScene = SceneManager.GetActiveScene(); SteamVR_LoadLevel.Begin(((Scene)(ref activeScene)).name, false, 0.1f, 0f, 0f, 0f, 1f); } private IEnumerator bombExpansion() { while (true) { bombScale += expansionSpeed * Time.deltaTime; mesh.transform.localScale = new Vector3(bombScale, bombScale, bombScale); yield return null; } } } } namespace Modmas2023 { public class FollowTarget : MonoBehaviour { [Header("Only fill if the target is not the main camera or player head")] public Transform target; private bool attached; private Vector3 playerOffset; private void Update() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (!attached) { if ((Object)(object)target == (Object)null) { if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { if ((Object)(object)GM.CurrentPlayerBody.Head != (Object)null) { target = GM.CurrentPlayerBody.Head; playerOffset = target.position - ((Component)this).transform.position; attached = true; } else { Debug.Log((object)"FollowTarget needs a target to be assigned"); attached = false; } } } else { playerOffset = target.position - ((Component)this).transform.position; attached = true; } } else { ((Component)this).transform.position = target.position - playerOffset; } } } } public class FollowTargetDebug : MonoBehaviour { private bool check; private void OnLevelWasLoaded() { Debug.Log((object)("OnLevelWasLoaded, player head exists: " + GM.CurrentPlayerBody != null)); } private void Awake() { Debug.Log((object)("OnAwake, player head exists: " + GM.CurrentPlayerBody != null)); } private void Start() { Debug.Log((object)("Start, player head exists: " + GM.CurrentPlayerBody != null)); } private void Update() { if (!check) { Debug.Log((object)("Update, player head exists: " + GM.CurrentPlayerBody != null)); } check = true; } } [ExecuteInEditMode] [AddComponentMenu("Post Process/Post Process")] [RequireComponent(typeof(Camera))] public class PostProcess : MonoBehaviour { private enum Pass { Compose, Mip, Threshold, Blur, ZoomBlur } public Shader PostProcessShader; [Header("Bloom:")] [Range(0f, 3f)] public float BloomThreshold = 1f; [Range(0f, 1f)] public float BloomExtra = 0.1f; [Range(0f, 10f)] public float BloomAmount = 4f; [Range(1f, 8f)] public float BloomSpread = 6f; [Header("God Rays")] public Light _sunLight; [Range(0f, 1f)] public float GodRayGlow = 0.1f; [Range(0f, 5f)] public float GodRayAmount = 1f; [Range(0f, 1f)] public float GodRayLength = 1f; public int GodRaySteps = 10; private Material _postProcessMaterial; private RenderTexture _bloomThresholdTexture; private RenderTexture _bloomThresholdTextureMip1; private RenderTexture _bloomThresholdTextureMip2; private RenderTexture _bloomBlurX; private RenderTexture _bloomBlurY; private RenderTexture _godrayBlur1; private RenderTexture _godrayBlur2; private Camera _thisCamera; private bool _initialized = false; private void OnActivate() { OnEnable(); } private void Start() { OnEnable(); } private void OnEnable() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown if (_initialized) { return; } _thisCamera = ((Component)this).GetComponent<Camera>(); _thisCamera.depthTextureMode = (DepthTextureMode)1; if ((Object)(object)PostProcessShader == (Object)null) { PostProcessShader = Shader.Find("Hidden/PostProcess"); } if ((Object)(object)PostProcessShader == (Object)null) { Debug.Log((object)"#ERROR# Hidden/PostProcess Shader not found"); return; } if ((Object)(object)_postProcessMaterial != (Object)null) { _postProcessMaterial = null; } _postProcessMaterial = new Material(PostProcessShader); ((Object)_postProcessMaterial).hideFlags = (HideFlags)61; _initialized = true; } private void CleanUpTextures() { if (Object.op_Implicit((Object)(object)_bloomThresholdTexture)) { RenderTexture.ReleaseTemporary(_bloomThresholdTexture); _bloomThresholdTexture = null; } if (Object.op_Implicit((Object)(object)_bloomThresholdTextureMip1)) { RenderTexture.ReleaseTemporary(_bloomThresholdTextureMip1); _bloomThresholdTextureMip1 = null; } if (Object.op_Implicit((Object)(object)_bloomThresholdTextureMip2)) { RenderTexture.ReleaseTemporary(_bloomThresholdTextureMip2); _bloomThresholdTextureMip2 = null; } if (Object.op_Implicit((Object)(object)_bloomBlurX)) { RenderTexture.ReleaseTemporary(_bloomBlurX); _bloomBlurX = null; } if (Object.op_Implicit((Object)(object)_bloomBlurY)) { RenderTexture.ReleaseTemporary(_bloomBlurY); _bloomBlurY = null; } if (Object.op_Implicit((Object)(object)_godrayBlur1)) { RenderTexture.ReleaseTemporary(_godrayBlur1); _godrayBlur1 = null; } if (Object.op_Implicit((Object)(object)_godrayBlur2)) { RenderTexture.ReleaseTemporary(_godrayBlur2); _godrayBlur2 = null; } } private void OnDisable() { CleanUpTextures(); _initialized = false; } private void OnRenderImage(RenderTexture source, RenderTexture destination) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) int width = ((Texture)source).width; int height = ((Texture)source).height; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((float)((Texture)source).width, (float)((Texture)source).height); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor((float)(((Texture)source).width / 2), (float)(((Texture)source).height / 2)); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor((float)(((Texture)source).width / 4), (float)(((Texture)source).height / 4)); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor((float)(((Texture)source).width / 8), (float)(((Texture)source).height / 8)); _postProcessMaterial.SetFloat("_BloomThreshold", BloomThreshold); _postProcessMaterial.SetFloat("_BloomExtra", BloomExtra); _postProcessMaterial.SetFloat("_ScreenX", val2.x); _postProcessMaterial.SetFloat("_ScreenY", val2.y); _postProcessMaterial.SetVector("_OneOverScreenSize", Vector4.op_Implicit(new Vector2(1f / val2.x, 1f / val2.y))); if (Object.op_Implicit((Object)(object)_sunLight)) { _postProcessMaterial.SetVector("_SunDir", Vector4.op_Implicit(((Component)_sunLight).transform.forward)); } else { _postProcessMaterial.SetVector("_SunDir", Vector4.op_Implicit(Vector3.zero)); } Material postProcessMaterial = _postProcessMaterial; Ray val5 = _thisCamera.ScreenPointToRay(new Vector3(0f, (float)height, 0f)); postProcessMaterial.SetVector("_ViewDirTL", Vector4.op_Implicit(((Ray)(ref val5)).direction)); Material postProcessMaterial2 = _postProcessMaterial; Ray val6 = _thisCamera.ScreenPointToRay(new Vector3((float)width, (float)height, 0f)); postProcessMaterial2.SetVector("_ViewDirTR", Vector4.op_Implicit(((Ray)(ref val6)).direction)); Material postProcessMaterial3 = _postProcessMaterial; Ray val7 = _thisCamera.ScreenPointToRay(new Vector3(0f, 0f, 0f)); postProcessMaterial3.SetVector("_ViewDirBL", Vector4.op_Implicit(((Ray)(ref val7)).direction)); Material postProcessMaterial4 = _postProcessMaterial; Ray val8 = _thisCamera.ScreenPointToRay(new Vector3((float)width, 0f, 0f)); postProcessMaterial4.SetVector("_ViewDirBR", Vector4.op_Implicit(((Ray)(ref val8)).direction)); _bloomThresholdTexture = RenderTexture.GetTemporary((int)val2.x, (int)val2.y, 0, (RenderTextureFormat)2); Graphics.Blit((Texture)(object)source, _bloomThresholdTexture, _postProcessMaterial, 2); _postProcessMaterial.SetFloat("_ScreenX", val3.x); _postProcessMaterial.SetFloat("_ScreenY", val3.y); _postProcessMaterial.SetVector("_OneOverScreenSize", Vector4.op_Implicit(new Vector2(1f / val3.x, 1f / val3.y))); _bloomThresholdTextureMip1 = RenderTexture.GetTemporary((int)val3.x, (int)val3.y, 0, (RenderTextureFormat)2); Graphics.Blit((Texture)(object)_bloomThresholdTexture, _bloomThresholdTextureMip1, _postProcessMaterial, 1); _postProcessMaterial.SetFloat("_ScreenX", val4.x); _postProcessMaterial.SetFloat("_ScreenY", val4.y); _postProcessMaterial.SetVector("_OneOverScreenSize", Vector4.op_Implicit(new Vector2(1f / val4.x, 1f / val4.y))); _bloomThresholdTextureMip2 = RenderTexture.GetTemporary((int)val4.x, (int)val4.y, 0, (RenderTextureFormat)2); Graphics.Blit((Texture)(object)_bloomThresholdTextureMip1, _bloomThresholdTextureMip2, _postProcessMaterial, 1); _bloomBlurX = RenderTexture.GetTemporary((int)val4.x, (int)val4.y, 0, (RenderTextureFormat)9); _bloomBlurY = RenderTexture.GetTemporary((int)val4.x, (int)val4.y, 0, (RenderTextureFormat)9); _postProcessMaterial.SetFloat("_BlurSpread", 1f); _postProcessMaterial.SetVector("_BlurDir", Vector4.op_Implicit(new Vector2(1f, 0f))); Graphics.Blit((Texture)(object)_bloomThresholdTextureMip1, _bloomBlurX, _postProcessMaterial, 3); _postProcessMaterial.SetVector("_BlurDir", Vector4.op_Implicit(new Vector2(0f, 1f))); Graphics.Blit((Texture)(object)_bloomBlurX, _bloomBlurY, _postProcessMaterial, 3); Graphics.Blit((Texture)(object)_bloomBlurY, _bloomThresholdTextureMip2); _postProcessMaterial.SetFloat("_BlurSpread", BloomSpread); _postProcessMaterial.SetVector("_BlurDir", Vector4.op_Implicit(new Vector2(1f, 0f))); Graphics.Blit((Texture)(object)_bloomBlurY, _bloomBlurX, _postProcessMaterial, 3); _postProcessMaterial.SetVector("_BlurDir", Vector4.op_Implicit(new Vector2(0f, 1f))); Graphics.Blit((Texture)(object)_bloomBlurX, _bloomBlurY, _postProcessMaterial, 3); if (Object.op_Implicit((Object)(object)_sunLight)) { _postProcessMaterial.SetMatrix("_CameraVPMatrix", _thisCamera.worldToCameraMatrix * _thisCamera.projectionMatrix); Vector3 val9 = _thisCamera.WorldToScreenPoint(((Component)_thisCamera).transform.position - ((Component)_sunLight).transform.forward * 10000f); _postProcessMaterial.SetVector("_GodRayScreenPos", Vector4.op_Implicit(new Vector3(val9.x / (float)width, val9.y / (float)height, val9.z))); _godrayBlur1 = RenderTexture.GetTemporary((int)val3.x, (int)val3.y, 0, (RenderTextureFormat)2); _godrayBlur2 = RenderTexture.GetTemporary((int)val3.x, (int)val3.y, 0, (RenderTextureFormat)2); float num = 1f; _postProcessMaterial.SetInt("_GodRaySteps", GodRaySteps); _postProcessMaterial.SetFloat("_GodRayLength", GodRayLength); _postProcessMaterial.SetFloat("_GodRayFalloff", 1f); _postProcessMaterial.SetVector("_GodrayGlow", Color.op_Implicit(_sunLight.color * _sunLight.intensity * GodRayGlow * num)); _postProcessMaterial.SetTexture("_GodRayTex", (Texture)(object)_bloomThresholdTextureMip1); Graphics.Blit((Texture)(object)source, _godrayBlur1, _postProcessMaterial, 4); _postProcessMaterial.SetFloat("_GodRayLength", GodRayLength / (float)GodRaySteps * 3f); _postProcessMaterial.SetFloat("_GodRayFalloff", 1f / (float)GodRaySteps); _postProcessMaterial.SetVector("_GodrayGlow", Vector4.zero); _postProcessMaterial.SetTexture("_GodRayTex", (Texture)(object)_godrayBlur1); Graphics.Blit((Texture)(object)source, _godrayBlur2, _postProcessMaterial, 4); _postProcessMaterial.SetTexture("_GodRayTex", (Texture)(object)_godrayBlur2); _postProcessMaterial.SetTexture("_GodRayTexAlt", (Texture)(object)_godrayBlur1); } else { _postProcessMaterial.SetTexture("_GodRayTex", (Texture)(object)Texture2D.blackTexture); } _postProcessMaterial.SetTexture("_BloomTex", (Texture)(object)_bloomBlurY); _postProcessMaterial.SetTexture("_BloomTex2", (Texture)(object)_bloomThresholdTextureMip2); _postProcessMaterial.SetFloat("_BloomAmount", BloomAmount); _postProcessMaterial.SetFloat("_GodRayAmount", GodRayAmount); Graphics.Blit((Texture)(object)source, destination, _postProcessMaterial, 0); CleanUpTextures(); } } [ExecuteInEditMode] public class MatchEditorCamera : MonoBehaviour { private Camera myCamera; public bool matchCameraDurringPlay = true; public float swimAmount = 0.5f; public float swimSpeed = 0.5f; public float smoothing = 10f; public float speed = 5f; private Vector3 targetPos = Vector3.zero; private Quaternion targetRotation = Quaternion.identity; private Vector3 mousePos = Vector3.zero; private float targetFov = 60f; private Transform targetTransform; private SceneView sceneView; private CallbackFunction cbf_UpdateCamera; private void Start() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) myCamera = ((Component)this).GetComponent<Camera>(); if (Application.isPlaying && matchCameraDurringPlay) { targetTransform = new GameObject().transform; ((Object)targetTransform).name = "CameraTargetTransform"; targetTransform.position = ((Component)myCamera).transform.position; targetTransform.rotation = ((Component)myCamera).transform.rotation; } } private void UpdateCamera() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) if ((!Application.isPlaying || matchCameraDurringPlay) && (Object)(object)myCamera != (Object)null) { myCamera.ResetProjectionMatrix(); if ((Object)(object)SceneView.currentDrawingSceneView != (Object)null) { sceneView = SceneView.currentDrawingSceneView; } if ((Object)(object)sceneView != (Object)null) { targetRotation = ((Component)sceneView.camera).transform.rotation; targetPos = ((Component)sceneView.camera).transform.position; targetFov = sceneView.camera.fieldOfView; float num = Mathf.Sin(Time.fixedTime * 2.17f * swimSpeed) + Mathf.Sin(Time.fixedTime * 0.73f * swimSpeed); float num2 = Mathf.Sin(Time.fixedTime * 2.73f * swimSpeed) + Mathf.Sin(Time.fixedTime * 1.17f * swimSpeed); float num3 = Mathf.Sin(Time.fixedTime * 3.17f * swimSpeed) + Mathf.Sin(Time.fixedTime * 1.31f * swimSpeed); targetRotation *= Quaternion.Euler(num * swimAmount, num2 * swimAmount, num3 * swimAmount); Transform transform = ((Component)myCamera).transform; transform.position += (targetPos - ((Component)myCamera).transform.position) * Mathf.Clamp01(1f / smoothing); ((Component)myCamera).transform.rotation = Quaternion.Slerp(((Component)myCamera).transform.rotation, targetRotation, Mathf.Clamp01(1f / smoothing)); myCamera.fieldOfView = targetFov; } } } private void OnEnable() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown cbf_UpdateCamera = new CallbackFunction(UpdateCamera); EditorApplication.update = (CallbackFunction)Delegate.Combine((Delegate?)(object)EditorApplication.update, (Delegate?)(object)cbf_UpdateCamera); } private void OnDisable() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown EditorApplication.update = (CallbackFunction)Delegate.Remove((Delegate?)(object)EditorApplication.update, (Delegate?)(object)cbf_UpdateCamera); } private void Update() { if (Application.isPlaying && matchCameraDurringPlay) { } } } public class OBJExporter : ScriptableWizard { public bool onlySelectedObjects = false; public bool applyPosition = true; public bool applyRotation = true; public bool applyScale = true; public bool generateMaterials = true; public bool exportTextures = true; public bool splitObjects = true; public bool autoMarkTexReadable = false; public bool objNameAddIdNum = false; private string versionString = "v2.0"; private string lastExportFolder; private bool StaticBatchingEnabled() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown PlayerSettings[] array = Resources.FindObjectsOfTypeAll<PlayerSettings>(); if (array == null) { return false; } SerializedObject val = new SerializedObject((Object[])(object)array); SerializedProperty val2 = val.FindProperty("m_BuildTargetBatching"); for (int i = 0; i < val2.arraySize; i++) { SerializedProperty arrayElementAtIndex = val2.GetArrayElementAtIndex(i); if (arrayElementAtIndex == null) { continue; } IEnumerator enumerator = arrayElementAtIndex.GetEnumerator(); if (enumerator == null) { continue; } while (enumerator.MoveNext()) { SerializedProperty val3 = (SerializedProperty)enumerator.Current; if (val3 != null && val3.name == "m_StaticBatching") { return val3.boolValue; } } } return false; } private void OnWizardUpdate() { ((ScriptableWizard)this).helpString = "Aaro4130's OBJ Exporter " + versionString; } private Vector3 RotateAroundPoint(Vector3 point, Vector3 pivot, Quaternion angle) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return angle * (point - pivot) + pivot; } private Vector3 MultiplyVec3s(Vector3 v1, Vector3 v2) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z); } private void OnWizardCreate() { if (StaticBatchingEnabled() && Application.isPlaying) { EditorUtility.DisplayDialog("Error", "Static batching is enabled. This will cause the export file to look like a mess, as well as be a large filesize. Disable this option, and restart the player, before continuing.", "OK"); return; } if (autoMarkTexReadable) { int num = EditorUtility.DisplayDialogComplex("Warning", "This will convert all textures to Advanced type with the read/write option set. This is not reversible and will permanently affect your project. Continue?", "Yes", "No", "Cancel"); if (num > 0) { return; } } string @string = EditorPrefs.GetString("a4_OBJExport_lastPath", ""); string string2 = EditorPrefs.GetString("a4_OBJExport_lastFile", "unityexport.obj"); string text = EditorUtility.SaveFilePanel("Export OBJ", @string, string2, "obj"); if (text.Length > 0) { FileInfo fileInfo = new FileInfo(text); EditorPrefs.SetString("a4_OBJExport_lastFile", fileInfo.Name); EditorPrefs.SetString("a4_OBJExport_lastPath", fileInfo.Directory.FullName); Export(text); } } private void Export(string exportPath) { //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) Dictionary<string, bool> dictionary = new Dictionary<string, bool>(); FileInfo fileInfo = new FileInfo(exportPath); lastExportFolder = fileInfo.Directory.FullName; string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(exportPath); EditorUtility.DisplayProgressBar("Exporting OBJ", "Please wait.. Starting export.", 0f); MeshFilter[] array; if (onlySelectedObjects) { List<MeshFilter> list = new List<MeshFilter>(); GameObject[] gameObjects = Selection.gameObjects; foreach (GameObject val in gameObjects) { MeshFilter component = val.GetComponent<MeshFilter>(); if ((Object)(object)component != (Object)null) { list.Add(component); } } array = list.ToArray(); } else { array = Object.FindObjectsOfType(typeof(MeshFilter)) as MeshFilter[]; } if (Application.isPlaying) { MeshFilter[] array2 = array; foreach (MeshFilter val2 in array2) { MeshRenderer component2 = ((Component)val2).gameObject.GetComponent<MeshRenderer>(); if ((Object)(object)component2 != (Object)null && ((Renderer)component2).isPartOfStaticBatch) { EditorUtility.ClearProgressBar(); EditorUtility.DisplayDialog("Error", "Static batched object detected. Static batching is not compatible with this exporter. Please disable it before starting the player.", "OK"); return; } } } StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder.AppendLine("# Export of " + Application.loadedLevelName); stringBuilder.AppendLine("# from Aaro4130 OBJ Exporter " + versionString); if (generateMaterials) { stringBuilder.AppendLine("mtllib " + fileNameWithoutExtension + ".mtl"); } float num = array.Length + 1; int num2 = 0; for (int k = 0; k < array.Length; k++) { string name = ((Object)((Component)array[k]).gameObject).name; float num3 = (float)(k + 1) / num; EditorUtility.DisplayProgressBar("Exporting objects... (" + Mathf.Round(num3 * 100f) + "%)", "Exporting object " + name, num3); MeshFilter val3 = array[k]; MeshRenderer component3 = ((Component)array[k]).gameObject.GetComponent<MeshRenderer>(); if (splitObjects) { string text = name; if (objNameAddIdNum) { text = text + "_" + k; } stringBuilder.AppendLine("g " + text); } if ((Object)(object)component3 != (Object)null && generateMaterials) { Material[] sharedMaterials = ((Renderer)component3).sharedMaterials; foreach (Material val4 in sharedMaterials) { if (!dictionary.ContainsKey(((Object)val4).name)) { dictionary[((Object)val4).name] = true; stringBuilder2.Append(MaterialToString(val4)); stringBuilder2.AppendLine(); } } } Mesh sharedMesh = val3.sharedMesh; int num4 = (int)Mathf.Clamp(((Component)val3).gameObject.transform.lossyScale.x * ((Component)val3).gameObject.transform.lossyScale.z, -1f, 1f); Vector3[] vertices = sharedMesh.vertices; foreach (Vector3 val5 in vertices) { Vector3 val6 = val5; if (applyScale) { val6 = MultiplyVec3s(val6, ((Component)val3).gameObject.transform.lossyScale); } if (applyRotation) { val6 = RotateAroundPoint(val6, Vector3.zero, ((Component)val3).gameObject.transform.rotation); } if (applyPosition) { val6 += ((Component)val3).gameObject.transform.position; } val6.x *= -1f; stringBuilder.AppendLine("v " + val6.x + " " + val6.y + " " + val6.z); } Vector3[] normals = sharedMesh.normals; foreach (Vector3 val7 in normals) { Vector3 val8 = val7; if (applyScale) { Vector3 v = val8; Vector3 lossyScale = ((Component)val3).gameObject.transform.lossyScale; val8 = MultiplyVec3s(v, ((Vector3)(ref lossyScale)).normalized); } if (applyRotation) { val8 = RotateAroundPoint(val8, Vector3.zero, ((Component)val3).gameObject.transform.rotation); } val8.x *= -1f; stringBuilder.AppendLine("vn " + val8.x + " " + val8.y + " " + val8.z); } Vector2[] uv = sharedMesh.uv; for (int num5 = 0; num5 < uv.Length; num5++) { Vector2 val9 = uv[num5]; stringBuilder.AppendLine("vt " + val9.x + " " + val9.y); } for (int num6 = 0; num6 < sharedMesh.subMeshCount; num6++) { if ((Object)(object)component3 != (Object)null && num6 < ((Renderer)component3).sharedMaterials.Length) { string name2 = ((Object)((Renderer)component3).sharedMaterials[num6]).name; stringBuilder.AppendLine("usemtl " + name2); } else { stringBuilder.AppendLine("usemtl " + name + "_sm" + num6); } int[] triangles = sharedMesh.GetTriangles(num6); for (int num7 = 0; num7 < triangles.Length; num7 += 3) { int index = triangles[num7] + 1 + num2; int index2 = triangles[num7 + 1] + 1 + num2; int index3 = triangles[num7 + 2] + 1 + num2; if (num4 < 0) { stringBuilder.AppendLine("f " + ConstructOBJString(index) + " " + ConstructOBJString(index2) + " " + ConstructOBJString(index3)); } else { stringBuilder.AppendLine("f " + ConstructOBJString(index3) + " " + ConstructOBJString(index2) + " " + ConstructOBJString(index)); } } } num2 += sharedMesh.vertices.Length; } File.WriteAllText(exportPath, stringBuilder.ToString()); if (generateMaterials) { File.WriteAllText(fileInfo.Directory.FullName + "\\" + fileNameWithoutExtension + ".mtl", stringBuilder2.ToString()); } EditorUtility.ClearProgressBar(); } private string TryExportTexture(string propertyName, Material m) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (m.HasProperty(propertyName)) { Texture texture = m.GetTexture(propertyName); if ((Object)(object)texture != (Object)null) { return ExportTexture((Texture2D)texture); } } return "false"; } private string ExportTexture(Texture2D t) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown try { if (autoMarkTexReadable) { string assetPath = AssetDatabase.GetAssetPath((Object)(object)t); AssetImporter atPath = AssetImporter.GetAtPath(assetPath); TextureImporter val = (TextureImporter)(object)((atPath is TextureImporter) ? atPath : null); if ((Object)(object)val != (Object)null) { val.textureType = (TextureImporterType)0; if (!val.isReadable) { val.isReadable = true; AssetDatabase.ImportAsset(assetPath); AssetDatabase.Refresh(); } } } string text = lastExportFolder + "\\" + ((Object)t).name + ".png"; Texture2D val2 = new Texture2D(((Texture)t).width, ((Texture)t).height, (TextureFormat)5, false); val2.SetPixels(t.GetPixels()); File.WriteAllBytes(text, val2.EncodeToPNG()); return text; } catch (Exception) { Debug.Log((object)("Could not export texture : " + ((Object)t).name + ". is it readable?")); return "null"; } } private string ConstructOBJString(int index) { string text = index.ToString(); return text + "/" + text + "/" + text; } private string MaterialToString(Material m) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("newmtl " + ((Object)m).name); if (m.HasProperty("_Color")) { stringBuilder.AppendLine("Kd " + m.color.r + " " + m.color.g + " " + m.color.b); if (m.color.a < 1f) { stringBuilder.AppendLine("Tr " + (1f - m.color.a)); stringBuilder.AppendLine("d " + m.color.a); } } if (m.HasProperty("_SpecColor")) { Color color = m.GetColor("_SpecColor"); stringBuilder.AppendLine("Ks " + color.r + " " + color.g + " " + color.b); } if (exportTextures) { string text = TryExportTexture("_MainTex", m); if (text != "false") { stringBuilder.AppendLine("map_Kd " + text); } text = TryExportTexture("_SpecMap", m); if (text != "false") { stringBuilder.AppendLine("map_Ks " + text); } text = TryExportTexture("_BumpMap", m); if (text != "false") { stringBuilder.AppendLine("map_Bump " + text); } } stringBuilder.AppendLine("illum 2"); return stringBuilder.ToString(); } [MenuItem("File/Export/Wavefront OBJ")] private static void CreateWizard() { ScriptableWizard.DisplayWizard("Export OBJ", typeof(OBJExporter), "Export"); } } public class CuttableMesh { private MeshRenderer inputMeshRenderer; private bool hasUvs; private bool hasUv1s; private bool hasColours; private List<CuttableSubMesh> subMeshes; public CuttableMesh(Mesh inputMesh) { Init(inputMesh, ((Object)inputMesh).name); } public CuttableMesh(MeshRenderer input) { inputMeshRenderer = input; MeshFilter component = ((Component)input).GetComponent<MeshFilter>(); Mesh sharedMesh = component.sharedMesh; Init(sharedMesh, ((Object)input).name); } public CuttableMesh(CuttableMesh inputMesh, List<CuttableSubMesh> newSubMeshes) { inputMeshRenderer = inputMesh.inputMeshRenderer; hasUvs = inputMesh.hasUvs; hasUv1s = inputMesh.hasUv1s; hasColours = inputMesh.hasColours; subMeshes = new List<CuttableSubMesh>(); subMeshes.AddRange(newSubMeshes); } private void Init(Mesh inputMesh, string debugName) { subMeshes = new List<CuttableSubMesh>(); if (inputMesh.isReadable) { Vector3[] vertices = inputMesh.vertices; Vector3[] normals = inputMesh.normals; Vector2[] uv = inputMesh.uv; Vector2[] uv2 = inputMesh.uv2; Color32[] colors = inputMesh.colors32; hasUvs = uv != null && uv.Length > 0; hasUv1s = uv2 != null && uv2.Length > 0; hasColours = colors != null && colors.Length > 0; for (int i = 0; i < inputMesh.subMeshCount; i++) { int[] indices = inputMesh.GetIndices(i); CuttableSubMesh item = new CuttableSubMesh(indices, vertices, normals, colors, uv, uv2); subMeshes.Add(item); } } else { Debug.LogError((object)("CuttableMesh's input mesh is not readable: " + debugName), (Object)(object)inputMesh); } } public void Add(CuttableMesh other) { if (subMeshes.Count != other.subMeshes.Count) { throw new Exception("Mismatched submesh count"); } for (int i = 0; i < subMeshes.Count; i++) { subMeshes[i].Add(other.subMeshes[i]); } } public int NumSubMeshes() { return subMeshes.Count; } public bool HasUvs() { return hasUvs; } public bool HasColours() { return hasColours; } public List<CuttableSubMesh> GetSubMeshes() { return subMeshes; } public CuttableSubMesh GetSubMesh(int index) { return subMeshes[index]; } public Transform GetTransform() { if ((Object)(object)inputMeshRenderer != (Object)null) { return ((Component)inputMeshRenderer).transform; } return null; } public MeshRenderer ConvertToRenderer(string newObjectName) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) Mesh val = CreateMesh(); if (val.vertexCount == 0) { return null; } GameObject val2 = new GameObject(newObjectName); val2.transform.SetParent(((Component)inputMeshRenderer).transform); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; MeshFilter val3 = val2.AddComponent<MeshFilter>(); val3.mesh = val; MeshRenderer val4 = val2.AddComponent<MeshRenderer>(); ((Renderer)val4).shadowCastingMode = ((Renderer)inputMeshRenderer).shadowCastingMode; ((Renderer)val4).reflectionProbeUsage = ((Renderer)inputMeshRenderer).reflectionProbeUsage; ((Renderer)val4).lightProbeUsage = ((Renderer)inputMeshRenderer).lightProbeUsage; ((Renderer)val4).sharedMaterials = ((Renderer)inputMeshRenderer).sharedMaterials; return val4; } public Mesh CreateMesh() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Mesh val = new Mesh(); int num = 0; for (int i = 0; i < subMeshes.Count; i++) { num += subMeshes[i].NumIndices(); } List<Vector3> list = new List<Vector3>(); List<Vector3> list2 = new List<Vector3>(); List<Color32> list3 = ((!hasColours) ? null : new List<Color32>()); List<Vector2> list4 = ((!hasUvs) ? null : new List<Vector2>()); List<Vector2> list5 = ((!hasUv1s) ? null : new List<Vector2>()); List<int> list6 = new List<int>(); foreach (CuttableSubMesh subMesh in subMeshes) { list6.Add(list.Count); subMesh.AddTo(list, list2, list3, list4, list5); } val.vertices = list.ToArray(); val.normals = list2.ToArray(); val.colors32 = ((!hasColours) ? null : list3.ToArray()); val.uv = ((!hasUvs) ? null : list4.ToArray()); val.uv2 = ((!hasUv1s) ? null : list5.ToArray()); val.subMeshCount = subMeshes.Count; for (int j = 0; j < subMeshes.Count; j++) { CuttableSubMesh cuttableSubMesh = subMeshes[j]; int num2 = list6[j]; int[] array = cuttableSubMesh.GenIndices(); for (int k = 0; k < array.Length; k++) { array[k] += num2; } val.SetTriangles(array, j, true); } return val; } } public class CuttableSubMesh { private List<Vector3> vertices; private List<Vector3> normals; private List<Color32> colours; private List<Vector2> uvs; private List<Vector2> uv1s; public CuttableSubMesh(bool hasNormals, bool hasColours, bool hasUvs, bool hasUv1) { vertices = new List<Vector3>(); if (hasNormals) { normals = new List<Vector3>(); } if (hasColours) { colours = new List<Color32>(); } if (hasUvs) { uvs = new List<Vector2>(); } if (hasUv1) { uv1s = new List<Vector2>(); } } public CuttableSubMesh(int[] indices, Vector3[] inputVertices, Vector3[] inputNormals, Color32[] inputColours, Vector2[] inputUvs, Vector2[] inputUv1) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) vertices = new List<Vector3>(); if (inputNormals != null && inputNormals.Length > 0) { normals = new List<Vector3>(); } if (inputColours != null && inputColours.Length > 0) { colours = new List<Color32>(); } if (inputUvs != null && inputUvs.Length > 0) { uvs = new List<Vector2>(); } if (inputUv1 != null && inputUv1.Length > 0) { uv1s = new List<Vector2>(); } foreach (int num in indices) { vertices.Add(inputVertices[num]); if (normals != null) { normals.Add(inputNormals[num]); } if (colours != null) { colours.Add(inputColours[num]); } if (uvs != null) { uvs.Add(inputUvs[num]); } if (uv1s != null) { uv1s.Add(inputUv1[num]); } } } public void Add(CuttableSubMesh other) { for (int i = 0; i < other.vertices.Count; i++) { CopyVertex(i, other); } } public int NumVertices() { return vertices.Count; } public Vector3 GetVertex(int index) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return vertices[index]; } public bool HasNormals() { return normals != null; } public bool HasColours() { return colours != null; } public bool HasUvs() { return uvs != null; } public bool HasUv1() { return uv1s != null; } public void CopyVertex(int srcIndex, CuttableSubMesh srcMesh) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) vertices.Add(srcMesh.vertices[srcIndex]); if (normals != null) { normals.Add(srcMesh.normals[srcIndex]); } if (colours != null) { colours.Add(srcMesh.colours[srcIndex]); } if (uvs != null) { uvs.Add(srcMesh.uvs[srcIndex]); } if (uv1s != null) { uv1s.Add(srcMesh.uv1s[srcIndex]); } } public void AddInterpolatedVertex(int i0, int i1, float weight, CuttableSubMesh srcMesh) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) Vector3 vertex = srcMesh.GetVertex(i0); Vector3 vertex2 = srcMesh.GetVertex(i1); vertices.Add(Vector3.Lerp(vertex, vertex2, weight)); if (normals != null) { List<Vector3> list = normals; Vector3 val = Vector3.Lerp(srcMesh.normals[i0], srcMesh.normals[i1], weight); list.Add(((Vector3)(ref val)).normalized); } if (colours != null) { colours.Add(Color32.Lerp(srcMesh.colours[i0], srcMesh.colours[i1], weight)); } if (uvs != null) { uvs.Add(Vector2.Lerp(srcMesh.uvs[i0], srcMesh.uvs[i1], weight)); } if (uv1s != null) { uv1s.Add(Vector2.Lerp(srcMesh.uv1s[i0], srcMesh.uv1s[i1], weight)); } } public void AddTo(List<Vector3> destVertices, List<Vector3> destNormals, List<Color32> destColours, List<Vector2> destUvs, List<Vector2> destUv1s) { destVertices.AddRange(vertices); if (normals != null) { destNormals.AddRange(normals); } if (colours != null) { destColours.AddRange(colours); } if (uvs != null) { destUvs.AddRange(uvs); } if (uv1s != null) { destUv1s.AddRange(uv1s); } } public int NumIndices() { return vertices.Count; } public int[] GenIndices() { int[] array = new int[vertices.Count]; for (int i = 0; i < array.Length; i++) { array[i] = i; } return array; } } public enum VertexClassification { Front = 1, Back = 2, OnPlane = 4 } public class MeshCutter { private CuttableMesh inputMesh; private List<CuttableSubMesh> outputFrontSubMeshes; private List<CuttableSubMesh> outputBackSubMeshes; public void Cut(CuttableMesh input, Plane worldCutPlane) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) inputMesh = input; outputFrontSubMeshes = new List<CuttableSubMesh>(); outputBackSubMeshes = new List<CuttableSubMesh>(); Transform transform = inputMesh.GetTransform(); Plane cutPlane = default(Plane); if ((Object)(object)transform != (Object)null) { Vector3 val = transform.InverseTransformPoint(ClosestPointOnPlane(worldCutPlane, Vector3.zero));