Decompiled source of Forgotten Relics v1.1.25

plugins/ForgottenRelics/FHCSharp.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Xml.Linq;
using BTEntityStates.BellTower;
using BellTowerCSharp;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.ArchWispMonster;
using EntityStates.Engi.Mine;
using EntityStates.GolemMonster;
using EntityStates.GreaterWispMonster;
using EntityStates.MagmaWorm;
using FRCSharp;
using FRCSharp.AddressableComponents;
using FRCSharp.Save;
using ForgottenRelicsEntityStates.FrostWisp;
using ForgottenRelicsEntityStates.SanctumWisp;
using ForgottenRelicsEntityStates.VoidStompers;
using GrooveSaladSpikestripContent;
using HG;
using HG.Reflection;
using JBooth.VertexPainterPro;
using JetBrains.Annotations;
using KinematicCharacterController;
using On.JBooth.VertexPainterPro;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI;
using On.RoR2.UI.MainMenu;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.EntityLogic;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.MainMenu;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class AddressableGenericSceneSpawnPoint : GenericSceneSpawnPoint
{
	public string address = "";

	public void Start()
	{
		//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)
		base.networkedObjectPrefab = Addressables.LoadAssetAsync<GameObject>((object)address).WaitForCompletion();
		((GenericSceneSpawnPoint)this).Start();
	}
}
[CreateAssetMenu(fileName = "agBlank", menuName = "PlasmaCore/AssetGroup", order = 1)]
public class AssetGroup : ScriptableObject
{
	[SerializeField]
	public Object[] objects = Array.Empty<Object>();
}
public class BeaconBase : MonoBehaviour
{
	public static List<BeaconBase> instances = new List<BeaconBase>();

	[HideInInspector]
	public float damage;

	[Header("Stats")]
	public float baseDamage = 12f;

	public ItemDef toDrop;

	[Header("Instance Management and AI")]
	public float activationRange = 20f;

	[HideInInspector]
	public bool asleep = true;

	private int cyclesToChange;

	public int cyclesToDeactivation = 3;

	public int cyclesToActivation = 2;

	private float updateTimer = 5f;

	public float timeToUpdate = 1.5f;

	public GameObject awakeEffect;

	public GameObject explodeEffect;

	private BullseyeSearch enemySearch = new BullseyeSearch();

	[HideInInspector]
	public List<HurtBox> targets = new List<HurtBox>();

	public void FixedUpdate()
	{
		//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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		updateTimer -= Time.fixedDeltaTime;
		if (!(updateTimer <= 0f))
		{
			return;
		}
		if (Object.op_Implicit((Object)(object)Run.instance))
		{
			damage = baseDamage * Run.instance.difficultyCoefficient;
		}
		updateTimer = timeToUpdate;
		enemySearch.teamMaskFilter = TeamMask.allButNeutral;
		enemySearch.sortMode = (SortMode)1;
		enemySearch.minDistanceFilter = 0f;
		enemySearch.maxDistanceFilter = activationRange;
		enemySearch.searchOrigin = ((Component)this).transform.position;
		enemySearch.searchDirection = ((Component)this).transform.forward;
		enemySearch.maxAngleFilter = 180f;
		enemySearch.filterByLoS = true;
		enemySearch.RefreshCandidates();
		targets = enemySearch.GetResults().ToList();
		if (targets.Count > 0)
		{
			if (asleep)
			{
				cyclesToChange--;
				if (cyclesToChange <= 0)
				{
					cyclesToChange = cyclesToDeactivation;
					asleep = false;
					if (Object.op_Implicit((Object)(object)awakeEffect))
					{
						awakeEffect.SetActive(true);
					}
				}
			}
			else
			{
				cyclesToChange = cyclesToActivation;
			}
		}
		else if (!asleep)
		{
			cyclesToChange--;
			if (cyclesToChange <= 0)
			{
				cyclesToChange = cyclesToActivation;
				asleep = true;
				if (Object.op_Implicit((Object)(object)awakeEffect))
				{
					awakeEffect.SetActive(false);
				}
			}
		}
		else
		{
			cyclesToChange = cyclesToDeactivation;
		}
	}

	public void Explode()
	{
		//IL_0035: 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_0045: 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_0054: Unknown result type (might be due to invalid IL or missing references)
		((Behaviour)((Component)this).gameObject.GetComponent<Corpse>()).enabled = true;
		((Component)this).gameObject.GetComponent<Rigidbody>().isKinematic = false;
		if (Object.op_Implicit((Object)(object)toDrop))
		{
			PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(toDrop.itemIndex), ((Component)this).transform.position, Vector3.up * 10f);
		}
		if (Object.op_Implicit((Object)(object)explodeEffect))
		{
			explodeEffect.SetActive(true);
		}
	}

	public void OnEnable()
	{
		instances.Add(this);
	}

	public void OnDisable()
	{
		instances.Remove(this);
	}
}
public class LightningBeacon : BeaconBase
{
	[Header("Lightning Beacon")]
	public float lightningTime = 0.5f;

	private float lightningTimer = 5f;

	public new void FixedUpdate()
	{
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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_0093: 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_00ac: 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_00b8: 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_00ca: 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)
		//IL_00e0: 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)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Expected O, but got Unknown
		base.FixedUpdate();
		lightningTimer -= Time.fixedDeltaTime;
		if (!asleep && targets.Count > 0 && lightningTimer <= 0f)
		{
			lightningTimer = lightningTime;
			for (int i = 0; i < 2; i++)
			{
				HurtBox val = targets[Random.Range(0, targets.Count - 1)];
				OrbManager.instance.AddOrb((Orb)new LightningStrikeOrb
				{
					attacker = ((Component)this).gameObject,
					damageColorIndex = (DamageColorIndex)3,
					damageValue = damage * 30f,
					isCrit = false,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					target = null,
					lastKnownTargetPosition = PlasmaUtils.RandomTerrainPositionInCylinder(((Component)val).transform.position, 5f, 10f),
					duration = 0.5f
				});
			}
		}
	}
}
public class BMRotationAnimationNetMessage : INetMessage, ISerializableObject
{
	public GameObject targetBody;

	public float rot;

	public void Deserialize(NetworkReader reader)
	{
		targetBody = reader.ReadGameObject();
		rot = reader.ReadSingle();
	}

	public void OnReceived()
	{
		if (Object.op_Implicit((Object)(object)targetBody))
		{
			CharacterBody component = targetBody.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelLocator))
			{
				Animator component2 = ((Component)component.modelLocator.modelBaseTransform).GetComponent<Animator>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.SetFloat("randomRotation", rot);
				}
			}
			else
			{
				PlasmaLog.LogWarn("SetCharacterModelRotationNetMessage: Could not locate animator!");
			}
		}
		else
		{
			PlasmaLog.LogWarn("SetCharacterModelRotationNetMessage: Target gameobject is missing!");
		}
	}

	public void Serialize(NetworkWriter writer)
	{
		writer.Write(targetBody);
		writer.Write(rot);
	}
}
public class HGControllerFinder2 : MonoBehaviour
{
	public Renderer renderer;

	private void OnEnable()
	{
		if (Object.op_Implicit((Object)(object)renderer))
		{
			Material[] sharedMaterials = renderer.sharedMaterials;
			foreach (Material val in sharedMaterials)
			{
				switch (((Object)val.shader).name)
				{
				case "Hopoo Games/Deferred/Standard":
					val.shader = Resources.Load<Shader>("shaders/deferred/hgstandard");
					break;
				case "StubbedShader/fx/hgcloudremap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap");
					break;
				case "Hopoo Games/FX/Cloud Intersection Remap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap");
					break;
				case "StubbedShader/fx/hgopaquecloudremap":
					val.shader = Resources.Load<Shader>("shaders/fx/hgopaquecloudremap");
					break;
				case "StubbedShader/fx/hgdistortion":
					val.shader = Resources.Load<Shader>("shaders/fx/hgdistortion");
					break;
				case "Hopoo Games/FX/Solid Parallax":
					val.shader = Resources.Load<Shader>("shaders/fx/hgsolidparallax");
					break;
				case "Hopoo Games/Environment/Distant Water":
					val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater");
					break;
				case "StubbedShader/fx/hgforwardplanet":
					val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater");
					break;
				case "StubbedShader/deferred/hgtriplanarterrainblend":
					val.shader = Resources.Load<Shader>("shaders/deferred/hgtriplanarterrainblend");
					break;
				case "StubbedShader/deferred/hgsnowtopped":
					val.shader = Resources.Load<Shader>("shaders/deferred/hgsnowtopped");
					break;
				}
			}
		}
		Object.Destroy((Object)(object)this);
	}
}
public class RandomizeAnimatorParameter : NetworkBehaviour
{
	public Animator target;

	public string parameter = "";

	[SyncVar]
	public float netValueFloat;

	public float valueFloat;

	public float NetworknetValueFloat
	{
		get
		{
			return netValueFloat;
		}
		[param: In]
		set
		{
			((NetworkBehaviour)this).SetSyncVar<float>(value, ref netValueFloat, 1u);
		}
	}

	private void Awake()
	{
		if (NetworkServer.active)
		{
			valueFloat = Random.Range(0f, 1f);
			NetworknetValueFloat = valueFloat;
			target.SetFloat(parameter, valueFloat);
		}
	}

	private void FixedUpdate()
	{
		if (netValueFloat != valueFloat)
		{
			if (NetworkServer.active)
			{
				NetworknetValueFloat = valueFloat;
				return;
			}
			valueFloat = netValueFloat;
			target.SetFloat(parameter, valueFloat);
		}
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		if (forceAll)
		{
			writer.Write(netValueFloat);
			return true;
		}
		bool flag = false;
		if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0)
		{
			if (!flag)
			{
				writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
				flag = true;
			}
			writer.Write(netValueFloat);
		}
		if (!flag)
		{
			writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
		}
		return flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		if (initialState)
		{
			netValueFloat = reader.ReadSingle();
			return;
		}
		int num = (int)reader.ReadPackedUInt32();
		if (((uint)num & (true ? 1u : 0u)) != 0)
		{
			netValueFloat = reader.ReadSingle();
		}
	}

	public override void PreStartClient()
	{
	}
}
public class ShockwaveAttack : MonoBehaviour
{
	public ProjectileController projectileController;

	public ProjectileDamage projectileDamage;

	public float damageCoefficient = 1f;

	public float forceCoefficient = 100f;

	public float timeToRefresh = 0.25f;

	private float refreshStopwatch;

	private List<HealthComponent> hitObjects = new List<HealthComponent>();

	public void Start()
	{
		if (!Object.op_Implicit((Object)(object)projectileController))
		{
			projectileController = ((Component)this).GetComponent<ProjectileController>();
		}
		if (!Object.op_Implicit((Object)(object)projectileDamage))
		{
			projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
		}
	}

	public void FixedUpdate()
	{
		refreshStopwatch += Time.fixedDeltaTime;
		if (refreshStopwatch >= timeToRefresh)
		{
			refreshStopwatch = 0f;
			hitObjects.Clear();
		}
	}

