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 HarmonyLib;
using OtherLoader;
using Sodalite.Api;
using UnityEngine;
using UnityEngine.Serialization;
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]
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class DeferredNightVisionEffect : MonoBehaviour
{
[SerializeField]
[Tooltip("The main color of the NV effect")]
public Color m_NVColor = new Color(0f, 1f, 0.1724138f, 0f);
[SerializeField]
[Tooltip("The color that the NV effect will 'bleach' towards (white = default)")]
public Color m_TargetBleachColor = new Color(1f, 1f, 1f, 0f);
[Range(0f, 0.1f)]
[Tooltip("How much base lighting does the NV effect pick up")]
public float m_baseLightingContribution = 0.025f;
[Range(0f, 128f)]
[Tooltip("The higher this value, the more bright areas will get 'bleached out'")]
public float m_LightSensitivityMultiplier = 100f;
private Material m_Material;
private Shader m_Shader;
[Tooltip("Do we want to apply a vignette to the edges of the screen?")]
public bool useVignetting = true;
public Shader NightVisionShader => m_Shader;
private void DestroyMaterial(Material mat)
{
if (Object.op_Implicit((Object)(object)mat))
{
Object.DestroyImmediate((Object)(object)mat);
mat = null;
}
}
private void CreateMaterials()
{
if ((Object)(object)m_Shader == (Object)null)
{
m_Shader = Shader.Find("Custom/DeferredNightVisionShader");
}
if ((Object)(object)m_Material == (Object)null && (Object)(object)m_Shader != (Object)null && m_Shader.isSupported)
{
m_Material = CreateMaterial(m_Shader);
}
}
private Material CreateMaterial(Shader shader)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
if (!Object.op_Implicit((Object)(object)shader))
{
return null;
}
Material val = new Material(shader);
((Object)val).hideFlags = (HideFlags)61;
return val;
}
private void OnDisable()
{
DestroyMaterial(m_Material);
m_Material = null;
m_Shader = null;
}
[ContextMenu("UpdateShaderValues")]
public void UpdateShaderValues()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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)
if (!((Object)(object)m_Material == (Object)null))
{
m_Material.SetVector("_NVColor", Color.op_Implicit(m_NVColor));
m_Material.SetVector("_TargetWhiteColor", Color.op_Implicit(m_TargetBleachColor));
m_Material.SetFloat("_BaseLightingContribution", m_baseLightingContribution);
m_Material.SetFloat("_LightSensitivityMultiplier", m_LightSensitivityMultiplier);
m_Material.shaderKeywords = null;
if (useVignetting)
{
Shader.EnableKeyword("USE_VIGNETTE");
}
else
{
Shader.DisableKeyword("USE_VIGNETTE");
}
}
}
private void OnEnable()
{
CreateMaterials();
UpdateShaderValues();
}
public void ReloadShaders()
{
OnDisable();
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
UpdateShaderValues();
CreateMaterials();
Graphics.Blit((Texture)(object)source, destination, m_Material);
}
}
public class ActivateGoggles : MonoBehaviour
{
public Renderer[] HotObjects;
public LayerMask Cold;
public LayerMask Hot;
public GameObject PostProcessObject;
[SerializeField]
[FormerlySerializedAs("Material")]
private Material _material;
private Material SkyboxMaterial;
private Dictionary<Renderer, Material> HotObjectMaterialCache;
private bool enabled = false;
private void Start()
{
HotObjectMaterialCache = new Dictionary<Renderer, Material>();
((MonoBehaviour)this).StartCoroutine(WaitForActivation());
}
private IEnumerator WaitForActivation()
{
yield return (object)new WaitUntil((Func<bool>)(() => Input.GetKeyDown((KeyCode)49) && !enabled));
PostProcessObject.SetActive(true);
IEnumerable<Renderer> renderers = Object.FindObjectsOfType<Renderer>().ToList().Except(HotObjects);
foreach (Renderer item in renderers)
{
((Component)item).gameObject.layer = 10;
}
_material.SetColor("_MainColor", Color.white);
Renderer[] hotObjects = HotObjects;
foreach (Renderer val in hotObjects)
{
HotObjectMaterialCache.Add(val, val.material);
((Component)val).gameObject.layer = 9;
val.material = _material;
}
SkyboxMaterial = RenderSettings.skybox;
RenderSettings.skybox = null;
enabled = true;
yield return WaitForDeactivation();
}
private IEnumerator WaitForDeactivation()
{
yield return (object)new WaitUntil((Func<bool>)(() => Input.GetKeyDown((KeyCode)50) && enabled));
PostProcessObject.SetActive(false);
IEnumerable<Renderer> renderers = Object.FindObjectsOfType<Renderer>().ToList().Except(HotObjects);
foreach (Renderer item in renderers)
{
((Component)item).gameObject.layer = 0;
}
_material.SetColor("_MainColor", Color.white);
Renderer[] hotObjects = HotObjects;
foreach (Renderer val in hotObjects)
{
((Component)val).gameObject.layer = 0;
val.material = HotObjectMaterialCache[val];
}
HotObjectMaterialCache.Clear();
enabled = false;
RenderSettings.skybox = SkyboxMaterial;
yield return WaitForActivation();
}
}
public class HeatController : MonoBehaviour
{
public IEnumerator DecreaseHeat()
{
float slide = 0f;
while (slide < 1f)
{
slide += Time.deltaTime * 0.1f;
Material[] materials = ((Renderer)((Component)this).GetComponent<SkinnedMeshRenderer>()).materials;
materials[0].SetColor("_MainColor", Color.Lerp(Color.white, Color.black, slide));
((Renderer)((Component)this).GetComponent<SkinnedMeshRenderer>()).materials = materials;
yield return null;
}
}
}
public class KillTheGuyAnimatorTrigger : MonoBehaviour
{
private Animator animator;
private HeatController[] _heatControllers;
private void Awake()
{
animator = ((Component)this).GetComponent<Animator>();
_heatControllers = Object.FindObjectsOfType<HeatController>();
((MonoBehaviour)this).StartCoroutine(WaitForPress());
}
private IEnumerator WaitForPress()
{
yield return (object)new WaitUntil((Func<bool>)(() => Input.GetKeyDown((KeyCode)112)));
animator.SetTrigger("Kill");
yield return (object)new WaitForSeconds(2f);
ActivateAllHeatDowngrades();
}
private void ActivateAllHeatDowngrades()
{
HeatController[] heatControllers = _heatControllers;
foreach (HeatController heatController in heatControllers)
{
((MonoBehaviour)this).StartCoroutine(heatController.DecreaseHeat());
}
}
}
public class ThermalVisionPlayerEventReceiver : MonoBehaviour
{
private Material m_Material;
private void Start()
{
m_Material = ((Component)this).GetComponent<Renderer>().material;
}
private void OnEnable()
{
ThermalVision.onThermalVisionEnabled += OnThermalModeInit;
HeatVision.onHeatVisionEnabled += OnThermalMode2Init;
}
private void OnDisable()
{
ThermalVision.onThermalVisionEnabled -= OnThermalModeInit;
HeatVision.onHeatVisionEnabled -= OnThermalMode2Init;
}
private void OnThermalModeInit(bool enabled)
{
//IL_0039: 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_001d: Unknown result type (might be due to invalid IL or missing references)
if (enabled)
{
m_Material.SetColor("_EmissionColor", Color.white * 5f);
}
else
{
m_Material.SetColor("_EmissionColor", Color.black);
}
}
private void OnThermalMode2Init(bool enabled)
{
//IL_0039: 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_001d: Unknown result type (might be due to invalid IL or missing references)
if (enabled)
{
m_Material.SetColor("_EmissionColor", Color.white * 5f);
}
else
{
m_Material.SetColor("_EmissionColor", Color.black);
}
}
}
public class RangeFinder : MonoBehaviour
{
private Text _text;
private Camera _mainCam;
private void Start()
{
_text = ((Component)this).GetComponent<Text>();
_mainCam = Camera.main;
}
private void Update()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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_0061: 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)
Ray val = _mainCam.ScreenPointToRay(new Vector3((float)Screen.width / 2f, (float)Screen.height / 2f, 0f));
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, 250f) && Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider))
{
_text.text = $"RNG {Mathf.Abs(((RaycastHit)(ref val2)).point.z)}";
}
else
{
_text.text = string.Format("RNG {0}", "-");
}
}
}
public class UIController : MonoBehaviour
{
public GameObject panelNightVision;
public GameObject panelThermalVision;
public GameObject panelHeatVision;
private void OnEnable()
{
Nightvision.onNightVisionEnabled += onNightVisionEnabled;
HeatVision.onHeatVisionEnabled += onHeatVisionEnabled;
ThermalVision.onThermalVisionEnabled += onThermalVisionEnabled;
}
private void OnDisable()
{
Nightvision.onNightVisionEnabled -= onNightVisionEnabled;
HeatVision.onHeatVisionEnabled -= onHeatVisionEnabled;
ThermalVision.onThermalVisionEnabled -= onThermalVisionEnabled;
}
private void onNightVisionEnabled(bool enabled)
{
if (Object.op_Implicit((Object)(object)panelNightVision))
{
panelNightVision.SetActive(enabled);
}
}
private void onHeatVisionEnabled(bool enabled)
{
if (Object.op_Implicit((Object)(object)panelHeatVision))
{
panelHeatVision.SetActive(enabled);
}
}
private void onThermalVisionEnabled(bool enabled)
{
if (Object.op_Implicit((Object)(object)panelThermalVision))
{
panelThermalVision.SetActive(enabled);
}
}
}
public class VisionController : MonoBehaviour
{
private Nightvision nightVision;
private HeatVision heatVision;
private ThermalVision thermalVision;
private float zoom;
private void Start()
{
nightVision = Object.FindObjectOfType<Nightvision>();
heatVision = Object.FindObjectOfType<HeatVision>();
thermalVision = Object.FindObjectOfType<ThermalVision>();
}
private void Update()
{
if (Input.GetKeyDown((KeyCode)110))
{
((Behaviour)nightVision).enabled = !((Behaviour)nightVision).enabled;
}
if (Input.GetKeyDown((KeyCode)104))
{
((Behaviour)heatVision).enabled = !((Behaviour)heatVision).enabled;
}
if (Input.GetKeyDown((KeyCode)116))
{
((Behaviour)thermalVision).enabled = !((Behaviour)thermalVision).enabled;
}
if (((Behaviour)nightVision).enabled)
{
zoom = Mathf.Clamp(zoom + Input.GetAxis("Mouse ScrollWheel"), 0f, 8f);
nightVision._Zoom = zoom;
}
}
}
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Vision/NightVision")]
public class Nightvision : MonoBehaviour
{
public delegate void OnNightVisionEnabledDelegate(bool enabled);
public Shader shader;
public Texture2D _NoiseTex;
public Texture2D _MaskTex;
[Range(0f, 1f)]
public float _LuminanceThreshold = 0.3f;
[Range(2f, 20f)]
public float _ColorAmplification = 6f;
[Range(0.1f, 1f)]
public float _LightTreshold = 0.2f;
[Range(0f, 8f)]
public float _Zoom = 0f;
private Material m_Material;
protected Material material
{
get
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
if ((Object)(object)m_Material == (Object)null)
{
m_Material = new Material(shader);
((Object)m_Material).hideFlags = (HideFlags)61;
}
return m_Material;
}
}
public static event OnNightVisionEnabledDelegate onNightVisionEnabled;
private void OnEnable()
{
if (Nightvision.onNightVisionEnabled != null)
{
Nightvision.onNightVisionEnabled(enabled: true);
}
}
protected virtual void Start()
{
if (!SystemInfo.supportsImageEffects)
{
((Behaviour)this).enabled = false;
return;
}
if ((Object)(object)shader == (Object)null)
{
shader = Shader.Find("Hidden/NightVision");
}
if (!Object.op_Implicit((Object)(object)shader) || !shader.isSupported)
{
((Behaviour)this).enabled = false;
}
}
protected virtual void OnDisable()
{
if (Object.op_Implicit((Object)(object)m_Material))
{
Object.DestroyImmediate((Object)(object)m_Material);
}
if (Nightvision.onNightVisionEnabled != null)
{
Nightvision.onNightVisionEnabled(enabled: false);
}
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
material.SetTexture("_NoiseTex", (Texture)(object)_NoiseTex);
material.SetTexture("_MaskTex", (Texture)(object)_MaskTex);
material.SetFloat("_LuminanceThreshold", _LuminanceThreshold);
material.SetFloat("_ColorAmplification", _ColorAmplification);
material.SetFloat("_LightTreshold", _LightTreshold);
material.SetFloat("_Zoom", _Zoom);
Graphics.Blit((Texture)(object)source, destination, material);
}
}
public class ShockShader : MonoBehaviour
{
private float counter = 0f;
private bool animate = false;
private void Start()
{
}
private void Update()
{
//IL_0021: 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_002b: 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_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_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: 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_008f: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetButtonDown("Fire1"))
{
counter = 0f;
Ray val = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, float.PositiveInfinity) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject)
{
Vector3 val3 = default(Vector3);
((Vector3)(ref val3))..ctor(((RaycastHit)(ref val2)).point.x - ((Component)this).transform.position.x + 0.5f, ((RaycastHit)(ref val2)).point.y - ((Component)this).transform.position.y + 0.5f, 0f);
((Component)this).GetComponent<Renderer>().material.SetVector("_Center", new Vector4(val3.x, val3.y, 0f, 0f));
((Component)this).GetComponent<Renderer>().material.SetFloat("_WaveTime", 0f);
animate = true;
}
}
if (animate)
{
if (counter < 1.5f)
{
counter += Time.deltaTime;
((Component)this).GetComponent<Renderer>().material.SetFloat("_WaveTime", counter);
}
else
{
animate = false;
}
}
}
}
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Vision/HeatVision")]
public class HeatVision : MonoBehaviour
{
public delegate void OnHeatVisionEnabledDelegate(bool enabled);
public Shader shader;
[Range(0.1f, 0.9f)]
public float _ColorAmplification = 0.4f;
private Material m_Material;
protected Material material
{
get
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
if ((Object)(object)m_Material == (Object)null)
{
m_Material = new Material(shader);
((Object)m_Material).hideFlags = (HideFlags)61;
}
return m_Material;
}
}
public static event OnHeatVisionEnabledDelegate onHeatVisionEnabled;
private void OnEnable()
{
if (HeatVision.onHeatVisionEnabled != null)
{
HeatVision.onHeatVisionEnabled(enabled: true);
}
}
protected virtual void Start()
{
if (!SystemInfo.supportsImageEffects)
{
((Behaviour)this).enabled = false;
return;
}
if ((Object)(object)shader == (Object)null)
{
shader = Shader.Find("Hidden/ThermalVision2");
}
if (!Object.op_Implicit((Object)(object)shader) || !shader.isSupported)
{
((Behaviour)this).enabled = false;
}
}
protected virtual void OnDisable()
{
if (Object.op_Implicit((Object)(object)m_Material))
{
Object.DestroyImmediate((Object)(object)m_Material);
}
if (HeatVision.onHeatVisionEnabled != null)
{
HeatVision.onHeatVisionEnabled(enabled: false);
}
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
material.SetFloat("_ColorAmplification", _ColorAmplification);
Graphics.Blit((Texture)(object)source, destination, material);
}
}
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Vision/ThermalVision")]
public class ThermalVision : MonoBehaviour
{
public delegate void OnThermalVisionEnabledDelegate(bool enabled);
public Shader shader;
[Range(0.1f, 0.9f)]
public float _ColorAmplification = 0.6f;
private Material m_Material;
protected Material material
{
get
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
if ((Object)(object)m_Material == (Object)null)
{
m_Material = new Material(shader);
((Object)m_Material).hideFlags = (HideFlags)61;
}
return m_Material;
}
}
public static event OnThermalVisionEnabledDelegate onThermalVisionEnabled;
private void OnEnable()
{
if (ThermalVision.onThermalVisionEnabled != null)
{
ThermalVision.onThermalVisionEnabled(enabled: true);
}
}
protected virtual void Start()
{
if (!SystemInfo.supportsImageEffects)
{
((Behaviour)this).enabled = false;
return;
}
if ((Object)(object)shader == (Object)null)
{
shader = Shader.Find("Hidden/ThermalVision");
}
if (!Object.op_Implicit((Object)(object)shader) || !shader.isSupported)
{
((Behaviour)this).enabled = false;
}
}
protected virtual void OnDisable()
{
if (Object.op_Implicit((Object)(object)m_Material))
{
Object.DestroyImmediate((Object)(object)m_Material);
}
if (ThermalVision.onThermalVisionEnabled != null)
{
ThermalVision.onThermalVisionEnabled(enabled: false);
}
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
material.SetFloat("_ColorAmplification", _ColorAmplification);
Graphics.Blit((Texture)(object)source, destination, material);
}
}
[AddComponentMenu("Camera-Control/Mouse Look")]
public class MouseLook : MonoBehaviour
{
public enum RotationAxes
{
MouseXAndY,
MouseX,
MouseY
}
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 15f;
public float sensitivityY = 15f;
public float minimumX = -360f;
public float maximumX = 360f;
public float minimumY = -60f;
public float maximumY = 60f;
private float rotationY = 0f;
private void Update()
{
//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_0081: 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_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
if (axes == RotationAxes.MouseXAndY)
{
float num = ((Component)this).transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);
((Component)this).transform.localEulerAngles = new Vector3(0f - rotationY, num, 0f);
}
else if (axes == RotationAxes.MouseX)
{
((Component)this).transform.Rotate(0f, Input.GetAxis("Mouse X") * sensitivityX, 0f);
}
else
{
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);
((Component)this).transform.localEulerAngles = new Vector3(0f - rotationY, ((Component)this).transform.localEulerAngles.y, 0f);
}
}
private void Start()
{
if (Object.op_Implicit((Object)(object)((Component)this).GetComponent<Rigidbody>()))
{
((Component)this).GetComponent<Rigidbody>().freezeRotation = true;
}
}
}
public class Move : MonoBehaviour
{
[SerializeField]
private float amplitude = 1f;
[SerializeField]
private float timeScale = 1f;
private Transform transform;
private Vector3 startPosition;
private void Start()
{
//IL_0014: 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)
transform = ((Component)this).GetComponent<Transform>();
startPosition = transform.position;
}
private void Update()
{
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
transform.position = new Vector3(amplitude * Mathf.Sin(Time.time * timeScale), startPosition.y, startPosition.z);
}
}
public class Rotate : MonoBehaviour
{
[SerializeField]
private float amplitude;
[SerializeField]
private float timeScale;
private Transform transform;
private Quaternion startRotation;
private void Start()
{
//IL_0014: 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)
transform = ((Component)this).GetComponent<Transform>();
startRotation = transform.rotation;
}
private void Update()
{
//IL_0008: 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)
transform.rotation = startRotation * Quaternion.Euler(0f, 0f, amplitude * Mathf.Cos(Time.time * timeScale));
}
}
[ExecuteInEditMode]
public class BezierCurveLineRenderer : MonoBehaviour
{
public Transform[] points;
public LineRenderer lineRenderer;
public int vertexCount = 12;
private void Start()
{
}
private void Update()
{
//IL_003a: 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_008a: 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_0091: Unknown result type (might be due to invalid IL or missing references)
if (points == null || points.Length <= 0)
{
lineRenderer.positionCount = 0;
lineRenderer.SetPositions((Vector3[])(object)new Vector3[1] { Vector3.zero });
return;
}
List<Vector3> list = new List<Vector3>();
for (float num = 0f; num <= 1f; num += 1f / (float)vertexCount)
{
Vector3 item = CalculateBezierPoint(num, points.Select((Transform point) => point.position));
list.Add(item);
}
lineRenderer.positionCount = list.Count;
lineRenderer.SetPositions(list.ToArray());
}
private Vector3 CalculateBezierPoint(float ratio, IEnumerable<Vector3> points)
{
//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_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: 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_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_0068: 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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: 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)
if (points.Count() == 1)
{
return points.First();
}
LinkedList<Vector3> linkedList = new LinkedList<Vector3>();
Vector3? val = null;
foreach (Vector3 point in points)
{
if (!val.HasValue)
{
val = point;
continue;
}
linkedList.AddLast(Vector3.Lerp(val.Value, point, ratio));
val = point;
}
return CalculateBezierPoint(ratio, linkedList);
}
private void OnDrawGizmos()
{
}
}
public class Chunk : MonoBehaviour
{
public int width;
private Color[,,] chunkData;
private void Awake()
{
chunkData = new Color[width, width, width];
}
internal void SetBlock(int x, int y, int z, Color blockData)
{
//IL_000f: 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)
chunkData[x, y, z] = blockData;
((Component)this).SendMessage("BlockUpdate", (object)this);
}
internal Color GetBlock(int x, int y, int z)
{
//IL_000a: 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_0015: Unknown result type (might be due to invalid IL or missing references)
return chunkData[x, y, z];
}
}
[RequireComponent(typeof(MeshFilter))]
public class ChunkMeshGenerator : MonoBehaviour
{
private class Block
{
public int x;
public int y;
public int z;
public Color color;
public Block(int x, int y, int z, Color color)
{
//IL_001d: 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)
this.x = x;
this.y = y;
this.z = z;
this.color = color;
}
}
private MeshFilter filter;
private void BlockUpdate(Chunk updatedChunk)
{
Mesh mesh = GenerateMesh(updatedChunk);
if ((Object)(object)filter == (Object)null)
{
filter = ((Component)this).GetComponent<MeshFilter>();
}
filter.mesh = mesh;
}
private Mesh GenerateMesh(Chunk updatedChunk)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0045: 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)
Mesh val = new Mesh();
List<Color> list = new List<Color>();
List<Vector3> list2 = new List<Vector3>();
List<int> list3 = new List<int>();
for (int i = 0; i < updatedChunk.width; i++)
{
for (int j = 0; j < updatedChunk.width; j++)
{
for (int k = 0; k < updatedChunk.width; k++)
{
Block block = CheckBlock(updatedChunk, i, j, k);
if (block.color != default(Color))
{
Block[] adjacentBlocks = new Block[6]
{
CheckBlock(updatedChunk, i - 1, j, k),
CheckBlock(updatedChunk, i + 1, j, k),
CheckBlock(updatedChunk, i, j - 1, k),
CheckBlock(updatedChunk, i, j + 1, k),
CheckBlock(updatedChunk, i, j, k - 1),
CheckBlock(updatedChunk, i, j, k + 1)
};
GenerateMeshForAdjacentBlocks(block, adjacentBlocks, list, list3, list2);
}
}
}
}
val.SetVertices(list2);
val.SetColors(list);
val.SetTriangles(list3, 0);
return val;
}
private void GenerateMeshForAdjacentBlocks(Block block, Block[] adjacentBlocks, List<Color> generatedColors, List<int> generatedTriangles, List<Vector3> generatedVertices)
{
//IL_0011: 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_001e: 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_00a0: 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_00a7: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: 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_00ee: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: 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_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: 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_010f: 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)
//IL_011b: 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)
//IL_012d: 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_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: 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_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: 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_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: 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_0166: 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_0174: 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_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: 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_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: 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)
Vector3 val = default(Vector3);
Vector3 val2 = default(Vector3);
foreach (Block block2 in adjacentBlocks)
{
if (block2.color == default(Color))
{
((Vector3)(ref val))..ctor((float)block.x, (float)block.y, (float)block.z);
((Vector3)(ref val2))..ctor((float)block2.x, (float)block2.y, (float)block2.z);
bool flag = block.x != block2.x;
bool flag2 = block.y != block2.y;
bool flag3 = block.z != block2.z;
Vector3 zero = Vector3.zero;
Vector3 zero2 = Vector3.zero;
if (flag)
{
zero = Vector3.forward;
zero2 = Vector3.up;
}
else if (flag2)
{
zero = Vector3.right;
zero2 = Vector3.forward;
}
else
{
zero = Vector3.right;
zero2 = Vector3.up;
}
zero *= 0.5f;
zero2 *= 0.5f;
Vector3 val3 = (val2 + val) / 2f;
int count = generatedVertices.Count;
generatedVertices.Add(val3 + zero + zero2);
generatedVertices.Add(val3 + zero - zero2);
generatedVertices.Add(val3 - zero + zero2);
generatedVertices.Add(val3 - zero - zero2);
generatedColors.Add(block.color);
generatedColors.Add(block.color);
generatedColors.Add(block.color);
generatedColors.Add(block.color);
generatedTriangles.Add(count);
generatedTriangles.Add(count + 1);
generatedTriangles.Add(count + 2);
generatedTriangles.Add(count + 1);
generatedTriangles.Add(count + 2);
generatedTriangles.Add(count + 3);
}
}
}
private Block CheckBlock(Chunk updatedChunk, int x, int y, int z)
{
//IL_0043: 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)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
if (x < 0 || y < 0 || z < 0 || x >= updatedChunk.width || y >= updatedChunk.width || z >= updatedChunk.width)
{
return new Block(x, y, z, default(Color));
}
return new Block(x, y, z, updatedChunk.GetBlock(x, y, z));
}
}
public class PerlinChunkGenerator : MonoBehaviour
{
public int seed;
private Chunk chunk;
private void Start()
{
chunk = ((Component)this).GetComponent<Chunk>();
Generate(chunk, seed);
}
private void Generate(Chunk chunk, int seed)
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: 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_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00d8: 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)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
Random.InitState(seed);
for (int i = 0; i < chunk.width; i++)
{
for (int j = 0; j < chunk.width; j++)
{
for (int k = 0; k < chunk.width; k++)
{
float num = (Mathf.PerlinNoise((float)i / (float)chunk.width, (float)j / (float)chunk.width) + Mathf.PerlinNoise((float)i / (float)chunk.width, (float)k / (float)chunk.width) + Mathf.PerlinNoise((float)k / (float)chunk.width, (float)j / (float)chunk.width)) / 3f;
Color blockData = default(Color);
if ((double)num > 0.75)
{
blockData = Color.red;
}
else if ((double)num > 0.5)
{
blockData = Color.green;
}
else if ((double)num > 0.25)
{
blockData = Color.blue;
}
chunk.SetBlock(i, j, k, blockData);
}
}
}
}
}
public class BuildHeightMap : MonoBehaviour
{
public float height;
public float offset = 0.25f;
public float step = 0.25f;
public Material material;
private void Start()
{
//IL_002e: 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)
for (float num = offset; num < height; num += step)
{
GameObject val = GameObject.CreatePrimitive((PrimitiveType)4);
MeshRenderer component = val.GetComponent<MeshRenderer>();
((Renderer)component).material = material;
val.transform.position = Vector3.up * num;
}
}
private void Update()
{
}
}
public class ConwaysGameOfLife : MonoBehaviour
{
public Texture input;
public int width = 512;
public int height = 512;
public ComputeShader compute;
public RenderTexture renderTexPing;
public RenderTexture renderTexPong;
public Material material;
private int kernel;
private bool pingPong;
private void Start()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
if (height >= 1 && width >= 1)
{
kernel = compute.FindKernel("GameOfLife");
renderTexPing = new RenderTexture(width, height, 24);
((Texture)renderTexPing).wrapMode = (TextureWrapMode)0;
renderTexPing.enableRandomWrite = true;
((Texture)renderTexPing).filterMode = (FilterMode)0;
renderTexPing.useMipMap = false;
renderTexPing.Create();
renderTexPong = new RenderTexture(width, height, 24);
((Texture)renderTexPong).wrapMode = (TextureWrapMode)0;
renderTexPong.enableRandomWrite = true;
((Texture)renderTexPong).filterMode = (FilterMode)0;
renderTexPong.useMipMap = false;
renderTexPong.Create();
Graphics.Blit(input, renderTexPing);
pingPong = true;
compute.SetFloat("Width", (float)width);
compute.SetFloat("Height", (float)height);
}
}
private void Update()
{
if (height >= 1 && width >= 1)
{
if (pingPong)
{
compute.SetTexture(kernel, "Input", (Texture)(object)renderTexPing);
compute.SetTexture(kernel, "Result", (Texture)(object)renderTexPong);
compute.Dispatch(kernel, width / 8, height / 8, 1);
material.mainTexture = (Texture)(object)renderTexPong;
pingPong = false;
}
else
{
compute.SetTexture(kernel, "Input", (Texture)(object)renderTexPong);
compute.SetTexture(kernel, "Result", (Texture)(object)renderTexPing);
compute.Dispatch(kernel, width / 8, height / 8, 1);
material.mainTexture = (Texture)(object)renderTexPing;
pingPong = true;
}
}
}
}
[ImageEffectAllowedInSceneView]
[ExecuteInEditMode]
public class NightVisionImageEffect : MonoBehaviour
{
private Camera camera;
public Material effectMaterial;
private void OnEnable()
{
camera = ((Component)this).GetComponent<Camera>();
camera.depthTextureMode = (DepthTextureMode)1;
}
[ImageEffectOpaque]
private void OnRenderImage(RenderTexture src, RenderTexture dst)
{
Graphics.Blit((Texture)(object)src, dst, effectMaterial);
}
}
[ExecuteInEditMode]
public class PixelateImageEffect : MonoBehaviour
{
public Material effectMaterial;
private void OnRenderImage(RenderTexture src, RenderTexture dst)
{
Graphics.Blit((Texture)(object)src, dst, effectMaterial);
}
}
[ExecuteInEditMode]
public class TracerPositionUpdater : MonoBehaviour
{
public Material material;
public Transform parent;
private void Start()
{
if ((Object)(object)parent == (Object)null)
{
parent = ((Component)Camera.main).transform;
}
}
private void Update()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)material != (Object)null)
{
material.SetVector("_EchoLocation", new Vector4(((Component)this).transform.position.x, ((Component)this).transform.position.y, ((Component)this).transform.position.z, 0f));
}
}
}
[ExecuteInEditMode]
public class MagicLightSource : MonoBehaviour
{
public Material reveal;
public Light light;
private void Start()
{
}
private void Update()
{
//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_003c: 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_0046: Unknown result type (might be due to invalid IL or missing references)
reveal.SetVector("_LightPosition", Vector4.op_Implicit(((Component)light).transform.position));
reveal.SetVector("_LightDirection", Vector4.op_Implicit(-((Component)light).transform.forward));
reveal.SetFloat("_LightAngle", light.spotAngle);
}
}
public class ProjectileAttackSimulator : MonoBehaviour
{
public float radius;
public float shotCooldown;
private float timer;
public GameObject projectile;
private void Start()
{
}
private void Update()
{
//IL_002c: 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_003d: 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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
timer += Time.deltaTime;
while (timer > shotCooldown)
{
timer -= shotCooldown;
Vector3 val = Random.onUnitSphere * radius;
Quaternion val2 = Quaternion.LookRotation(-val);
Object.Instantiate<GameObject>(projectile, val, val2);
Debug.Log((object)"New Projectile");
}
}
}
[ExecuteInEditMode]
public class ShieldController : MonoBehaviour
{
private static readonly Vector4[] defaultEmptyVector = (Vector4[])(object)new Vector4[1]
{
new Vector4(0f, 0f, 0f, 0f)
};
public Vector4[] points;
public Material shieldMaterial;
private void Start()
{
points = (Vector4[])(object)new Vector4[50];
}
private void Update()
{
shieldMaterial.SetInt("_PointsSize", points.Length);
if (points.Length <= 0)
{
shieldMaterial.SetVectorArray("_Points", defaultEmptyVector);
}
else
{
shieldMaterial.SetVectorArray("_Points", points);
}
}
}
public class ShieldProjectile : MonoBehaviour
{
public float projectileBias = 0.25f;
public float speed = 10f;
private void Start()
{
}
private void Update()
{
//IL_0015: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
float num = speed * Time.deltaTime;
Transform transform = ((Component)this).transform;
transform.position += ((Component)this).transform.forward * num;
Ray val = default(Ray);
((Ray)(ref val))..ctor(((Component)this).transform.position, ((Component)this).transform.forward);
RaycastHit val2 = default(RaycastHit);
if (Physics.Raycast(val, ref val2, num + projectileBias))
{
((Component)((RaycastHit)(ref val2)).collider).gameObject.SendMessage("OnProjectileHit", (object)((RaycastHit)(ref val2)).point, (SendMessageOptions)1);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
[ExecuteInEditMode]
public class GrassPointCloudRenderer : MonoBehaviour
{
private Mesh mesh;
public MeshFilter filter;
public int seed;
public Vector2 size;
[Range(1f, 60000f)]
public int grassNumber;
public float startHeight = 1000f;
public float grassOffset = 0f;
private Vector3? lastPosition = null;
private List<Matrix4x4> materices;
private void Update()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: 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_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Expected O, but got Unknown
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: 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_012f: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
if (lastPosition.HasValue)
{
Vector3? val = lastPosition;
if (val.HasValue && !(val.GetValueOrDefault() != ((Component)this).transform.position))
{
return;
}
}
Random.InitState(seed);
List<Vector3> list = new List<Vector3>(grassNumber);
int[] array = new int[grassNumber];
List<Color> list2 = new List<Color>(grassNumber);
List<Vector3> list3 = new List<Vector3>(grassNumber);
Ray val2 = default(Ray);
RaycastHit val3 = default(RaycastHit);
for (int i = 0; i < grassNumber; i++)
{
Vector3 position = ((Component)this).transform.position;
position.y = startHeight;
position.x += size.x * Random.Range(-0.5f, 0.5f);
position.z += size.y * Random.Range(-0.5f, 0.5f);
((Ray)(ref val2))..ctor(position, Vector3.down);
if (Physics.Raycast(val2, ref val3))
{
Vector3 point = ((RaycastHit)(ref val3)).point;
point.y += grassOffset;
point -= ((Component)this).transform.position;
list.Add(point);
array[i] = i;
list2.Add(new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f));
list3.Add(((RaycastHit)(ref val3)).normal);
}
}
mesh = new Mesh();
mesh.SetVertices(list);
mesh.SetIndices(array, (MeshTopology)5, 0);
mesh.SetColors(list2);
mesh.SetNormals(list3);
filter.mesh = mesh;
lastPosition = ((Component)this).transform.position;
}
}
[ExecuteInEditMode]
public class GrassRenderer : MonoBehaviour
{
public Mesh grassMesh;
public Material material;
public int seed;
public Vector2 size;
[Range(1f, 1000f)]
public int grassNumber;
public float startHeight = 1000f;
public float grassOffset = 0f;
private void Update()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: 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_00c3: 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_00c9: 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)
Random.InitState(seed);
List<Matrix4x4> list = new List<Matrix4x4>(grassNumber);
Ray val = default(Ray);
RaycastHit val2 = default(RaycastHit);
for (int i = 0; i < grassNumber; i++)
{
Vector3 position = ((Component)this).transform.position;
position.y = startHeight;
position.x += size.x * Random.Range(-0.5f, 0.5f);
position.z += size.y * Random.Range(-0.5f, 0.5f);
((Ray)(ref val))..ctor(position, Vector3.down);
if (Physics.Raycast(val, ref val2))
{
position = ((RaycastHit)(ref val2)).point;
position.y += grassOffset;
list.Add(Matrix4x4.TRS(position, Quaternion.identity, Vector3.one));
}
}
Graphics.DrawMeshInstanced(grassMesh, 0, material, list);
}
}
[ExecuteInEditMode]
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(Light))]
public class VolumetricLightMesh : MonoBehaviour
{
public float maximumOpacity = 0.25f;
private MeshFilter filter;
private Light light;
private Mesh mesh;
private void Start()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
filter = ((Component)this).GetComponent<MeshFilter>();
light = ((Component)this).GetComponent<Light>();
if ((int)light.type != 0)
{
Debug.LogError((object)"Attached Volumetric Light Mesh to a non-supported Light Type. Please use Spotlight lights.");
}
}
private void Update()
{
mesh = BuildMesh();
filter.mesh = mesh;
}
private Mesh BuildMesh()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_0094: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: 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_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: 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)
//IL_0165: 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_0179: 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_018d: 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_01a0: 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)
//IL_01b7: 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_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: 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_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: 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_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: 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_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: 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_027e: Unknown result type (might be due to invalid IL or missing references)
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_0296: Unknown result type (might be due to invalid IL or missing references)
mesh = new Mesh();
float num = Mathf.Tan(light.spotAngle * 0.5f * ((float)Math.PI / 180f)) * light.range;
mesh.vertices = (Vector3[])(object)new Vector3[5]
{
new Vector3(0f, 0f, 0f),
new Vector3(num, num, light.range),
new Vector3(0f - num, num, light.range),
new Vector3(0f - num, 0f - num, light.range),
new Vector3(num, 0f - num, light.range)
};
mesh.colors = (Color[])(object)new Color[5]
{
new Color(light.color.r, light.color.g, light.color.b, light.color.a * maximumOpacity),
new Color(light.color.r, light.color.g, light.color.b, 0f),
new Color(light.color.r, light.color.g, light.color.b, 0f),
new Color(light.color.r, light.color.g, light.color.b, 0f),
new Color(light.color.r, light.color.g, light.color.b, 0f)
};
mesh.triangles = new int[12]
{
0, 1, 2, 0, 2, 3, 0, 3, 4, 0,
4, 1
};
return mesh;
}
}
namespace MeatKit
{
public class HideInNormalInspectorAttribute : PropertyAttribute
{
}
}
namespace sgt_brooks.Retro_AR
{
[BepInPlugin("sgt_brooks.Retro_AR", "Retro_AR", "3.0.0")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
[BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")]
[BepInDependency("nrgill28.Sodalite", "1.4.2")]
public class Retro_ARPlugin : 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()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "sgt_brooks.Retro_AR");
OtherLoader.RegisterDirectLoad(BasePath, "sgt_brooks.Retro_AR", "", "", "retro_ar", "");
GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_retro_ar"));
}
}
}
public class CameraEffect : MonoBehaviour
{
public Material m_Mat;
public bool m_Enable = true;
[Range(0.1f, 0.8f)]
public float m_ThermalHigh = 0.3f;
[Range(0.1f, 1f)]
public float m_BlurAmount = 0.5f;
[Range(0.1f, 1f)]
public float m_DimensionsX = 0.5f;
[Range(0.1f, 1f)]
public float m_DimensionsY = 0.5f;
private RenderTexture m_RT;
private void Start()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
m_RT = new RenderTexture(Screen.width, Screen.height, 0);
}
private void Update()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
float num = Random.Range(0f, 1f);
float num2 = Random.Range(0f, 1f);
m_Mat.SetVector("_Rnd", new Vector4(num, num2, 0f, 0f));
m_Mat.SetVector("_Dimensions", new Vector4(m_DimensionsX, m_DimensionsY, 0f, 0f));
m_Mat.SetFloat("_HotLight", m_ThermalHigh);
m_Mat.SetFloat("_BlurAmount", m_BlurAmount);
}
private void OnRenderImage(RenderTexture src, RenderTexture dst)
{
if (m_Enable)
{
Graphics.Blit((Texture)(object)src, m_RT, m_Mat, 0);
Graphics.Blit((Texture)(object)m_RT, dst, m_Mat, 1);
}
else
{
Graphics.Blit((Texture)(object)src, dst);
}
}
private void OnGUI()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
int num = 320;
GUI.Box(new Rect((float)(Screen.width / 2 - num / 2), 10f, (float)num, 25f), "Thermal Vision Demo");
}
}