	public void OnTriggerEnter(Collider collision)
	{
		CharacterBody component = ((Component)collision).GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.characterMotor) && component.characterMotor.isGrounded && Object.op_Implicit((Object)(object)component.healthComponent))
		{
			PerformDamage(component.healthComponent, component);
		}
	}

	public void OnTriggerExit(Collider collision)
	{
		CharacterBody component = ((Component)collision).GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.characterMotor) && component.characterMotor.isGrounded && Object.op_Implicit((Object)(object)component.healthComponent))
		{
			PerformDamage(component.healthComponent, component);
		}
	}

	public void PerformDamage(HealthComponent healthComponent, CharacterBody body)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		//IL_0056: 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)
		//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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: 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)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: 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)
		//IL_0121: 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)
		if (!NetworkServer.active || !Object.op_Implicit((Object)(object)healthComponent) || hitObjects.Contains(healthComponent))
		{
			return;
		}
		hitObjects.Add(healthComponent);
		DamageInfo val = new DamageInfo();
		val.attacker = projectileController.owner;
		val.inflictor = ((Component)this).gameObject;
		val.force = Vector3.up * forceCoefficient;
		val.damage = damageCoefficient * projectileDamage.damage;
		val.crit = projectileDamage.crit;
		val.position = body.footPosition;
		val.procChainMask = projectileController.procChainMask;
		val.procCoefficient = projectileController.procCoefficient;
		val.damageColorIndex = projectileDamage.damageColorIndex;
		val.damageType = projectileDamage.damageType;
		TeamIndex val2 = (TeamIndex)(-1);
		if (Object.op_Implicit((Object)(object)projectileController.owner))
		{
			TeamComponent component = projectileController.owner.GetComponent<TeamComponent>();
			if (Object.op_Implicit((Object)(object)component))
			{
				val2 = component.teamIndex;
			}
		}
		if (Object.op_Implicit((Object)(object)healthComponent) && FriendlyFireManager.ShouldDirectHitProceed(healthComponent, val2))
		{
			healthComponent.TakeDamage(val);
			GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject);
		}
		GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject);
	}
}
public class BlueLemurianController : MonoBehaviour, IOnKilledServerReceiver
{
	public HealthComponent target;

	private bool expired;

	public float expirationTimer = 10f;

	public void OnKilledServer(DamageReport damageReport)
	{
		//IL_0014: 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)
		//IL_0024: 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_0072: 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)
		if (!expired)
		{
			for (int i = 0; i < 2 * Run.instance.participatingPlayerCount; i++)
			{
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex("LunarCoin.Coin0"), ((Component)this).transform.position, Vector3.up * 30f + new Vector3(Mathf.Sin(MathF.PI * 2f * (float)(i / (2 * Run.instance.participatingPlayerCount))), 0f, Mathf.Cos(MathF.PI * 2f * (float)(i / (2 * Run.instance.participatingPlayerCount))) * 8f));
			}
		}
	}

	private void FixedUdate()
	{
		expirationTimer -= Time.deltaTime;
		if (expirationTimer <= 0f)
		{
			expired = true;
			target.body.inventory.GiveItem(Items.LunarDagger, 1);
			target.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
		}
	}
}
public class LoadSkyboxMatFromAddress : MonoBehaviour
{
	public string address = "";

	public static Dictionary<string, Material> alreadyLoaded = new Dictionary<string, Material>();

	private void Start()
	{
		//IL_001a: 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)
		if (!alreadyLoaded.TryGetValue(address, out var value))
		{
			value = Addressables.LoadAssetAsync<Material>((object)address).WaitForCompletion();
			alreadyLoaded.Add(address, value);
		}
		if (Object.op_Implicit((Object)(object)value))
		{
			RenderSettings.skybox = value;
			DynamicGI.UpdateEnvironment();
		}
	}
}
public static class PlasmaUtils
{
	public static Vector3 RandomTerrainPositionInCylinder(Vector3 position, float radius, float topOfCylinderHeight)
	{
		//IL_001e: 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_0035: 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_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_0056: 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_0084: 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_008b: 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_009a: 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)
		float num = Random.Range(0f, radius);
		float num2 = Random.Range(0f, MathF.PI * 2f);
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(position.x + Mathf.Sin(num2) * num, position.y + topOfCylinderHeight, position.z + Mathf.Cos(num2) * num);
		Ray val2 = new Ray(val, Vector3.down);
		RaycastHit val3 = default(RaycastHit);
		if (Physics.Raycast(val2, ref val3, topOfCylinderHeight * 3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
		{
			return ((RaycastHit)(ref val3)).point;
		}
		return val - Vector3.down * topOfCylinderHeight * 3f;
	}

	public static Vector3 GetNearestNode(Vector3 position, float maxDist = float.PositiveInfinity, HullClassification hullSize = 0, bool useAirNodes = false)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: 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_0037: 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_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_0040: 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_0059: 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_0057: Unknown result type (might be due to invalid IL or missing references)
		Vector3 result = position;
		if (!Object.op_Implicit((Object)(object)SceneInfo.instance))
		{
			PlasmaLog.LogWarn("GetNearestNode: SceneInfo.instance is null!");
			return result;
		}
		NodeGraph val = ((!useAirNodes) ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes);
		NodeIndex val2 = val.FindClosestNode(position, hullSize, maxDist);
		if (val2 != NodeIndex.invalid)
		{
			val.GetNodePosition(val2, ref result);
			return result;
		}
		return position;
	}

	public static void RegisterNetworkPrefabs(GameObject[] gameObjects)
	{
		for (int i = 0; i < gameObjects.Length; i++)
		{
			RegisterNetworkPrefab(gameObjects[i]);
		}
	}

	public static void RegisterNetworkPrefab(GameObject gameObject)
	{
		//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_009b: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)gameObject == (Object)null || !Object.op_Implicit((Object)(object)gameObject))
		{
			PlasmaLog.LogError("Cannot register networkprefab because it is null!");
			return;
		}
		NetworkIdentity val = gameObject.GetComponent<NetworkIdentity>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			PlasmaLog.LogWarn("RegisterNetworkPrefab: Adding NetworkID to prefab " + ((Object)gameObject).name + ", as it has none.");
			val = gameObject.AddComponent<NetworkIdentity>();
		}
		if (Object.op_Implicit((Object)(object)val))
		{
			NetworkHash128 assetId = val.assetId;
			if (((NetworkHash128)(ref assetId)).IsValid())
			{
				ClientScene.RegisterPrefab(gameObject);
				return;
			}
			MethodBase method = new StackFrame(2).GetMethod();
			ClientScene.RegisterPrefab(gameObject, NetworkHash128.Parse(PrefabAPIMakeHash(((Object)gameObject).name + method.DeclaringType.AssemblyQualifiedName + method.Name)));
		}
	}

	public static string PrefabAPIMakeHash(string s)
	{
		MD5 mD = MD5.Create();
		StringBuilder stringBuilder = new StringBuilder();
		byte[] array = mD.ComputeHash(Encoding.UTF8.GetBytes(s));
		foreach (byte b in array)
		{
			stringBuilder.Append(b.ToString("x2"));
		}
		mD.Dispose();
		return stringBuilder.ToString();
	}

	public static void StubShaders(Material[] materials)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: 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_001b: 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_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: 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_0042: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: 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_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)
		//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)
		AsyncOperationHandle<Shader> val = Addressables.LoadAssetAsync<Shader>((object)"48dca5b99d113b8d11006bab44295342");
		AsyncOperationHandle<Shader> val2 = Addressables.LoadAssetAsync<Shader>((object)"bbffe49749c91724d819563daf91445d");
		AsyncOperationHandle<Shader> val3 = Addressables.LoadAssetAsync<Shader>((object)"a035a371a79a19c468ec4e6dc40911c5");
		AsyncOperationHandle<Shader> val4 = Addressables.LoadAssetAsync<Shader>((object)"43a6c7a9084ef9743ab45ee8d5f3c4e9");
		AsyncOperationHandle<Shader> val5 = Addressables.LoadAssetAsync<Shader>((object)"f6bd449dcf2a4496da3d2ad0c3881450");
		AsyncOperationHandle<Shader> val6 = Addressables.LoadAssetAsync<Shader>((object)"302e1057ea9d0e74dab5a0de5cbf611c");
		AsyncOperationHandle<Shader> val7 = Addressables.LoadAssetAsync<Shader>((object)"94b2ede73cf555f4f8549dc24b957446");
		AsyncOperationHandle<Shader> val8 = Addressables.LoadAssetAsync<Shader>((object)"d48a4aa52cd665f45a89801d053c38de");
		AsyncOperationHandle<Shader> val9 = Addressables.LoadAssetAsync<Shader>((object)"cd44d5076b47fbc4d8872b2a500b78f8");
		AsyncOperationHandle<Shader> val10 = Addressables.LoadAssetAsync<Shader>((object)"ec2c273472427df41846b25c110155c2");
		Shader shader = val.WaitForCompletion();
		Shader shader2 = val2.WaitForCompletion();
		Shader shader3 = val3.WaitForCompletion();
		Shader shader4 = val4.WaitForCompletion();
		Shader shader5 = val5.WaitForCompletion();
		Shader shader6 = val6.WaitForCompletion();
		Shader shader7 = val7.WaitForCompletion();
		Shader shader8 = val8.WaitForCompletion();
		Shader shader9 = val9.WaitForCompletion();
		Shader shader10 = val10.WaitForCompletion();
		foreach (Material val11 in materials)
		{
			switch (((Object)val11.shader).name)
			{
			case "StubbedShader/deferred/standard":
				val11.shader = shader;
				break;
			case "Hopoo Games/FX/Cloud Remap":
			case "StubbedShader/fx/hgcloudremap":
				val11.shader = shader2;
				val11.EnableKeyword("USE_CLOUDS");
				val11.EnableKeyword("VERTEXCOLOR");
				val11.EnableKeyword("_EMISSION");
				break;
			case "StubbedShader/fx/hgopaquecloudremap":
				val11.shader = shader3;
				break;
			case "StubbedShader/fx/cloudintersectionremap":
				val11.shader = shader4;
				val11.EnableKeyword("CLOUDOFFSET");
				val11.EnableKeyword("USE_CLOUDS");
				val11.EnableKeyword("_EMISSION");
				break;
			case "StubbedShader/fx/hgdistortion":
				val11.shader = shader5;
				break;
			case "StubbedShader/fx/solidparallax":
				val11.shader = shader6;
				break;
			case "StubbedShader/fx/hgforwardplanet":
				val11.shader = shader7;
				break;
			case "StubbedShader/environment/distantwater":
				val11.shader = shader8;
				break;
			case "StubbedShader/deferred/hgtriplanarterrainblend":
				val11.shader = shader9;
				break;
			case "StubbedShader/deferred/hgsnowtopped":
				val11.shader = shader10;
				break;
			default:
				if (PlasmaLog.debugAll && (((Object)val11.shader).name.ToLower().Contains("stub") || ((Object)val11.shader).name.ToLower().Contains("hopoo")))
				{
					PlasmaLog.LogWarn("[VF2Plugin]: Unable to find shader for stub " + ((Object)val11.shader).name, allLogOnly: true);
				}
				break;
			}
		}
	}
}
public static class PlasmaLog
{
	public static bool debugAll = true;

	private static int sequenceCount = 0;

	private static string[] sequence = new string[30]
	{
		"Memories broken", "The truth goes unspoken", "I've even forgotten my NAAAAAME!", "I don't know the season", "Or what is the reson", "I'm standing here holding my BLAAAAADE!", "A desolate place! (place!)", "Without any trace! (trace!)", "It's only the cold wind I feel", "It's me that I spite",
		"As I stand up and fight", "The only thing I know for real...", "THERE WILL BE", "BLOOD! (BLOOD!)", "SHED! (SHED!)", "THE MAN IN THE MIRROR NODS HIS HEAD!", "THE ONLY ONE!", "LEFT!", "WILL RIDE UPON THE DRAGON'S BACK!", "Because the mountains don't give back what they taaake",
		"OH NO, THERE WILL BE", "BLOOD! (BLOOD!)", "SHED! (SHED!)", "IT'S THE ONLY THING I'VE EVER KNOOOOWN!", "Losing my identityyy", "Wondering, have I gone insane?", "To find the truth in fronta meee", "I must climb this mountain range", "Looking downward from this deadly height", "And never realizing why I fiiiiight!"
	};

	public static void Log(string output, bool allLogOnly = false)
	{
		if (!allLogOnly || debugAll)
		{
			Debug.Log((object)("[FRPlugin.PlasmaCore]: " + output));
		}
	}

	public static void LogWarn(string output, bool allLogOnly = false)
	{
		if (!allLogOnly || debugAll)
		{
			Debug.LogWarning((object)("[FRPlugin.PlasmaCore]: " + output));
		}
	}

	public static void LogError(string output, bool allLogOnly = false)
	{
		if (!allLogOnly || debugAll)
		{
			Debug.LogError((object)("[FRPlugin.PlasmaCore]: " + output));
		}
	}

	public static void LogSequence()
	{
		if (debugAll)
		{
			Debug.LogWarning((object)("[FRPlugin.PlasmaCore]: " + sequence[sequenceCount]));
			sequenceCount++;
			if (sequenceCount >= sequence.Length)
			{
				sequenceCount = 0;
			}
		}
	}
}
public class SetRandomRotationServer : SetRandomRotation
{
	public void Start()
	{
		if (NetworkServer.active)
		{
			((SetRandomRotation)this).Start();
		}
	}
}
public class SkyboxMaterialControllerComponent : MonoBehaviour
{
	public enum MappingType
	{
		SixFrames,
		LatitudeLongitude
	}

	public enum ImageType
	{
		ThreeSixtyDegrees,
		OneEightyDegrees
	}

	public enum ThreeDimensionalLayoutType
	{
		None,
		SideBySide,
		OverUnder
	}

	public Material OverrideMaterial;

	public Color32 _Tint = Color32.op_Implicit(Color.white);

	[Range(0f, 5f)]
	public float _Exposure = 0.5f;

	[Range(0f, 360f)]
	public float _Rotation;

	public Texture SixSided_FrontTex;

	public Texture SixSided_BackTex;

	public Texture SixSided_LeftTex;

	public Texture SixSided_RightTex;

	public Texture SixSided_UpTex;

	public Texture SixSided_DownTex;

	public Texture Panoramic_MainTex;

	public MappingType Panoramic_Mapping;

	public ImageType Panoramic_ImageType;

	public float Panoramic_MirrorOnBack;

	public ThreeDimensionalLayoutType Panoramic_Layout;

	public Texture Cubemap_Tex;

	public void OnEnable()
	{
		GrabMaterialValues();
	}

	public void Update()
	{
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: 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_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)
		if ((Object)(object)OverrideMaterial != (Object)null)
		{
			GrabMaterialValues();
		}
		switch (((Object)RenderSettings.skybox.shader).name)
		{
		case "Skybox/6 Sided":
			RenderSettings.skybox.SetTexture("_FrontTex", SixSided_FrontTex);
			RenderSettings.skybox.SetTexture("_BackTex", SixSided_BackTex);
			RenderSettings.skybox.SetTexture("_LeftTex", SixSided_LeftTex);
			RenderSettings.skybox.SetTexture("_RightTex", SixSided_RightTex);
			RenderSettings.skybox.SetTexture("_UpTex", SixSided_UpTex);
			RenderSettings.skybox.SetTexture("_DownTex", SixSided_DownTex);
			RenderSettings.skybox.SetColor("_Tint", Color32.op_Implicit(_Tint));
			RenderSettings.skybox.SetFloat("_Exposure", _Exposure);
			RenderSettings.skybox.SetFloat("_Rotation", _Rotation);
			DynamicGI.UpdateEnvironment();
			break;
		case "Skybox/Cubemap":
			RenderSettings.skybox.SetTexture("_Tex", Cubemap_Tex);
			RenderSettings.skybox.SetColor("_Tint", Color32.op_Implicit(_Tint));
			RenderSettings.skybox.SetFloat("_Exposure", _Exposure);
			RenderSettings.skybox.SetFloat("_Rotation", _Rotation);
			DynamicGI.UpdateEnvironment();
			break;
		case "Skybox/Panoramic":
			RenderSettings.skybox.SetTexture("_MainTex", Panoramic_MainTex);
			RenderSettings.skybox.SetFloat("_Mapping", (float)Panoramic_Mapping);
			RenderSettings.skybox.SetFloat("_ImageType", (float)Panoramic_ImageType);
			RenderSettings.skybox.SetFloat("_MirrorOnBack", Panoramic_MirrorOnBack);
			RenderSettings.skybox.SetFloat("_Layout", (float)Panoramic_Layout);
			RenderSettings.skybox.SetColor("_Tint", Color32.op_Implicit(_Tint));
			RenderSettings.skybox.SetFloat("_Exposure", _Exposure);
			RenderSettings.skybox.SetFloat("_Rotation", _Rotation);
			DynamicGI.UpdateEnvironment();
			break;
		default:
			PlasmaLog.LogError("SkyboxMaterialControllerComponent: Skybox material uses an invalid shader: " + ((Object)RenderSettings.skybox.shader).name);
			((Behaviour)this).enabled = false;
			break;
		}
	}

	public void GrabMaterialValues()
	{
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: 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_0139: 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_018e: 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)
		if (Object.op_Implicit((Object)(object)OverrideMaterial))
		{
			RenderSettings.skybox = OverrideMaterial;
			OverrideMaterial = null;
		}
		switch (((Object)RenderSettings.skybox.shader).name)
		{
		case "Skybox/6 Sided":
			_Tint = Color32.op_Implicit(RenderSettings.skybox.GetColor("_Tint"));
			_Exposure = RenderSettings.skybox.GetFloat("_Exposure");
			_Rotation = RenderSettings.skybox.GetFloat("_Rotation");
			SixSided_FrontTex = RenderSettings.skybox.GetTexture("_FrontTex");
			SixSided_BackTex = RenderSettings.skybox.GetTexture("_BackTex");
			SixSided_LeftTex = RenderSettings.skybox.GetTexture("_LeftTex");
			SixSided_RightTex = RenderSettings.skybox.GetTexture("_RightTex");
			SixSided_UpTex = RenderSettings.skybox.GetTexture("_UpTex");
			SixSided_DownTex = RenderSettings.skybox.GetTexture("_DownTex");
			break;
		case "Skybox/Cubemap":
			_Tint = Color32.op_Implicit(RenderSettings.skybox.GetColor("_Tint"));
			_Exposure = RenderSettings.skybox.GetFloat("_Exposure");
			_Rotation = RenderSettings.skybox.GetFloat("_Rotation");
			Cubemap_Tex = RenderSettings.skybox.GetTexture("_Tex");
			break;
		case "Skybox/Panoramic":
			_Tint = Color32.op_Implicit(RenderSettings.skybox.GetColor("_Tint"));
			_Exposure = RenderSettings.skybox.GetFloat("_Exposure");
			_Rotation = RenderSettings.skybox.GetFloat("_Rotation");
			Panoramic_MainTex = RenderSettings.skybox.GetTexture("_MainTex");
			Panoramic_Mapping = (MappingType)RenderSettings.skybox.GetFloat("_Mapping");
			Panoramic_ImageType = (ImageType)RenderSettings.skybox.GetFloat("_ImageType");
			Panoramic_MirrorOnBack = RenderSettings.skybox.GetFloat("_MirrorOnBack");
			Panoramic_Layout = (ThreeDimensionalLayoutType)RenderSettings.skybox.GetFloat("_Layout");
			break;
		default:
			PlasmaLog.LogError("SkyboxMaterialControllerComponent: Skybox material uses an invalid shader!");
			((Behaviour)this).enabled = false;
			break;
		}
	}
}
public class TarEssenceOrb : Orb
{
	private float speed = 60f;

	public ProcChainMask procChainMask;

	public override void Begin()
	{
		//IL_0028: 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_002f: 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_0046: Expected O, but got Unknown
		speed = 5f;
		GameObject obj = Resources.Load<GameObject>("Prefabs/Effects/OrbEffects/ClayGooOrbEffect");
		((Orb)this).duration = ((Orb)this).distanceToTarget / speed;
		EffectData val = new EffectData
		{
			origin = base.origin,
			genericFloat = ((Orb)this).duration
		};
		val.SetHurtBoxReference(base.target);
		EffectManager.SpawnEffect(obj, val, true);
	}

	public override void OnArrival()
	{
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Expected O, but got Unknown
		//IL_00e4: 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_00f7: 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)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: 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_012f: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)base.target))
		{
			HealthComponent healthComponent = base.target.healthComponent;
			if (Object.op_Implicit((Object)(object)healthComponent) && Object.op_Implicit((Object)(object)healthComponent.body) && Object.op_Implicit((Object)(object)healthComponent.body.master) && Object.op_Implicit((Object)(object)healthComponent.body.inventory) && healthComponent.body.inventory.GetItemCount(VF2ContentPackProvider.essenceOfTarDef) <= 0 && healthComponent.body.inventory.GetItemCount(VF2ContentPackProvider.tarCorruptionHiddenDef) <= 0)
			{
				healthComponent.body.inventory.GiveItem(VF2ContentPackProvider.essenceOfTarDef, 1);
				healthComponent.body.inventory.GiveItem(VF2ContentPackProvider.tarCorruptionHiddenDef, 1);
				DamageInfo val = new DamageInfo();
				val.damage = healthComponent.combinedHealth;
				val.attacker = null;
				val.inflictor = null;
				val.force = Vector3.zero;
				val.crit = false;
				val.procChainMask = procChainMask;
				val.procCoefficient = 10f;
				val.position = ((Component)base.target).transform.position;
				val.damageColorIndex = (DamageColorIndex)0;
				val.damageType = (DamageType)262658;
				healthComponent.TakeDamage(val);
				healthComponent.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
				((Component)healthComponent.body.master).gameObject.AddComponent<EssenceOfTarController>().target = healthComponent.body.master;
			}
		}
	}
}
public class TeamAreaIndicator : TeamAreaIndicator
{
	public static TeamMaterialPair[] defaultPairs;

	public void Awake()
	{
		//IL_002f: 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_0055: 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_005f: 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_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: 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_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: 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)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		if (defaultPairs == null)
		{
			TeamAreaIndicator component = ((Component)Resources.Load<GameObject>("prefabs/projectiles/titanprefistprojectile").transform.GetChild(0)).GetComponent<TeamAreaIndicator>();
			defaultPairs = (TeamMaterialPair[])(object)new TeamMaterialPair[4]
			{
				new TeamMaterialPair
				{
					teamIndex = (TeamIndex)2,
					sharedMaterial = component.teamMaterialPairs[0].sharedMaterial
				},
				new TeamMaterialPair
				{
					teamIndex = (TeamIndex)1,
					sharedMaterial = component.teamMaterialPairs[1].sharedMaterial
				},
				new TeamMaterialPair
				{
					teamIndex = (TeamIndex)3,
					sharedMaterial = component.teamMaterialPairs[0].sharedMaterial
				},
				new TeamMaterialPair
				{
					teamIndex = (TeamIndex)4,
					sharedMaterial = component.teamMaterialPairs[0].sharedMaterial
				}
			};
		}
		base.teamMaterialPairs = defaultPairs;
	}
}
public class TestMonsterAssignment : MonoBehaviour
{
	public CameraTargetParams cameraTargetParamsTarget;

	private void Awake()
	{
		cameraTargetParamsTarget.cameraParams = Resources.Load<GameObject>("prefabs/characterbodies/LemurianBody").GetComponent<CameraTargetParams>().cameraParams;
	}
}
public class VoidStompersItemBehavior : BaseItemBodyBehavior
{
	private GameObject headstompersControllerObject;

	[ItemDefAssociation(useOnServer = true, useOnClient = false)]
	private static ItemDef GetItemDef()
	{
		return VF2ContentPackProvider.voidStompersDef;
	}

	private void OnEnable()
	{
		headstompersControllerObject = Object.Instantiate<GameObject>(VF2ContentPackProvider.voidStompersController);
		headstompersControllerObject.GetComponent<NetworkedBodyAttachment>().AttachToGameObjectAndSpawn(((Component)((BaseItemBodyBehavior)this).body).gameObject, (string)null);
	}

	private void OnDisable()
	{
		if (Object.op_Implicit((Object)(object)headstompersControllerObject))
		{
			Object.Destroy((Object)(object)headstompersControllerObject);
			headstompersControllerObject = null;
		}
	}
}
namespace AddressablesHelper
{
	[ExecuteAlways]
	public class AddressablesAssetOnChildrens : MonoBehaviour
	{
		public string Key;

		private Object _asset;

		private void Awake()
		{
			Refresh();
		}

		public void Refresh()
		{
			//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)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			_asset = Addressables.LoadAssetAsync<Object>((object)Key).WaitForCompletion();
			if (!Object.op_Implicit(_asset))
			{
				Debug.LogError((object)("AddressablesAsset failed loading " + Key));
				return;
			}
			SurfaceDefProvider[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SurfaceDefProvider>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].surfaceDef = (SurfaceDef)_asset;
			}
			Debug.Log((object)("AddressablesAssetOnChildrens done for " + ((Object)((Component)this).gameObject).name + ": " + Key));
		}

		private void OnValidate()
		{
			Refresh();
		}
	}
	[ExecuteAlways]
	public class InjectRoR2Asset : MonoBehaviour
	{
		public string Key;

		private GameObject instance;

		private void OnEnable()
		{
			Refresh();
		}

		private void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)instance))
			{
				Object.DestroyImmediate((Object)(object)instance);
			}
		}

		private void OnValidate()
		{
			Refresh();
		}

		private void Refresh()
		{
			//IL_001f: 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)
			if (Object.op_Implicit((Object)(object)instance))
			{
				Object.DestroyImmediate((Object)(object)instance);
			}
			instance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)Key).WaitForCompletion(), ((Component)this).gameObject.transform);
		}
	}
	[ExecuteAlways]
	public class InjectRoR2Camera : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Core/Main Camera.prefab").WaitForCompletion(), ((Component)this).gameObject.transform);
		}
	}
	public class AddressablePrefab : MonoBehaviour
	{
		public string AssetPath;

		private GameObject instance;

		public bool _refreshInEditor;

		public bool _networkInstantiate;

		public GameObject GetInstance()
		{
			return instance;
		}

		private void OnEnable()
		{
			Refresh();
		}

		private void OnDisable()
		{
			if (Object.op_Implicit((Object)(object)instance))
			{
				Object.DestroyImmediate((Object)(object)instance);
			}
		}

		private void OnValidate()
		{
			if (_refreshInEditor)
			{
				Refresh();
			}
		}

		private void Refresh()
		{
			//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_0035: 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)
			if (Object.op_Implicit((Object)(object)instance))
			{
				Object.DestroyImmediate((Object)(object)instance);
			}
			if (_networkInstantiate && !Application.isEditor)
			{
				if (NetworkServer.active)
				{
					instance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)AssetPath).WaitForCompletion(), ((Component)this).gameObject.transform);
					NetworkServer.Spawn(instance);
				}
			}
			else
			{
				instance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)AssetPath).WaitForCompletion(), ((Component)this).gameObject.transform);
			}
			((Object)instance).hideFlags = (HideFlags)4;
		}
	}
	[ExecuteAlways]
	public class AddressablesAsset : MonoBehaviour
	{
		public string Key;

		private Object _asset;

		[SerializeField]
		private Component _targetComponent;

		[SerializeField]
		private string _targetMemberInfoName;

		private void Awake()
		{
			Refresh();
		}

		public void Refresh()
		{
			//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)
			_asset = Addressables.LoadAssetAsync<Object>((object)Key).WaitForCompletion();
			if (!Object.op_Implicit(_asset))
			{
				Debug.LogError((object)("AddressablesAsset failed loading " + Key + ", " + ((Object)((Component)this).gameObject).name));
				return;
			}
			if (!Object.op_Implicit((Object)(object)_targetComponent))
			{
				Debug.LogError((object)"AddressablesAsset failed _targetComponent");
				return;
			}
			if (string.IsNullOrWhiteSpace(_targetMemberInfoName))
			{
				Debug.LogError((object)"AddressablesAsset failed IsNullOrWhiteSpace _targetMemberInfoName");
				return;
			}
			MemberInfo memberInfo = (from m in ((object)_targetComponent).GetType().GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)
				where m.GetType().Name == "MonoProperty" || m.GetType().Name == "MonoField" || m.GetType().Name == "FieldInfo" || m.GetType().Name == "PropertyInfo"
				select m).FirstOrDefault((MemberInfo m) => "(" + m.DeclaringType.Name + ") " + m.Name == _targetMemberInfoName);
			if (memberInfo == null)
			{
				Debug.LogError((object)$"AddressablesAsset failed finding targetMemberInfo based on name {_targetMemberInfoName}. Target Component {_targetComponent}");
				return;
			}
			memberInfo.GetType();
			if (memberInfo is FieldInfo fieldInfo)
			{
				fieldInfo.SetValue(_targetComponent, _asset);
			}
			else if (memberInfo is PropertyInfo propertyInfo)
			{
				propertyInfo.SetValue(_targetComponent, _asset);
			}
		}
	}
}
namespace Moonstorm.Components
{
	public class HGControllerFinder : MonoBehaviour
	{
		public Renderer Renderer;

		public Material material;

		public void OnEnable()
		{
			if (!Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)Renderer))
			{
				material = Renderer.material;
			}
			if (Object.op_Implicit((Object)(object)Renderer) && Object.op_Implicit((Object)(object)material))
			{
				Renderer.material = material;
				Renderer.sharedMaterials[0] = material;
				MaterialControllerComponents.MaterialController materialController = null;
				switch (((Object)material.shader).name)
				{
				case "Hopoo Games/Deferred/Standard":
				case "StubbedShader/deferred/standard":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGStandardController>();
					break;
				case "Hopoo Games/Deferred/Snow Topped":
				case "StubbedShader/deferred/hgsnowtopped":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGSnowToppedController>();
					break;
				case "Hopoo Games/FX/Cloud Remap":
				case "StubbedShader/fx/hgcloudremap":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGCloudRemapController>();
					break;
				case "Hopoo Games/FX/Cloud Intersection Remap":
				case "StubbedShader/fx/cloudintersectionremap":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGIntersectionController>();
					break;
				case "Hopoo Games/FX/Solid Parallax":
				case "StubbedShader/fx/solidparallax":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGSolidParallaxController>();
					break;
				case "Hopoo Games/Deferred/Wavy Cloth":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGWavyClothController>();
					break;
				case "Hopoo Games/FX/Opaque Cloud Remap":
				case "StubbedShader/fx/hgopaquecloudremap":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGOpaqueCloudRemap>();
					break;
				case "Hopoo Games/FX/Distant Water":
				case "StubbedShader/environment/distantwater":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGDistantWaterController>();
					break;
				case "Hopoo Games/Deferred/Triplanar Terrain Blend":
				case "StubbedShader/deferred/hgtriplanarterrainblend":
					materialController = ((Component)this).gameObject.AddComponent<MaterialControllerComponents.HGTriplanarController>();
					break;
				}
				if (Object.op_Implicit((Object)(object)materialController))
				{
					materialController.material = material;
					materialController.renderer = Renderer;
					materialController.MaterialName = ((Object)material).name;
					Object.Destroy((Object)(object)this);
				}
				else
				{
					((Behaviour)this).enabled = false;
				}
			}
			else
			{
				((Behaviour)this).enabled = false;
			}
		}
	}
	public class MaterialControllerComponents
	{
		public class MaterialController : MonoBehaviour
		{
			public Material material;

			public Renderer renderer;

			public string MaterialName;
		}

		public class HGTriplanarController : MaterialController
		{
			public enum _RampInfoEnum
			{
				TwoTone,
				SmoothedTwoTone,
				Unlitish,
				Subsurface,
				Grass
			}

			public enum _DecalLayerEnum
			{
				Default,
				Environment,
				Character,
				Misc
			}

			public enum _CullEnum
			{
				Off,
				Front,
				Back
			}

			public bool _ColorsOn;

			public bool _MixColorsOn;

			public bool _MaskOn;

			public bool _VerticalBiasOn;

			public bool _DoubleSampleOn;

			public Color _Color;

			public Texture _NormalTex;

			[Range(0f, 1f)]
			public float _NormalStrength;

			public _RampInfoEnum _RampInfo;

			public _DecalLayerEnum _DecalLayer;

			public _CullEnum _Cull;

			[Range(0f, 1f)]
			public float _TextureFactor;

			[Range(0f, 1f)]
			public float _Depth;

			public Texture _SplatmapTex;

			public Texture _RedChannelTopTex;

			public Texture _RedChannelSideTex;

			[Range(0f, 1f)]
			public float _RedChannelSmoothness;

			[Range(0f, 1f)]
			public float _RedChannelSpecularStrength;

			[Range(0.1f, 20f)]
			public float _RedChannelSpecularExponent;

			[Range(-2f, 5f)]
			public float _RedChannelBias;

			public Texture _GreenChannelTex;

			[Range(0f, 1f)]
			public float _GreenChannelSmoothness;

			[Range(0f, 1f)]
			public float _GreenChannelSpecularStrength;

			[Range(0.1f, 20f)]
			public float _GreenChannelSpecularExponent;

			[Range(-2f, 5f)]
			public float _GreenChannelBias;

			public Texture _BlueChannelTex;

			[Range(0f, 1f)]
			public float _BlueChannelSmoothness;

			[Range(0f, 1f)]
			public float _BlueChannelSpecularStrength;

			[Range(0.1f, 20f)]
			public float _BlueChannelSpecularExponent;

			[Range(-2f, 5f)]
			public float _BlueChannelBias;

			public bool _SnowOn;

			public void Start()
			{
				GrabMaterialValues();
			}

			public void GrabMaterialValues()
			{
				//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)
				if (Object.op_Implicit((Object)(object)material))
				{
					_ColorsOn = material.IsKeywordEnabled("USE_VERTEX_COLORS");
					_MixColorsOn = material.IsKeywordEnabled("MIX_VERTEX_COLORS");
					_MaskOn = material.IsKeywordEnabled("USE_ALPHA_AS_MASK");
					_VerticalBiasOn = material.IsKeywordEnabled("USE_VERTICAL_BIAS");
					_DoubleSampleOn = material.IsKeywordEnabled("DOUBLESAMPLE");
					_Color = material.GetColor("_Color");
					_NormalTex = material.GetTexture("_NormalTex");
					_NormalStrength = material.GetFloat("_NormalStrength");
					_RampInfo = (_RampInfoEnum)material.GetFloat("_RampInfo");
					_DecalLayer = (_DecalLayerEnum)material.GetFloat("_DecalLayer");
					_Cull = (_CullEnum)material.GetFloat("_Cull");
					_TextureFactor = material.GetFloat("_TextureFactor");
					_Depth = material.GetFloat("_Depth");
					_SplatmapTex = material.GetTexture("_SplatmapTex");
					_RedChannelTopTex = material.GetTexture("_RedChannelTopTex");
					_RedChannelSideTex = material.GetTexture("_RedChannelSideTex");
					_RedChannelSmoothness = material.GetFloat("_RedChannelSmoothness");
					_RedChannelSpecularStrength = material.GetFloat("_RedChannelSpecularStrength");
					_RedChannelSpecularExponent = material.GetFloat("_RedChannelSpecularExponent");
					_RedChannelBias = material.GetFloat("_RedChannelBias");
					_GreenChannelTex = material.GetTexture("_GreenChannelTex");
					_GreenChannelSmoothness = material.GetFloat("_GreenChannelSmoothness");
					_GreenChannelSpecularStrength = material.GetFloat("_GreenChannelSpecularStrength");
					_GreenChannelSpecularExponent = material.GetFloat("_GreenChannelSpecularExponent");
					_GreenChannelBias = material.GetFloat("_GreenChannelBias");
					_BlueChannelTex = material.GetTexture("_BlueChannelTex");
					_BlueChannelSmoothness = material.GetFloat("_BlueChannelSmoothness");
					_BlueChannelSpecularStrength = material.GetFloat("_BlueChannelSpecularStrength");
					_BlueChannelSpecularExponent = material.GetFloat("_BlueChannelSpecularExponent");
					_BlueChannelBias = material.GetFloat("_BlueChannelBias");
					_SnowOn = material.IsKeywordEnabled("MICROFACET_SNOW");
				}
			}

			public void Update()
			{
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)material))
				{
					if (((Object)material).name != MaterialName && Object.op_Implicit((Object)(object)renderer))
					{
						GrabMaterialValues();
						PutMaterialIntoMeshRenderer(renderer, material);
					}
					material.SetColor("_Color", _Color);
					material.SetFloat("_NormalStrength", _NormalStrength);
					if (Object.op_Implicit((Object)(object)_NormalTex))
					{
						material.SetTexture("_NormalText", _NormalTex);
					}
					else
					{
						material.SetTexture("_NormalTex", (Texture)null);
					}
					material.SetFloat("_RampInfo", Convert.ToSingle(_RampInfo));
					material.SetFloat("_DecalLayer", Convert.ToSingle(_DecalLayer));
					if (Object.op_Implicit((Object)(object)_RedChannelTopTex))
					{
						material.SetTexture("_RedChannelTopTex", _RedChannelTopTex);
					}
					else
					{
						material.SetTexture("_RedChannelTopTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_RedChannelSideTex))
					{
						material.SetTexture("_RedChannelSideTex", _RedChannelSideTex);
					}
					else
					{
						material.SetTexture("_RedChannelSideTex", (Texture)null);
					}
					material.SetFloat("_RedChannelSmoothness", _RedChannelSmoothness);
					material.SetFloat("_RedChannelSpecularStrength", _RedChannelSpecularStrength);
					material.SetFloat("_RedChannelSpecularExponent", _RedChannelSpecularExponent);
					material.SetFloat("_RedChannelBias", _RedChannelBias);
					if (Object.op_Implicit((Object)(object)_GreenChannelTex))
					{
						material.SetTexture("_GreenChannelTex", _GreenChannelTex);
					}
					else
					{
						material.SetTexture("_GreenChannelTex", (Texture)null);
					}
					material.SetFloat("_GreenChannelSmoothness", _GreenChannelSmoothness);
					material.SetFloat("_GreenChannelSpecularStrength", _GreenChannelSpecularStrength);
					material.SetFloat("_GreenChannelSpecularExponent", _GreenChannelSpecularExponent);
					material.SetFloat("_GreenChannelBias", _GreenChannelBias);
					if (Object.op_Implicit((Object)(object)_BlueChannelTex))
					{
						material.SetTexture("_BlueChannelTex", _BlueChannelTex);
					}
					else
					{
						material.SetTexture("_BlueChannelTex", (Texture)null);
					}
					material.SetFloat("_BlueChannelSmoothness", _BlueChannelSmoothness);
					material.SetFloat("_BlueChannelSpecularStrength", _BlueChannelSpecularStrength);
					material.SetFloat("_BlueChannelSpecularExponent", _BlueChannelSpecularExponent);
					material.SetFloat("_BlueChannelBias", _BlueChannelBias);
					material.SetFloat("_Cull", Convert.ToSingle(_Cull));
					material.SetFloat("_TextureFactor", _TextureFactor);
					material.SetFloat("_Depth", _Depth);
					if (Object.op_Implicit((Object)(object)_SplatmapTex))
					{
						material.SetTexture("_SplatmapTex", _SplatmapTex);
					}
					else
					{
						material.SetTexture("_SplatmapTex", (Texture)null);
					}
					SetShaderKeywordBasedOnBool(_SnowOn, material, "MICROFACET_SNOW");
					SetShaderKeywordBasedOnBool(_ColorsOn, material, "USE_VERTEX_COLORS");
					SetShaderKeywordBasedOnBool(_MixColorsOn, material, "MIX_VERTEX_COLORS");
					SetShaderKeywordBasedOnBool(_MaskOn, material, "USE_ALPHA_AS_MASK");
					SetShaderKeywordBasedOnBool(_VerticalBiasOn, material, "USE_VERTICAL_BIAS");
					SetShaderKeywordBasedOnBool(_DoubleSampleOn, material, "DOUBLESAMPLE");
				}
			}
		}

		public class HGStandardController : MaterialController
		{
			public enum _RampInfoEnum
			{
				TwoTone = 0,
				SmoothedTwoTone = 1,
				Unlitish = 3,
				Subsurface = 4,
				Grass = 5
			}

			public enum _DecalLayerEnum
			{
				Default,
				Environment,
				Character,
				Misc
			}

			public enum _CullEnum
			{
				Off,
				Front,
				Back
			}

			public enum _PrintDirectionEnum
			{
				BottomUp = 0,
				TopDown = 1,
				BackToFront = 3
			}

			public bool _EnableCutout;

			public Color _Color;

			public Texture _MainTex;

			public Vector2 _MainTexScale;

			public Vector2 _MainTexOffset;

			[Range(0f, 5f)]
			public float _NormalStrength;

			public Texture _NormalTex;

			public Vector2 _NormalTexScale;

			public Vector2 _NormalTexOffset;

			public Color _EmColor;

			public Texture _EmTex;

			[Range(0f, 10f)]
			public float _EmPower;

			[Range(0f, 1f)]
			public float _Smoothness;

			public bool _IgnoreDiffuseAlphaForSpeculars;

			public _RampInfoEnum _RampChoice;

			public _DecalLayerEnum _DecalLayer;

			[Range(0f, 1f)]
			public float _SpecularStrength;

			[Range(0.1f, 20f)]
			public float _SpecularExponent;

			public _CullEnum _Cull_Mode;

			public bool _EnableDither;

			[Range(0f, 1f)]
			public float _FadeBias;

			public bool _EnableFresnelEmission;

			public Texture _FresnelRamp;

			[Range(0.1f, 20f)]
			public float _FresnelPower;

			public Texture _FresnelMask;

			[Range(0f, 20f)]
			public float _FresnelBoost;

			public bool _EnablePrinting;

			[Range(-25f, 25f)]
			public float _SliceHeight;

			[Range(0f, 10f)]
			public float _PrintBandHeight;

			[Range(0f, 1f)]
			public float _PrintAlphaDepth;

			public Texture _PrintAlphaTexture;

			public Vector2 _PrintAlphaTextureScale;

			public Vector2 _PrintAlphaTextureOffset;

			[Range(0f, 10f)]
			public float _PrintColorBoost;

			[Range(0f, 4f)]
			public float _PrintAlphaBias;

			[Range(0f, 1f)]
			public float _PrintEmissionToAlbedoLerp;

			public _PrintDirectionEnum _PrintDirection;

			public Texture _PrintRamp;

			[Range(-10f, 10f)]
			public float _EliteBrightnessMin;

			[Range(-10f, 10f)]
			public float _EliteBrightnessMax;

			public bool _EnableSplatmap;

			public bool _UseVertexColorsInstead;

			[Range(0f, 1f)]
			public float _BlendDepth;

			public Texture _SplatmapTex;

			public Vector2 _SplatmapTexScale;

			public Vector2 _SplatmapTexOffset;

			[Range(0f, 20f)]
			public float _SplatmapTileScale;

			public Texture _GreenChannelTex;

			public Texture _GreenChannelNormalTex;

			[Range(0f, 1f)]
			public float _GreenChannelSmoothness;

			[Range(-2f, 5f)]
			public float _GreenChannelBias;

			public Texture _BlueChannelTex;

			public Texture _BlueChannelNormalTex;

			[Range(0f, 1f)]
			public float _BlueChannelSmoothness;

			[Range(-2f, 5f)]
			public float _BlueChannelBias;

			public bool _EnableFlowmap;

			public Texture _FlowTexture;

			public Texture _FlowHeightmap;

			public Vector2 _FlowHeightmapScale;

			public Vector2 _FlowHeightmapOffset;

			public Texture _FlowHeightRamp;

			public Vector2 _FlowHeightRampScale;

			public Vector2 _FlowHeightRampOffset;

			[Range(-1f, 1f)]
			public float _FlowHeightBias;

			[Range(0.1f, 20f)]
			public float _FlowHeightPower;

			[Range(0.1f, 20f)]
			public float _FlowEmissionStrength;

			[Range(0f, 15f)]
			public float _FlowSpeed;

			[Range(0f, 5f)]
			public float _MaskFlowStrength;

			[Range(0f, 5f)]
			public float _NormalFlowStrength;

			[Range(0f, 10f)]
			public float _FlowTextureScaleFactor;

			public bool _EnableLimbRemoval;

			public void Start()
			{
				GrabMaterialValues();
			}

			public void GrabMaterialValues()
			{
				//IL_0032: 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_005e: 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)
				//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_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_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)
				//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_02c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_02df: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e8: 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_03fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0403: Unknown result type (might be due to invalid IL or missing references)
				//IL_051c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0521: Unknown result type (might be due to invalid IL or missing references)
				//IL_0532: Unknown result type (might be due to invalid IL or missing references)
				//IL_0537: Unknown result type (might be due to invalid IL or missing references)
				//IL_055e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0563: 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)
				if (Object.op_Implicit((Object)(object)material))
				{
					_EnableCutout = material.IsKeywordEnabled("CUTOUT");
					_Color = material.GetColor("_Color");
					_MainTex = material.GetTexture("_MainTex");
					_MainTexScale = material.GetTextureScale("_MainTex");
					_MainTexOffset = material.GetTextureOffset("_MainTex");
					_NormalStrength = material.GetFloat("_NormalStrength");
					_NormalTex = material.GetTexture("_NormalTex");
					_NormalTexScale = material.GetTextureScale("_NormalTex");
					_NormalTexOffset = material.GetTextureOffset("_NormalTex");
					_EmColor = material.GetColor("_EmColor");
					_EmTex = material.GetTexture("_EmTex");
					_EmPower = material.GetFloat("_EmPower");
					_Smoothness = material.GetFloat("_Smoothness");
					_IgnoreDiffuseAlphaForSpeculars = material.IsKeywordEnabled("FORCE_SPEC");
					_RampChoice = (_RampInfoEnum)material.GetFloat("_RampInfo");
					_DecalLayer = (_DecalLayerEnum)material.GetFloat("_DecalLayer");
					_SpecularStrength = material.GetFloat("_SpecularStrength");
					_SpecularExponent = material.GetFloat("_SpecularExponent");
					_Cull_Mode = (_CullEnum)material.GetFloat("_Cull");
					_EnableDither = material.IsKeywordEnabled("DITHER");
					_FadeBias = material.GetFloat("_FadeBias");
					_EnableFresnelEmission = material.IsKeywordEnabled("FRESNEL_EMISSION");
					_FresnelRamp = material.GetTexture("_FresnelRamp");
					_FresnelPower = material.GetFloat("_FresnelPower");
					_FresnelMask = material.GetTexture("_FresnelMask");
					_FresnelBoost = material.GetFloat("_FresnelBoost");
					_EnablePrinting = material.IsKeywordEnabled("PRINT_CUTOFF");
					_SliceHeight = material.GetFloat("_SliceHeight");
					_PrintBandHeight = material.GetFloat("_SliceBandHeight");
					_PrintAlphaDepth = material.GetFloat("_SliceAlphaDepth");
					_PrintAlphaTexture = material.GetTexture("_SliceAlphaTex");
					_PrintAlphaTextureScale = material.GetTextureScale("_SliceAlphaTex");
					_PrintAlphaTextureOffset = material.GetTextureOffset("_SliceAlphaTex");
					_PrintColorBoost = material.GetFloat("_PrintBoost");
					_PrintAlphaBias = material.GetFloat("_PrintBias");
					_PrintEmissionToAlbedoLerp = material.GetFloat("_PrintEmissionToAlbedoLerp");
					_PrintDirection = (_PrintDirectionEnum)material.GetFloat("_PrintDirection");
					_PrintRamp = material.GetTexture("_PrintRamp");
					_EliteBrightnessMin = material.GetFloat("_EliteBrightnessMin");
					_EliteBrightnessMax = material.GetFloat("_EliteBrightnessMax");
					_EnableSplatmap = material.IsKeywordEnabled("SPLATMAP");
					_UseVertexColorsInstead = material.IsKeywordEnabled("USE_VERTEX_COLORS");
					_BlendDepth = material.GetFloat("_Depth");
					_SplatmapTex = material.GetTexture("_SplatmapTex");
					_SplatmapTexScale = material.GetTextureScale("_SplatmapTex");
					_SplatmapTexOffset = material.GetTextureOffset("_SplatmapTex");
					_SplatmapTileScale = material.GetFloat("_SplatmapTileScale");
					_GreenChannelTex = material.GetTexture("_GreenChannelTex");
					_GreenChannelNormalTex = material.GetTexture("_GreenChannelNormalTex");
					_GreenChannelSmoothness = material.GetFloat("_GreenChannelSmoothness");
					_GreenChannelBias = material.GetFloat("_GreenChannelBias");
					_BlueChannelTex = material.GetTexture("_BlueChannelTex");
					_BlueChannelNormalTex = material.GetTexture("_BlueChannelNormalTex");
					_BlueChannelSmoothness = material.GetFloat("_BlueChannelSmoothness");
					_BlueChannelBias = material.GetFloat("_BlueChannelBias");
					_EnableFlowmap = material.IsKeywordEnabled("FLOWMAP");
					_FlowTexture = material.GetTexture("_FlowTex");
					_FlowHeightmap = material.GetTexture("_FlowHeightmap");
					_FlowHeightmapScale = material.GetTextureScale("_FlowHeightmap");
					_FlowHeightmapOffset = material.GetTextureOffset("_FlowHeightmap");
					_FlowHeightRamp = material.GetTexture("_FlowHeightRamp");
					_FlowHeightRampScale = material.GetTextureScale("_FlowHeightRamp");
					_FlowHeightRampOffset = material.GetTextureOffset("_FlowHeightRamp");
					_FlowHeightBias = material.GetFloat("_FlowHeightBias");
					_FlowHeightPower = material.GetFloat("_FlowHeightPower");
					_FlowEmissionStrength = material.GetFloat("_FlowEmissionStrength");
					_FlowSpeed = material.GetFloat("_FlowSpeed");
					_MaskFlowStrength = material.GetFloat("_FlowMaskStrength");
					_NormalFlowStrength = material.GetFloat("_FlowNormalStrength");
					_FlowTextureScaleFactor = material.GetFloat("_FlowTextureScaleFactor");
					_EnableLimbRemoval = material.IsKeywordEnabled("LIMBREMOVAL");
					MaterialName = ((Object)material).name;
				}
			}

			public void Update()
			{
				//IL_006e: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: 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_03cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e3: 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_054b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0729: Unknown result type (might be due to invalid IL or missing references)
				//IL_073f: Unknown result type (might be due to invalid IL or missing references)
				//IL_078b: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)material))
				{
					if (((Object)material).name != MaterialName && Object.op_Implicit((Object)(object)renderer))
					{
						GrabMaterialValues();
						PutMaterialIntoMeshRenderer(renderer, material);
					}
					SetShaderKeywordBasedOnBool(_EnableCutout, material, "CUTOUT");
					material.SetColor("_Color", _Color);
					if (Object.op_Implicit((Object)(object)_MainTex))
					{
						material.SetTexture("_MainTex", _MainTex);
						material.SetTextureScale("_MainTex", _MainTexScale);
						material.SetTextureOffset("_MainTex", _MainTexOffset);
					}
					else
					{
						material.SetTexture("_MainTex", (Texture)null);
					}
					material.SetFloat("_NormalStrength", _NormalStrength);
					if (Object.op_Implicit((Object)(object)_NormalTex))
					{
						material.SetTexture("_NormalTex", _NormalTex);
						material.SetTextureScale("_NormalTex", _NormalTexScale);
						material.SetTextureOffset("_NormalTex", _NormalTexOffset);
					}
					else
					{
						material.SetTexture("_NormalTex", (Texture)null);
					}
					material.SetColor("_EmColor", _EmColor);
					if (Object.op_Implicit((Object)(object)_EmTex))
					{
						material.SetTexture("_EmTex", _EmTex);
					}
					else
					{
						material.SetTexture("_EmTex", (Texture)null);
					}
					material.SetFloat("_EmPower", _EmPower);
					material.SetFloat("_Smoothness", _Smoothness);
					SetShaderKeywordBasedOnBool(_IgnoreDiffuseAlphaForSpeculars, material, "FORCE_SPEC");
					material.SetFloat("_RampInfo", Convert.ToSingle(_RampChoice));
					material.SetFloat("_DecalLayer", Convert.ToSingle(_DecalLayer));
					material.SetFloat("_SpecularStrength", _SpecularStrength);
					material.SetFloat("_SpecularExponent", _SpecularExponent);
					material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode));
					SetShaderKeywordBasedOnBool(_EnableDither, material, "DITHER");
					material.SetFloat("_FadeBias", _FadeBias);
					SetShaderKeywordBasedOnBool(_EnableFresnelEmission, material, "FRESNEL_EMISSION");
					if (Object.op_Implicit((Object)(object)_FresnelRamp))
					{
						material.SetTexture("_FresnelRamp", _FresnelRamp);
					}
					else
					{
						material.SetTexture("_FresnelRamp", (Texture)null);
					}
					material.SetFloat("_FresnelPower", _FresnelPower);
					if (Object.op_Implicit((Object)(object)_FresnelMask))
					{
						material.SetTexture("_FresnelMask", _FresnelMask);
					}
					else
					{
						material.SetTexture("_FresnelMask", (Texture)null);
					}
					material.SetFloat("_FresnelBoost", _FresnelBoost);
					SetShaderKeywordBasedOnBool(_EnablePrinting, material, "PRINT_CUTOFF");
					material.SetFloat("_SliceHeight", _SliceHeight);
					material.SetFloat("_SliceBandHeight", _PrintBandHeight);
					material.SetFloat("_SliceAlphaDepth", _PrintAlphaDepth);
					if (Object.op_Implicit((Object)(object)_PrintAlphaTexture))
					{
						material.SetTexture("_SliceAlphaTex", _PrintAlphaTexture);
						material.SetTextureScale("_SliceAlphaTex", _PrintAlphaTextureScale);
						material.SetTextureOffset("_SliceAlphaTex", _PrintAlphaTextureOffset);
					}
					else
					{
						material.SetTexture("_SliceAlphaTex", (Texture)null);
					}
					material.SetFloat("_PrintBoost", _PrintColorBoost);
					material.SetFloat("_PrintBias", _PrintAlphaBias);
					material.SetFloat("_PrintEmissionToAlbedoLerp", _PrintEmissionToAlbedoLerp);
					material.SetFloat("_PrintDirection", Convert.ToSingle(_PrintDirection));
					if (Object.op_Implicit((Object)(object)_PrintRamp))
					{
						material.SetTexture("_PrintRamp", _PrintRamp);
					}
					else
					{
						material.SetTexture("_PrintRamp", (Texture)null);
					}
					material.SetFloat("_EliteBrightnessMin", _EliteBrightnessMin);
					material.SetFloat("_EliteBrightnessMax", _EliteBrightnessMax);
					SetShaderKeywordBasedOnBool(_EnableSplatmap, material, "SPLATMAP");
					SetShaderKeywordBasedOnBool(_UseVertexColorsInstead, material, "USE_VERTEX_COLORS");
					material.SetFloat("_Depth", _BlendDepth);
					if (Object.op_Implicit((Object)(object)_SplatmapTex))
					{
						material.SetTexture("_SplatmapTex", _SplatmapTex);
						material.SetTextureScale("_SplatmapTex", _SplatmapTexScale);
						material.SetTextureOffset("_SplatmapTex", _SplatmapTexOffset);
					}
					else
					{
						material.SetTexture("_SplatmapTex", (Texture)null);
					}
					material.SetFloat("_SplatmapTileScale", _SplatmapTileScale);
					if (Object.op_Implicit((Object)(object)_GreenChannelTex))
					{
						material.SetTexture("_GreenChannelTex", _GreenChannelTex);
					}
					else
					{
						material.SetTexture("_GreenChannelTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_GreenChannelNormalTex))
					{
						material.SetTexture("_GreenChannelNormalTex", _GreenChannelNormalTex);
					}
					else
					{
						material.SetTexture("_GreenChannelNormalTex", (Texture)null);
					}
					material.SetFloat("_GreenChannelSmoothness", _GreenChannelSmoothness);
					material.SetFloat("_GreenChannelBias", _GreenChannelBias);
					if (Object.op_Implicit((Object)(object)_BlueChannelTex))
					{
						material.SetTexture("_BlueChannelTex", _BlueChannelTex);
					}
					else
					{
						material.SetTexture("_BlueChannelTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_BlueChannelNormalTex))
					{
						material.SetTexture("_BlueChannelNormalTex", _BlueChannelNormalTex);
					}
					else
					{
						material.SetTexture("_BlueChannelNormalTex", (Texture)null);
					}
					material.SetFloat("_BlueChannelSmoothness", _BlueChannelSmoothness);
					material.SetFloat("_BlueChannelBias", _BlueChannelBias);
					SetShaderKeywordBasedOnBool(_EnableFlowmap, material, "FLOWMAP");
					if (Object.op_Implicit((Object)(object)_FlowTexture))
					{
						material.SetTexture("_FlowTex", _FlowTexture);
					}
					else
					{
						material.SetTexture("_FlowTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_FlowHeightmap))
					{
						material.SetTexture("_FlowHeightmap", _FlowHeightmap);
						material.SetTextureScale("_FlowHeightmap", _FlowHeightmapScale);
						material.SetTextureOffset("_FlowHeightmap", _FlowHeightmapOffset);
					}
					else
					{
						material.SetTexture("_FlowHeightmap", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_FlowHeightRamp))
					{
						material.SetTexture("_FlowHeightRamp", _FlowHeightRamp);
						material.SetTextureScale("_FlowHeightRamp", _FlowHeightRampScale);
						material.SetTextureOffset("_FlowHeightRamp", _FlowHeightRampOffset);
					}
					else
					{
						material.SetTexture("_FlowHeightRamp", (Texture)null);
					}
					material.SetFloat("_FlowHeightBias", _FlowHeightBias);
					material.SetFloat("_FlowHeightPower", _FlowHeightPower);
					material.SetFloat("_FlowEmissionStrength", _FlowEmissionStrength);
					material.SetFloat("_FlowSpeed", _FlowSpeed);
					material.SetFloat("_FlowMaskStrength", _MaskFlowStrength);
					material.SetFloat("_FlowNormalStrength", _NormalFlowStrength);
					material.SetFloat("_FlowTextureScaleFactor", _FlowTextureScaleFactor);
					SetShaderKeywordBasedOnBool(_EnableLimbRemoval, material, "LIMBREMOVAL");
				}
			}
		}

		public class HGSnowToppedController : MaterialController
		{
			public enum _RampInfoEnum
			{
				TwoTone = 0,
				SmoothedTwoTone = 1,
				Unlitish = 3,
				Subsurface = 4,
				Grass = 5
			}

			public Color _Color;

			public Texture _MainTex;

			public Vector2 _MainTexScale;

			public Vector2 _MainTexOffset;

			[Range(0f, 5f)]
			public float _NormalStrength;

			public Texture _NormalTex;

			public Vector2 _NormalTexScale;

			public Vector2 _NormalTexOffset;

			public Texture _SnowTex;

			public Vector2 _SnowTexScale;

			public Vector2 _SnowTexOffset;

			public Texture _SnowNormalTex;

			public Vector2 _SnowNormalTexScale;

			public Vector2 _SnowNormalTexOffset;

			[Range(-1f, 1f)]
			public float _SnowBias;

			[Range(0f, 1f)]
			public float _Depth;

			public bool _IgnoreAlphaWeights;

			public bool _BlendWeightsBinarily;

			public _RampInfoEnum _RampChoice;

			public bool _IgnoreDiffuseAlphaForSpeculars;

			[Range(0f, 1f)]
			public float _SpecularStrength;

			[Range(0.1f, 20f)]
			public float _SpecularExponent;

			[Range(0f, 1f)]
			public float _Smoothness;

			[Range(0f, 1f)]
			public float _SnowSpecularStrength;

			[Range(0.1f, 20f)]
			public float _SnowSpecularExponent;

			[Range(0f, 1f)]
			public float _SnowSmoothness;

			public bool _DitherOn;

			public bool _TriplanarOn;

			[Range(0f, 1f)]
			public float _TriplanarTextureFactor;

			public bool _SnowOn;

			public bool _GradientBiasOn;

			public Vector4 _GradientBiasVector;

			public bool __DirtOn;

			public Texture _DirtTex;

			public Vector2 _DirtTexScale;

			public Vector2 _DirtTexOffset;

			public Texture _DirtNormalTex;

			public Vector2 _DirtNormalTexScale;

			public Vector2 _DirtNormalTexOffset;

			[Range(-2f, 2f)]
			public float _DirtBias;

			[Range(0f, 1f)]
			public float _DirtSpecularStrength;

			[Range(0f, 20f)]
			public float _DirtSpecularExponent;

			[Range(0f, 1f)]
			public float _DirtSmoothness;

			public void Start()
			{
				GrabMaterialValues();
			}

			public void GrabMaterialValues()
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: 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_004d: 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)
				//IL_0063: 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)
				//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_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_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_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_013a: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0309: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_031f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0324: 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_0350: Unknown result type (might be due to invalid IL or missing references)
				//IL_0361: 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)
				if (Object.op_Implicit((Object)(object)material))
				{
					_Color = material.GetColor("_Color");
					_MainTex = material.GetTexture("_MainTex");
					_MainTexScale = material.GetTextureScale("_MainTex");
					_MainTexOffset = material.GetTextureOffset("_MainTex");
					_NormalStrength = material.GetFloat("_NormalStrength");
					_NormalTex = material.GetTexture("_NormalTex");
					_NormalTexScale = material.GetTextureScale("_NormalTex");
					_NormalTexOffset = material.GetTextureOffset("_NormalTex");
					_SnowTex = material.GetTexture("_SnowTex");
					_SnowTexScale = material.GetTextureScale("_SnowTex");
					_SnowTexOffset = material.GetTextureOffset("_SnowTex");
					_SnowNormalTex = material.GetTexture("_SnowNormalTex");
					_SnowNormalTexScale = material.GetTextureScale("_SnowNormalTex");
					_SnowNormalTexOffset = material.GetTextureOffset("_SnowNormalTex");
					_SnowBias = material.GetFloat("_SnowBias");
					_Depth = material.GetFloat("_Depth");
					_IgnoreAlphaWeights = material.IsKeywordEnabled("IGNORE_BIAS");
					_BlendWeightsBinarily = material.IsKeywordEnabled("BINARYBLEND");
					_RampChoice = (_RampInfoEnum)material.GetFloat("_RampInfo");
					_IgnoreDiffuseAlphaForSpeculars = material.IsKeywordEnabled("FORCE_SPEC");
					_SpecularStrength = material.GetFloat("_SpecularStrength");
					_SpecularExponent = material.GetFloat("_SpecularExponent");
					_Smoothness = material.GetFloat("_Smoothness");
					_SnowSpecularStrength = material.GetFloat("_SnowSpecularStrength");
					_SnowSpecularExponent = material.GetFloat("_SnowSpecularExponent");
					_SnowSmoothness = material.GetFloat("_SnowSmoothness");
					_DitherOn = material.IsKeywordEnabled("DITHER");
					_TriplanarOn = material.IsKeywordEnabled("TRIPLANAR");
					_TriplanarTextureFactor = material.GetFloat("_TriplanarTextureFactor");
					_SnowOn = material.IsKeywordEnabled("MICROFACET_SNOW");
					_GradientBiasOn = material.IsKeywordEnabled("GRADIENTBIAS");
					_GradientBiasVector = material.GetVector("_GradientBiasVector");
					__DirtOn = material.IsKeywordEnabled("DIRTON");
					_DirtTex = material.GetTexture("_DirtTex");
					_DirtTexScale = material.GetTextureScale("_DirtTex");
					_DirtTexOffset = material.GetTextureOffset("_DirtTex");
					_DirtNormalTex = material.GetTexture("_DirtNormalTex");
					_DirtNormalTexScale = material.GetTextureScale("_DirtNormalTex");
					_DirtNormalTexOffset = material.GetTextureOffset("_DirtNormalTex");
					_DirtBias = material.GetFloat("_DirtBias");
					_DirtSpecularStrength = material.GetFloat("_DirtSpecularStrength");
					_DirtSpecularExponent = material.GetFloat("_DirtSpecularExponent");
					_DirtSmoothness = material.GetFloat("_DirtSmoothness");
					MaterialName = ((Object)material).name;
				}
			}

			public void Update()
			{
				//IL_0058: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: 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_0181: 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_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_038c: 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_03f1: 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_0453: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)material))
				{
					if (((Object)material).name != MaterialName && Object.op_Implicit((Object)(object)renderer))
					{
						GrabMaterialValues();
						PutMaterialIntoMeshRenderer(renderer, material);
					}
					material.SetColor("_Color", _Color);
					if (Object.op_Implicit((Object)(object)_MainTex))
					{
						material.SetTexture("_MainTex", _MainTex);
						material.SetTextureScale("_MainTex", _MainTexScale);
						material.SetTextureOffset("_MainTex", _MainTexOffset);
					}
					else
					{
						material.SetTexture("_MainTex", (Texture)null);
					}
					material.SetFloat("_NormalStrength", _NormalStrength);
					if (Object.op_Implicit((Object)(object)_NormalTex))
					{
						material.SetTexture("_NormalTex", _NormalTex);
						material.SetTextureScale("_NormalTex", _NormalTexScale);
						material.SetTextureOffset("_NormalTex", _NormalTexOffset);
					}
					else
					{
						material.SetTexture("_NormalTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_SnowTex))
					{
						material.SetTexture("_SnowTex", _SnowTex);
						material.SetTextureScale("_SnowTex", _SnowTexScale);
						material.SetTextureOffset("_SnowTex", _SnowTexOffset);
					}
					else
					{
						material.SetTexture("_SnowTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_SnowNormalTex))
					{
						material.SetTexture("_SnowNormalTex", _SnowNormalTex);
						material.SetTextureScale("_SnowNormalTex", _SnowNormalTexScale);
						material.SetTextureOffset("_SnowNormalTex", _SnowNormalTexOffset);
					}
					else
					{
						material.SetTexture("_SnowNormalTex", (Texture)null);
					}
					material.SetFloat("_SnowBias", _SnowBias);
					material.SetFloat("_Depth", _Depth);
					SetShaderKeywordBasedOnBool(_IgnoreAlphaWeights, material, "IGNORE_BIAS");
					SetShaderKeywordBasedOnBool(_BlendWeightsBinarily, material, "BINARYBLEND");
					material.SetFloat("_RampInfo", Convert.ToSingle(_RampChoice));
					SetShaderKeywordBasedOnBool(_IgnoreDiffuseAlphaForSpeculars, material, "FORCE_SPEC");
					material.SetFloat("_SpecularStrength", _SpecularStrength);
					material.SetFloat("_SpecularExponent", _SpecularExponent);
					material.SetFloat("_Smoothness", _Smoothness);
					material.SetFloat("_SnowSpecularStrength", _SnowSpecularStrength);
					material.SetFloat("_SnowSpecularExponent", _SnowSpecularExponent);
					material.SetFloat("_SnowSmoothness", _SnowSmoothness);
					SetShaderKeywordBasedOnBool(_DitherOn, material, "DITHER");
					SetShaderKeywordBasedOnBool(_TriplanarOn, material, "TRIPLANAR");
					material.SetFloat("_TriplanarTextureFactor", _TriplanarTextureFactor);
					SetShaderKeywordBasedOnBool(_SnowOn, material, "MICROFACET_SNOW");
					SetShaderKeywordBasedOnBool(_GradientBiasOn, material, "GRADIENTBIAS");
					material.SetVector("_GradientBiasVector", _GradientBiasVector);
					SetShaderKeywordBasedOnBool(__DirtOn, material, "DIRTON");
					if (Object.op_Implicit((Object)(object)_DirtTex))
					{
						material.SetTexture("_DirtTex", _DirtTex);
						material.SetTextureScale("_DirtTex", _DirtTexScale);
						material.SetTextureOffset("_DirtTex", _DirtTexOffset);
					}
					else
					{
						material.SetTexture("_DirtTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_DirtNormalTex))
					{
						material.SetTexture("_DirtNormalTex", _DirtNormalTex);
						material.SetTextureScale("_DirtNormalTex", _DirtNormalTexScale);
						material.SetTextureOffset("_DirtNormalTex", _DirtNormalTexOffset);
					}
					else
					{
						material.SetTexture("_DirtNormalTex", (Texture)null);
					}
					material.SetFloat("_DirtBias", _DirtBias);
					material.SetFloat("_DirtSpecularStrength", _DirtSpecularStrength);
					material.SetFloat("_DirtSpecularExponent", _DirtSpecularExponent);
					material.SetFloat("_DirtSmoothness", _DirtSmoothness);
				}
			}
		}

		public class HGCloudRemapController : MaterialController
		{
			public enum _BlendEnums
			{
				Zero,
				One,
				DstColor,
				SrcColor,
				OneMinusDstColor,
				SrcAlpha,
				OneMinusSrcColor,
				DstAlpha,
				OneMinusDstAlpha,
				SrcAlphaSaturate,
				OneMinusSrcAlpha
			}

			public enum _CullEnum
			{
				Off,
				Front,
				Back
			}

			public enum _ZTestEnum
			{
				Disabled,
				Never,
				Less,
				Equal,
				LessEqual,
				Greater,
				NotEqual,
				GreaterEqual,
				Always
			}

			public _BlendEnums _SrcBlend;

			public _BlendEnums _DstBlend;

			public Color _Tint;

			public bool _DisableRemapping;

			public Texture _MainTex;

			public Vector2 _MainTexScale;

			public Vector2 _MainTexOffset;

			public Texture _RemapTex;

			public Vector2 _RemapTexScale;

			public Vector2 _RemapTexOffset;

			[Range(0f, 2f)]
			public float _SoftFactor;

			[Range(1f, 20f)]
			public float _BrightnessBoost;

			[Range(0f, 20f)]
			public float _AlphaBoost;

			[Range(0f, 1f)]
			public float _AlphaBias;

			public bool _UseUV1;

			public bool _FadeWhenNearCamera;

			[Range(0f, 1f)]
			public float _FadeCloseDistance;

			public _CullEnum _Cull_Mode;

			public _ZTestEnum _ZTest_Mode;

			[Range(-10f, 10f)]
			public float _DepthOffset;

			public bool _CloudRemapping;

			public bool _DistortionClouds;

			[Range(-2f, 2f)]
			public float _DistortionStrength;

			public Texture _Cloud1Tex;

			public Vector2 _Cloud1TexScale;

			public Vector2 _Cloud1TexOffset;

			public Texture _Cloud2Tex;

			public Vector2 _Cloud2TexScale;

			public Vector2 _Cloud2TexOffset;

			public Vector4 _CutoffScroll;

			public bool _VertexColors;

			public bool _LuminanceForVertexAlpha;

			public bool _LuminanceForTextureAlpha;

			public bool _VertexOffset;

			public bool _FresnelFade;

			public bool _SkyboxOnly;

			[Range(-20f, 20f)]
			public float _FresnelPower;

			[Range(0f, 3f)]
			public float _VertexOffsetAmount;

			public void Start()
			{
				GrabMaterialValues();
			}

			public void GrabMaterialValues()
			{
				//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_008c: 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_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_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_00e4: 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_0230: Unknown result type (might be due to invalid IL or missing references)
				//IL_0235: Unknown result type (might be due to invalid IL or missing references)
				//IL_0246: Unknown result type (might be due to invalid IL or missing references)
				//IL_024b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0272: Unknown result type (might be due to invalid IL or missing references)
				//IL_0277: Unknown result type (might be due to invalid IL or missing references)
				//IL_0288: Unknown result type (might be due to invalid IL or missing references)
				//IL_028d: Unknown result type (might be due to invalid IL or missing references)
				//IL_029e: 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)
				if (Object.op_Implicit((Object)(object)material))
				{
					_SrcBlend = (_BlendEnums)material.GetFloat("_SrcBlend");
					_DstBlend = (_BlendEnums)material.GetFloat("_DstBlend");
					_Tint = material.GetColor("_TintColor");
					_DisableRemapping = material.IsKeywordEnabled("DISABLEREMAP");
					_MainTex = material.GetTexture("_MainTex");
					_MainTexScale = material.GetTextureScale("_MainTex");
					_MainTexOffset = material.GetTextureOffset("_MainTex");
					_RemapTex = material.GetTexture("_RemapTex");
					_RemapTexScale = material.GetTextureScale("_RemapTex");
					_RemapTexOffset = material.GetTextureOffset("_RemapTex");
					_SoftFactor = material.GetFloat("_InvFade");
					_BrightnessBoost = material.GetFloat("_Boost");
					_AlphaBoost = material.GetFloat("_AlphaBoost");
					_AlphaBias = material.GetFloat("_AlphaBias");
					_UseUV1 = material.IsKeywordEnabled("USE_UV1");
					_FadeWhenNearCamera = material.IsKeywordEnabled("FADECLOSE");
					_FadeCloseDistance = material.GetFloat("_FadeCloseDistance");
					_Cull_Mode = (_CullEnum)material.GetFloat("_Cull");
					_ZTest_Mode = (_ZTestEnum)material.GetFloat("_ZTest");
					_DepthOffset = material.GetFloat("_DepthOffset");
					_CloudRemapping = material.IsKeywordEnabled("USE_CLOUDS");
					_DistortionClouds = material.IsKeywordEnabled("CLOUDOFFSET");
					_DistortionStrength = material.GetFloat("_DistortionStrength");
					_Cloud1Tex = material.GetTexture("_Cloud1Tex");
					_Cloud1TexScale = material.GetTextureScale("_Cloud1Tex");
					_Cloud1TexOffset = material.GetTextureOffset("_Cloud1Tex");
					_Cloud2Tex = material.GetTexture("_Cloud2Tex");
					_Cloud2TexScale = material.GetTextureScale("_Cloud2Tex");
					_Cloud2TexOffset = material.GetTextureOffset("_Cloud2Tex");
					_CutoffScroll = material.GetVector("_CutoffScroll");
					_VertexColors = material.IsKeywordEnabled("VERTEXCOLOR");
					_LuminanceForVertexAlpha = material.IsKeywordEnabled("VERTEXALPHA");
					_LuminanceForTextureAlpha = material.IsKeywordEnabled("CALCTEXTUREALPHA");
					_VertexOffset = material.IsKeywordEnabled("VERTEXOFFSET");
					_FresnelFade = material.IsKeywordEnabled("FRESNEL");
					_SkyboxOnly = material.IsKeywordEnabled("SKYBOX_ONLY");
					_FresnelPower = material.GetFloat("_FresnelPower");
					_VertexOffsetAmount = material.GetFloat("_OffsetAmount");
					MaterialName = ((Object)material).name;
				}
			}

			public void Update()
			{
				//IL_0098: 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_00fd: 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_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_033f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0355: Unknown result type (might be due to invalid IL or missing references)
				//IL_037e: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)material))
				{
					if (((Object)material).name != MaterialName && Object.op_Implicit((Object)(object)renderer))
					{
						GrabMaterialValues();
						PutMaterialIntoMeshRenderer(renderer, material);
					}
					material.SetFloat("_SrcBlend", Convert.ToSingle(_SrcBlend));
					material.SetFloat("_DstBlend", Convert.ToSingle(_DstBlend));
					material.SetColor("_TintColor", _Tint);
					SetShaderKeywordBasedOnBool(_DisableRemapping, material, "DISABLEREMAP");
					if (Object.op_Implicit((Object)(object)_MainTex))
					{
						material.SetTexture("_MainTex", _MainTex);
						material.SetTextureScale("_MainTex", _MainTexScale);
						material.SetTextureOffset("_MainTex", _MainTexOffset);
					}
					else
					{
						material.SetTexture("_MainTex", (Texture)null);
					}
					if (Object.op_Implicit((Object)(object)_RemapTex))
					{
						material.SetTexture("_RemapTex", _RemapTex);
						material.SetTextureScale("_RemapTex", _RemapTexScale);
						material.SetTextureOffset("_RemapTex", _RemapTexOffset);
					}
					else
					{
						material.SetTexture("_RemapTex", (Texture)null);
					}
					material.SetFloat("_InvFade", _SoftFactor);
					material.SetFloat("_Boost", _BrightnessBoost);
					material.SetFloat("_AlphaBoost", _AlphaBoost);
					material.SetFloat("_AlphaBias", _AlphaBias);
					SetShaderKeywordBasedOnBool(_UseUV1, material, "USE_UV1");
					SetShaderKeywordBasedOnBool(_FadeWhenNearCamera, material, "FADECLOSE");
					material.SetFloat("_FadeCloseDistance", _FadeCloseDistance);
					material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode));
					material.SetFloat("_ZTest", Convert.ToSingle(_ZT