Decompiled source of VanillaMapObjectsEditor v1.1.0

VanillaMapObjectsEditor.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using BepInEx;
using HarmonyLib;
using MapsExt;
using MapsExt.Editor.Events;
using MapsExt.Editor.MapObjects;
using MapsExt.Editor.Properties;
using MapsExt.Editor.UI;
using MapsExt.Properties;
using MapsExt.Utils;
using MapsExt.Visualizers;
using UnboundLib;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UI.ProceduralImage;
using VanillaMapObjects.MapObjectProperties;
using VanillaMapObjects.MapObjects;
using VanillaMapObjectsEditor.Events;
using VanillaMapObjectsEditor.MapObjects;
using VanillaMapObjectsEditor.Visualizers;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("VanillaMapObjectsEditor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VanillaMapObjectsEditor")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0a008048-73d9-4aec-9873-f16c05de9855")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MapsExt.Visualizers
{
	internal interface IMapObjectVisualizer
	{
		void SetEnabled(bool enabled);
	}
}
namespace VanillaMapObjectsEditor
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rsmind.rounds.vanillamapobjectseditor", "Vanilla Map Objects Editor", "1.1.0")]
	[BepInProcess("Rounds.exe")]
	public class VanillaMapObjectsEditor : BaseUnityPlugin
	{
		private const string ModId = "com.rsmind.rounds.vanillamapobjectseditor";

		private const string ModName = "Vanilla Map Objects Editor";

		public const string Version = "1.1.0";

		public static VanillaMapObjectsEditor instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.rsmind.rounds.vanillamapobjectseditor");
			val.PatchAll();
		}

		private void Start()
		{
			instance = this;
		}
	}
}
namespace VanillaMapObjectsEditor.Visualizers
{
	public class SpringyRopeVisualizer : MonoBehaviour, IMapObjectVisualizer
	{
		private EditorSpringyRope.RopeInstance _rope;

		private LineRenderer _renderer;

		private Graphic _startGraphic;

		private Graphic _endGraphic;

		public void SetEnabled(bool enabled)
		{
			((Behaviour)this).enabled = enabled;
		}

		protected virtual void Start()
		{
			_rope = ((Component)this).gameObject.GetComponent<EditorSpringyRope.RopeInstance>();
		}

		protected virtual void OnEnable()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0047: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: 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_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			_renderer = ((Component)this).gameObject.GetComponent<LineRenderer>();
			((Renderer)_renderer).material = new Material(Shader.Find("Sprites/Default"));
			_renderer.startColor = new Color(0.039f, 0.039f, 0.039f, 1f);
			_renderer.endColor = _renderer.startColor;
			_renderer.startWidth = 0.2f;
			_renderer.endWidth = 0.2f;
			GameObject val = new GameObject("Canvas");
			val.transform.SetParent(((Component)this).transform);
			Canvas val2 = val.AddComponent<Canvas>();
			val2.renderMode = (RenderMode)0;
			GameObject val3 = new GameObject("Rope Start");
			GameObject val4 = new GameObject("Rope End");
			val3.transform.SetParent(val.transform);
			val4.transform.SetParent(val.transform);
			_startGraphic = (Graphic)(object)val3.AddComponent<ProceduralImage>();
			_endGraphic = (Graphic)(object)val4.AddComponent<ProceduralImage>();
			_startGraphic.rectTransform.sizeDelta = Vector2.one * 10f;
			_endGraphic.rectTransform.sizeDelta = Vector2.one * 10f;
			_startGraphic.color = new Color(1f, 1f, 1f, 0.5f);
			_endGraphic.color = new Color(1f, 1f, 1f, 0.5f);
			UniformModifier val5 = val3.AddComponent<UniformModifier>();
			UniformModifier val6 = val4.AddComponent<UniformModifier>();
			val5.Radius = 5f;
			val6.Radius = 5f;
		}

		protected virtual void OnDisable()
		{
			_renderer = null;
			_startGraphic = null;
			_endGraphic = null;
			Object.Destroy((Object)(object)((Component)((Component)this).transform.Find("Canvas")).gameObject);
		}

		private void LateUpdate()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: 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)
			if (Object.op_Implicit((Object)(object)_renderer) && Object.op_Implicit((Object)(object)_startGraphic) && Object.op_Implicit((Object)(object)_endGraphic))
			{
				Vector3 position = ((Component)_rope.GetAnchor(0)).transform.position;
				Vector3 position2 = ((Component)_rope.GetAnchor(1)).transform.position;
				_renderer.SetPositions((Vector3[])(object)new Vector3[2] { position, position2 });
				((Component)_startGraphic).transform.position = MainCam.instance.cam.WorldToScreenPoint(position);
				((Component)_endGraphic).transform.position = MainCam.instance.cam.WorldToScreenPoint(position2);
				_startGraphic.color = (_rope.GetAnchor(0).IsAttached ? new Color(0f, 0.5f, 1f) : new Color(1f, 1f, 1f));
				_endGraphic.color = (_rope.GetAnchor(1).IsAttached ? new Color(0f, 0.5f, 1f) : new Color(1f, 1f, 1f));
			}
		}
	}
}
namespace VanillaMapObjectsEditor.MapObjects
{
	[EditorMapObject(typeof(AdjustableHealthBoxData), "Destructible Box", Category = "Advanced")]
	public sealed class EditorAdjustableHealthBox : AdjustableHealthBox
	{
		public override void OnInstantiate(GameObject instance)
		{
			((AdjustableHealthBox)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
		}
	}
	[EditorMapObject(typeof(AdjustableMassBoxBgData), "Variable Box (Background)", Category = "Advanced")]
	public sealed class EditorAdjustableMassBoxBg : AdjustableMassBoxBg
	{
		public override void OnInstantiate(GameObject instance)
		{
			((AdjustableMassBoxBg)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
		}
	}
	[EditorMapObject(typeof(AdjustableMassBoxData), "Variable Box", Category = "Advanced")]
	public sealed class EditorAdjustableMassBox : AdjustableMassBox
	{
		public override void OnInstantiate(GameObject instance)
		{
			((AdjustableMassBox)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
		}
	}
	[EditorMapObject(typeof(AdjustableMassSawData), "Dynamic Saw", Category = "Advanced")]
	public sealed class EditorAdjustableMassSaw : AdjustableMassSaw
	{
		public override void OnInstantiate(GameObject instance)
		{
			((AdjustableMassSaw)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
		}
	}
	[EditorMapObject(typeof(SpringyRopeData), "Springy Rope", Category = "Advanced")]
	public sealed class EditorSpringyRope : SpringyRope
	{
		public class RopeInstance : MonoBehaviour
		{
			private List<MapObjectAnchor> _anchors;

			protected virtual void Awake()
			{
				_anchors = ((Component)this).gameObject.GetComponentsInChildren<MapObjectAnchor>().ToList();
			}

			public MapObjectAnchor GetAnchor(int index)
			{
				return _anchors[index];
			}
		}

		public override GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Editor Rope");

		public override void OnInstantiate(GameObject instance)
		{
			((SpringyRope)this).OnInstantiate(instance);
			RopeInstance orAddComponent = ExtensionMethods.GetOrAddComponent<RopeInstance>(instance, false);
			ExtensionMethods.GetOrAddComponent<MapObjectPart>(((Component)orAddComponent.GetAnchor(0)).gameObject, false);
			ExtensionMethods.GetOrAddComponent<MapObjectPart>(((Component)orAddComponent.GetAnchor(1)).gameObject, false);
			ExtensionMethods.GetOrAddComponent<SpringyRopeVisualizer>(instance, false);
		}
	}
	[EditorMapObject(typeof(MovingPlatformData), "Moving Platform", Category = "Advanced")]
	public sealed class EditorMovingPlatform : MovingPlatform
	{
		public override void OnInstantiate(GameObject instance)
		{
			((MovingPlatform)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
			((Behaviour)instance.GetComponentInChildren<MoveSequence>()).enabled = false;
		}
	}
	[EditorMapObject(typeof(WreckingBallData), "Wrecking Ball", Category = "Advanced")]
	public sealed class EditorWreckingBall : WreckingBall
	{
		public override void OnInstantiate(GameObject instance)
		{
			((WreckingBall)this).OnInstantiate(instance);
			GameObjectUtils.DisableRigidbody(instance);
		}
	}
	[EditorMapObject(typeof(SmasherData), "Smasher", Category = "Advanced")]
	public sealed class EditorSmasher : Smasher
	{
		public override void OnInstantiate(GameObject instance)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			((Smasher)this).OnInstantiate(instance);
			((Behaviour)instance.GetComponentInChildren<CurveAnimation>()).enabled = false;
			((Behaviour)instance.GetComponentInChildren<DelayEvent>()).enabled = false;
			instance.transform.Find("Anim").localScale = new Vector3(1f, 8f, 1f);
		}
	}
}
namespace VanillaMapObjectsEditor.MapObjectProperties
{
	[EditorPropertySerializer(typeof(SpringyRopeAttributesProperty))]
	internal class EditorSpringyRopeAttributesPropertySerializer : SpringyRopeAttributesPropertySerializer, IPropertyReader<SpringyRopeAttributesProperty>
	{
		public override void WriteProperty(SpringyRopeAttributesProperty property, GameObject target)
		{
			((SpringyRopeAttributesPropertySerializer)this).WriteProperty(property, target);
			ExtensionMethods.GetOrAddComponent<SpringyRopeAttributesHandler>(target, false);
		}

		public virtual SpringyRopeAttributesProperty ReadProperty(GameObject instance)
		{
			return instance.GetComponent<SpringyRopeAttributesPropertyInstance>().Attributes;
		}
	}
	[InspectorElement(typeof(SpringyRopeAttributesProperty))]
	public class SpringyRopeAttributesElement : InspectorElement
	{
		private TextSliderInput _frequency;

		private TextSliderInput _damping;

		private GameObject menuInstance;

		public SpringyRopeAttributesProperty Value
		{
			get
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Expected O, but got Unknown
				return new SpringyRopeAttributesProperty(_frequency.Value, _damping.Value);
			}
			set
			{
				HandleInputChange(value, (ChangeType)2);
			}
		}

		protected override GameObject GetInstance()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			menuInstance = new GameObject("SpringyRopeAttributesGroup");
			VerticalLayoutGroup val = menuInstance.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)val).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)val).childForceExpandWidth = true;
			GameObject val2 = Object.Instantiate<GameObject>(Assets.InspectorSliderInputPrefab, menuInstance.transform);
			InspectorSliderInput component = val2.GetComponent<InspectorSliderInput>();
			component.Label.text = "Frequency";
			component.Input.MinValue = 0f;
			component.Input.Slider.minValue = 0f;
			component.Input.MaxValue = 10f;
			component.Input.Slider.maxValue = 10f;
			component.Input.Value = PropertyExtensions.ReadProperty<SpringyRopeAttributesProperty>(((InspectorElement)this).Context.InspectorTarget).Frequency;
			_frequency = component.Input;
			TextSliderInput frequency = _frequency;
			frequency.OnChanged = (Action<float, ChangeType>)Delegate.Combine(frequency.OnChanged, (Action<float, ChangeType>)delegate(float value, ChangeType changeType)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				HandleInputChange(new SpringyRopeAttributesProperty(value, Value.DampingRatio), changeType);
			});
			GameObject val3 = Object.Instantiate<GameObject>(Assets.InspectorSliderInputPrefab, menuInstance.transform);
			InspectorSliderInput component2 = val3.GetComponent<InspectorSliderInput>();
			component2.Label.text = "Damping Ratio";
			component2.Input.MinValue = 0f;
			component2.Input.Slider.minValue = 0f;
			component2.Input.MaxValue = 1f;
			component2.Input.Slider.maxValue = 1f;
			component2.Input.Value = PropertyExtensions.ReadProperty<SpringyRopeAttributesProperty>(((InspectorElement)this).Context.InspectorTarget).DampingRatio;
			_damping = component2.Input;
			TextSliderInput damping = _damping;
			damping.OnChanged = (Action<float, ChangeType>)Delegate.Combine(damping.OnChanged, (Action<float, ChangeType>)delegate(float value, ChangeType changeType)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				HandleInputChange(new SpringyRopeAttributesProperty(Value.Frequency, value), changeType);
			});
			return menuInstance;
		}

		public override void OnUpdate()
		{
			SpringyRopeAttributesProperty value = Value;
			_frequency.SetWithoutEvent(value.Frequency);
			_damping.SetWithoutEvent(value.DampingRatio);
		}

		private void HandleInputChange(SpringyRopeAttributesProperty value, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<SpringyRopeAttributesProperty>(((InspectorElement)this).Context.InspectorTarget, value);
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}
	}
	[EditorPropertySerializer(typeof(MoveSequenceProperty))]
	internal class EditorMoveSequencePropertySerializer : MoveSequencePropertySerializer, IPropertyReader<MoveSequenceProperty>
	{
		public virtual MoveSequenceProperty ReadProperty(GameObject instance)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			Vector2[] positions = instance.GetComponent<MoveSequence>().positions;
			float spring = instance.GetComponent<MoveSequence>().spring;
			float timeAtPos = instance.GetComponent<MoveSequence>().timeAtPos;
			return new MoveSequenceProperty(positions, spring, timeAtPos);
		}

		public override void WriteProperty(MoveSequenceProperty property, GameObject target)
		{
			((MoveSequencePropertySerializer)this).WriteProperty(property, target);
			ExtensionMethods.GetOrAddComponent<MoveSequenceHandler>(target, false);
		}
	}
	[InspectorElement(typeof(MoveSequenceProperty))]
	public class MoveSequenceElement : InspectorElement
	{
		private TextSliderInput _spring;

		private TextSliderInput _timeAtPos;

		private TextSliderInput _size;

		private List<Vector2Input> _input;

		private List<GameObject> _inputObjects;

		private GameObject menuInstance;

		private MoveSequenceProperty _property;

		public MoveSequenceProperty Value
		{
			get
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Expected O, but got Unknown
				return new MoveSequenceProperty(((InspectorElement)this).Context.InspectorTarget.GetComponent<MoveSequence>().positions, ((InspectorElement)this).Context.InspectorTarget.GetComponent<MoveSequence>().spring, ((InspectorElement)this).Context.InspectorTarget.GetComponent<MoveSequence>().timeAtPos);
			}
			set
			{
				HandleInputChange(value, (ChangeType)2);
			}
		}

		protected override GameObject GetInstance()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			menuInstance = new GameObject("MoveSequenceGroup");
			VerticalLayoutGroup val = menuInstance.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)val).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)val).childForceExpandWidth = true;
			GameObject val2 = Object.Instantiate<GameObject>(Assets.InspectorSliderInputPrefab, menuInstance.transform);
			InspectorSliderInput component = val2.GetComponent<InspectorSliderInput>();
			component.Label.text = "Spring";
			component.Input.MinValue = 0f;
			component.Input.Slider.minValue = 100f;
			component.Input.MaxValue = 1000f;
			component.Input.Slider.maxValue = 1000f;
			_spring = component.Input;
			TextSliderInput spring = _spring;
			spring.OnChanged = (Action<float, ChangeType>)Delegate.Combine(spring.OnChanged, (Action<float, ChangeType>)delegate(float value, ChangeType changeType)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Expected O, but got Unknown
				HandleInputChange(new MoveSequenceProperty(Value.Positions, value, Value.TimeAtPos), changeType);
			});
			GameObject val3 = Object.Instantiate<GameObject>(Assets.InspectorSliderInputPrefab, menuInstance.transform);
			InspectorSliderInput component2 = val3.GetComponent<InspectorSliderInput>();
			component2.Label.text = "Time At Position";
			component2.Input.MinValue = 0f;
			component2.Input.Slider.minValue = 0f;
			component2.Input.MaxValue = 60f;
			component2.Input.Slider.maxValue = 60f;
			_timeAtPos = component2.Input;
			TextSliderInput timeAtPos = _timeAtPos;
			timeAtPos.OnChanged = (Action<float, ChangeType>)Delegate.Combine(timeAtPos.OnChanged, (Action<float, ChangeType>)delegate(float value, ChangeType changeType)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Expected O, but got Unknown
				HandleInputChange(new MoveSequenceProperty(Value.Positions, Value.Spring, value), changeType);
			});
			GameObject val4 = Object.Instantiate<GameObject>(Assets.InspectorSliderInputPrefab, menuInstance.transform);
			InspectorSliderInput component3 = val4.GetComponent<InspectorSliderInput>();
			component3.Label.text = "Position Count";
			component3.Input.MinValue = 2f;
			component3.Input.Slider.minValue = 2f;
			component3.Input.MaxValue = 16f;
			component3.Input.Slider.maxValue = 16f;
			_size = component3.Input;
			TextSliderInput size = _size;
			size.OnChanged = (Action<float, ChangeType>)Delegate.Combine(size.OnChanged, (Action<float, ChangeType>)delegate(float value, ChangeType changeType)
			{
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Expected O, but got Unknown
				Vector2[] array = (Vector2[])(object)new Vector2[(int)Math.Round(value)];
				Value.Positions.Take((int)Math.Round(value)).ToArray().CopyTo(array, 0);
				HandleInputChange(new MoveSequenceProperty(array, Value.Spring, Value.TimeAtPos), changeType);
			});
			_input = new List<Vector2Input>();
			_inputObjects = new List<GameObject>();
			SetInputs();
			return menuInstance;
		}

		private void SetInputs()
		{
			for (int num = _inputObjects.Count - 1; num >= Value.Positions.Length; num--)
			{
				Object.Destroy((Object)(object)_inputObjects[num]);
				_inputObjects.RemoveAt(num);
				_input.RemoveAt(num);
			}
			for (int j = _inputObjects.Count; j < Value.Positions.Length; j++)
			{
				GameObject val = Object.Instantiate<GameObject>(Assets.InspectorVector2InputPrefab, menuInstance.transform);
				InspectorVector2Input component = val.GetComponent<InspectorVector2Input>();
				component.Label.text = "Position " + (j + 1);
				_input.Add(component.Input);
				int i = j;
				Vector2Input obj = _input[j];
				obj.OnChanged = (Action<Vector2, ChangeType>)Delegate.Combine(obj.OnChanged, (Action<Vector2, ChangeType>)delegate(Vector2 value, ChangeType changeType)
				{
					//IL_0019: Unknown result type (might be due to invalid IL or missing references)
					//IL_001a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					//IL_004b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0051: Expected O, but got Unknown
					Vector2[] positions = Value.Positions;
					positions[i] = value;
					HandleInputChange(new MoveSequenceProperty(positions, Value.Spring, Value.TimeAtPos), changeType);
					SetInputs();
				});
				_inputObjects.Add(val);
			}
		}

		public override void OnUpdate()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			SetInputs();
			MoveSequenceProperty value = Value;
			for (int i = 0; i < value.Positions.Length; i++)
			{
				_input[i].SetWithoutEvent(value.Positions[i]);
			}
			_size.SetWithoutEvent((float)value.Positions.Length);
			_spring.SetWithoutEvent(value.Spring);
			_timeAtPos.SetWithoutEvent(value.TimeAtPos);
		}

		private void HandleInputChange(MoveSequenceProperty value, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<MoveSequenceProperty>(((InspectorElement)this).Context.InspectorTarget, value);
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}
	}
	[EditorPropertySerializer(typeof(BoxHealthProperty))]
	internal class EditorBoxHealthPropertySerializer : BoxHealthPropertySerializer, IPropertyReader<BoxHealthProperty>
	{
		public override void WriteProperty(BoxHealthProperty property, GameObject target)
		{
			((BoxHealthPropertySerializer)this).WriteProperty(property, target);
			ExtensionMethods.GetOrAddComponent<BoxHealthHandler>(target, false);
		}

		public virtual BoxHealthProperty ReadProperty(GameObject instance)
		{
			return instance.GetComponent<BoxHealthPropertyInstance>().Health;
		}
	}
	[InspectorElement(typeof(BoxHealthProperty))]
	public class BoxHealthElement : FloatElement
	{
		public BoxHealthElement()
			: base("Health", 1f, 1000f)
		{
		}

		protected override void OnChange(float delay, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<BoxHealthProperty>(((InspectorElement)this).Context.InspectorTarget, new BoxHealthProperty(delay));
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}

		protected override float GetValue()
		{
			return ((ValueProperty<float>)(object)PropertyExtensions.ReadProperty<BoxHealthProperty>(((InspectorElement)this).Context.InspectorTarget)).Value;
		}
	}
	[EditorPropertySerializer(typeof(MassProperty))]
	internal class EditorMassPropertySerializer : MassPropertySerializer, IPropertyReader<MassProperty>
	{
		public override void WriteProperty(MassProperty property, GameObject target)
		{
			((MassPropertySerializer)this).WriteProperty(property, target);
			ExtensionMethods.GetOrAddComponent<MassHandler>(target, false);
		}

		public virtual MassProperty ReadProperty(GameObject instance)
		{
			return instance.GetComponent<MassPropertyInstance>().Mass;
		}
	}
	[InspectorElement(typeof(MassProperty))]
	public class MassElement : FloatElement
	{
		public MassElement()
			: base("Mass", 0f, 1000f)
		{
		}

		protected override void OnChange(float mass, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<MassProperty>(((InspectorElement)this).Context.InspectorTarget, new MassProperty(mass));
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}

		protected override float GetValue()
		{
			return ((ValueProperty<float>)(object)PropertyExtensions.ReadProperty<MassProperty>(((InspectorElement)this).Context.InspectorTarget)).Value;
		}
	}
	[EditorPropertySerializer(typeof(DelayProperty))]
	internal class EditorDelayPropertySerializer : DelayPropertySerializer, IPropertyReader<DelayProperty>
	{
		public override void WriteProperty(DelayProperty property, GameObject target)
		{
			((DelayPropertySerializer)this).WriteProperty(property, target);
			ExtensionMethods.GetOrAddComponent<SmasherDelayHandler>(target, false);
		}

		public virtual DelayProperty ReadProperty(GameObject instance)
		{
			return instance.GetComponent<DelayPropertyInstance>().Delay;
		}
	}
	[InspectorElement(typeof(DelayProperty))]
	public class DelayElement : FloatElement
	{
		public DelayElement()
			: base("Delay", 0f, 5.9f)
		{
		}

		protected override void OnChange(float delay, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<DelayProperty>(((InspectorElement)this).Context.InspectorTarget, new DelayProperty(delay));
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}

		protected override float GetValue()
		{
			return ((ValueProperty<float>)(object)PropertyExtensions.ReadProperty<DelayProperty>(((InspectorElement)this).Context.InspectorTarget)).Value;
		}
	}
	[EditorPropertySerializer(typeof(SpringyRopePositionProperty))]
	public class EditorSpringyRopePositionPropertySerializer : IPropertySerializer<SpringyRopePositionProperty>, IPropertyWriter<SpringyRopePositionProperty>, IPropertyReader<SpringyRopePositionProperty>
	{
		public virtual void WriteProperty(SpringyRopePositionProperty property, GameObject target)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			EditorSpringyRope.RopeInstance component = target.GetComponent<EditorSpringyRope.RopeInstance>();
			component.GetAnchor(0).Detach();
			((Component)component.GetAnchor(0)).transform.position = Vector2.op_Implicit(property.StartPosition);
			component.GetAnchor(0).UpdateAttachment();
			ExtensionMethods.GetOrAddComponent<RopeAnchorPositionHandler>(((Component)component.GetAnchor(0)).gameObject, false);
			component.GetAnchor(1).Detach();
			((Component)component.GetAnchor(1)).transform.position = Vector2.op_Implicit(property.EndPosition);
			component.GetAnchor(1).UpdateAttachment();
			ExtensionMethods.GetOrAddComponent<RopeAnchorPositionHandler>(((Component)component.GetAnchor(1)).gameObject, false);
		}

		public virtual SpringyRopePositionProperty ReadProperty(GameObject instance)
		{
			//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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			EditorSpringyRope.RopeInstance ropeInstance = instance.GetComponent<EditorSpringyRope.RopeInstance>() ?? throw new ArgumentException("GameObject does not have a rope instance", "instance");
			return new SpringyRopePositionProperty
			{
				StartPosition = ropeInstance.GetAnchor(0).GetAnchoredPosition(),
				EndPosition = ropeInstance.GetAnchor(1).GetAnchoredPosition()
			};
		}
	}
	[InspectorElement(typeof(SpringyRopePositionProperty))]
	public class SpringyRopePositionElement : InspectorElement
	{
		private Vector2Input _input1;

		private Vector2Input _input2;

		public SpringyRopePositionProperty Value
		{
			get
			{
				//IL_0016: 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_003c: Expected O, but got Unknown
				return new SpringyRopePositionProperty(((InspectorElement)this).Context.InspectorTarget.GetComponent<EditorSpringyRope.RopeInstance>().GetAnchor(0).GetAnchoredPosition(), ((InspectorElement)this).Context.InspectorTarget.GetComponent<EditorSpringyRope.RopeInstance>().GetAnchor(1).GetAnchoredPosition());
			}
			set
			{
				HandleInputChange(value, (ChangeType)2);
			}
		}

		protected override GameObject GetInstance()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GameObject val = new GameObject("RopePositionGroup");
			VerticalLayoutGroup val2 = val.AddComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)val2).childControlWidth = true;
			((HorizontalOrVerticalLayoutGroup)val2).childControlHeight = true;
			((HorizontalOrVerticalLayoutGroup)val2).childForceExpandWidth = true;
			GameObject val3 = Object.Instantiate<GameObject>(Assets.InspectorVector2InputPrefab, val.transform);
			InspectorVector2Input component = val3.GetComponent<InspectorVector2Input>();
			component.Label.text = "Anchor Position 1";
			_input1 = component.Input;
			Vector2Input input = _input1;
			input.OnChanged = (Action<Vector2, ChangeType>)Delegate.Combine(input.OnChanged, (Action<Vector2, ChangeType>)delegate(Vector2 value, ChangeType changeType)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				HandleInputChange(new SpringyRopePositionProperty(value, Value.EndPosition), changeType);
			});
			GameObject val4 = Object.Instantiate<GameObject>(Assets.InspectorVector2InputPrefab, val.transform);
			InspectorVector2Input component2 = val4.GetComponent<InspectorVector2Input>();
			component2.Label.text = "Anchor Position 2";
			_input2 = component2.Input;
			Vector2Input input2 = _input2;
			input2.OnChanged = (Action<Vector2, ChangeType>)Delegate.Combine(input2.OnChanged, (Action<Vector2, ChangeType>)delegate(Vector2 value, ChangeType changeType)
			{
				//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_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				HandleInputChange(new SpringyRopePositionProperty(Value.StartPosition, value), changeType);
			});
			return val;
		}

		public override void OnUpdate()
		{
			//IL_000f: 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)
			SpringyRopePositionProperty value = Value;
			_input1.SetWithoutEvent(value.StartPosition);
			_input2.SetWithoutEvent(value.EndPosition);
		}

		private void HandleInputChange(SpringyRopePositionProperty value, ChangeType changeType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			if ((int)changeType == 1 || (int)changeType == 2)
			{
				PropertyExtensions.WriteProperty<SpringyRopePositionProperty>(((InspectorElement)this).Context.InspectorTarget, value);
			}
			if ((int)changeType == 2)
			{
				((InspectorElement)this).Context.Editor.TakeSnaphot();
			}
		}
	}
}
namespace VanillaMapObjectsEditor.Events
{
	internal class SpringyRopeAttributesHandler : EditorEventHandler, ITransformModifyingEditorEventHandler
	{
		private bool _isChanging;

		private SpringyRopeAttributesProperty _prevAttributes;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private TransformChangedEventHandler m_OnTransformChanged;

		public GameObject Content { get; private set; }

		public event TransformChangedEventHandler OnTransformChanged
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
		}

		protected override void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EditorEventHandler)this).Awake();
			Content = new GameObject("Spring Attributes Interaction Content");
			Content.transform.SetParent(((Component)this).transform);
			Content.transform.localScale = Vector3.one;
			Content.layer = 31;
			Content.AddComponent<GraphicRaycaster>();
			Canvas component = Content.GetComponent<Canvas>();
			component.renderMode = (RenderMode)2;
			component.worldCamera = MainCam.instance.cam;
		}

		protected virtual void Update()
		{
		}

		public virtual void SetValue(SpringyRopeAttributesProperty attributes)
		{
			((Component)this).GetComponent<SpringyRopeAttributesPropertyInstance>().Attributes = attributes;
			TransformChangedEventHandler onTransformChanged = this.OnTransformChanged;
			if (onTransformChanged != null)
			{
				onTransformChanged.Invoke();
			}
		}

		public virtual SpringyRopeAttributesProperty GetValue()
		{
			return ((Component)this).GetComponent<SpringyRopeAttributesPropertyInstance>().Attributes;
		}

		private void OnChangeStart()
		{
			_isChanging = true;
			_prevAttributes = GetValue();
		}

		private void OnChangeEnd()
		{
			_isChanging = false;
			if (GetValue() != _prevAttributes)
			{
				((EditorEventHandler)this).Editor.TakeSnaphot();
			}
		}

		protected override void HandleEvent(IEditorEvent evt)
		{
		}
	}
	internal class BoxHealthHandler : EditorEventHandler, ITransformModifyingEditorEventHandler
	{
		private bool _isChanging;

		private BoxHealthProperty _prevHealth;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private TransformChangedEventHandler m_OnTransformChanged;

		public GameObject Content { get; private set; }

		public event TransformChangedEventHandler OnTransformChanged
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
		}

		protected override void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EditorEventHandler)this).Awake();
			Content = new GameObject("Box Health Interaction Content");
			Content.transform.SetParent(((Component)this).transform);
			Content.transform.localScale = Vector3.one;
			Content.layer = 31;
			Content.AddComponent<GraphicRaycaster>();
			Canvas component = Content.GetComponent<Canvas>();
			component.renderMode = (RenderMode)2;
			component.worldCamera = MainCam.instance.cam;
		}

		protected virtual void Update()
		{
		}

		public virtual void SetValue(BoxHealthProperty health)
		{
			((Component)this).GetComponent<BoxHealthPropertyInstance>().Health = health;
			DamagableEvent val = ((Component)this).GetComponentInChildren<DamagableEvent>() ?? throw new ArgumentException("GameObject does not have a damageable script", "gameObject");
			val.maxHP = ((ValueProperty<float>)(object)health).Value;
			val.currentHP = ((ValueProperty<float>)(object)health).Value;
			TransformChangedEventHandler onTransformChanged = this.OnTransformChanged;
			if (onTransformChanged != null)
			{
				onTransformChanged.Invoke();
			}
		}

		public virtual BoxHealthProperty GetValue()
		{
			return ((Component)this).GetComponent<BoxHealthPropertyInstance>().Health;
		}

		private void OnChangeStart()
		{
			_isChanging = true;
			_prevHealth = GetValue();
		}

		private void OnChangeEnd()
		{
			_isChanging = false;
			if ((ValueProperty<float>)(object)GetValue() != (ValueProperty<float>)(object)_prevHealth)
			{
				((EditorEventHandler)this).Editor.TakeSnaphot();
			}
		}

		protected override void HandleEvent(IEditorEvent evt)
		{
		}
	}
	internal class MassHandler : EditorEventHandler, ITransformModifyingEditorEventHandler
	{
		private bool _isChanging;

		private MassProperty _prevMass;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private TransformChangedEventHandler m_OnTransformChanged;

		public GameObject Content { get; private set; }

		public event TransformChangedEventHandler OnTransformChanged
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
		}

		protected override void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EditorEventHandler)this).Awake();
			Content = new GameObject("Mass Interaction Content");
			Content.transform.SetParent(((Component)this).transform);
			Content.transform.localScale = Vector3.one;
			Content.layer = 31;
			Content.AddComponent<GraphicRaycaster>();
			Canvas component = Content.GetComponent<Canvas>();
			component.renderMode = (RenderMode)2;
			component.worldCamera = MainCam.instance.cam;
		}

		protected virtual void Update()
		{
		}

		public virtual void SetValue(MassProperty mass)
		{
			((Component)this).GetComponent<MassPropertyInstance>().Mass = mass;
			Rigidbody2D val = ((Component)this).GetComponent<Rigidbody2D>() ?? throw new ArgumentException("GameObject does not have a rigidbody script", "gameObject");
			val.mass = ((ValueProperty<float>)(object)mass).Value * 1000f;
			TransformChangedEventHandler onTransformChanged = this.OnTransformChanged;
			if (onTransformChanged != null)
			{
				onTransformChanged.Invoke();
			}
		}

		public virtual MassProperty GetValue()
		{
			return MassProperty.op_Implicit(MassProperty.op_Implicit(((Component)this).GetComponent<MassPropertyInstance>().Mass) / 1000f);
		}

		private void OnChangeStart()
		{
			_isChanging = true;
			_prevMass = GetValue();
		}

		private void OnChangeEnd()
		{
			_isChanging = false;
			if ((ValueProperty<float>)(object)GetValue() != (ValueProperty<float>)(object)_prevMass)
			{
				((EditorEventHandler)this).Editor.TakeSnaphot();
			}
		}

		protected override void HandleEvent(IEditorEvent evt)
		{
		}
	}
	internal class MoveSequenceHandler : EditorEventHandler, ITransformModifyingEditorEventHandler
	{
		private bool _isChanging;

		private MoveSequenceProperty _prevSequence;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private TransformChangedEventHandler m_OnTransformChanged;

		public GameObject Content { get; private set; }

		public event TransformChangedEventHandler OnTransformChanged
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
		}

		protected override void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EditorEventHandler)this).Awake();
			Content = new GameObject("Move Sequence Interaction Content");
			Content.transform.SetParent(((Component)this).transform);
			Content.transform.localScale = Vector3.one;
			Content.layer = 31;
			Content.AddComponent<GraphicRaycaster>();
			Canvas component = Content.GetComponent<Canvas>();
			component.renderMode = (RenderMode)2;
			component.worldCamera = MainCam.instance.cam;
		}

		protected virtual void Update()
		{
		}

		public virtual void SetValue(MoveSequenceProperty sequence)
		{
			MoveSequenceProperty component = ((Component)this).GetComponent<MoveSequenceProperty>();
			component.Positions = sequence.Positions;
			component.Spring = sequence.Spring;
			component.TimeAtPos = sequence.TimeAtPos;
			MoveSequence val = ((Component)this).GetComponent<MoveSequence>() ?? throw new ArgumentException("GameObject does not have a move sequence script", "gameObject");
			val.positions = sequence.Positions;
			val.spring = sequence.Spring;
			val.timeAtPos = sequence.TimeAtPos;
			TransformChangedEventHandler onTransformChanged = this.OnTransformChanged;
			if (onTransformChanged != null)
			{
				onTransformChanged.Invoke();
			}
		}

		public virtual MoveSequenceProperty GetValue()
		{
			return ((Component)this).GetComponent<MoveSequencePropertyInstance>().Value;
		}

		private void OnChangeStart()
		{
			_isChanging = true;
			_prevSequence = GetValue();
		}

		private void OnChangeEnd()
		{
			_isChanging = false;
			if (GetValue() != _prevSequence)
			{
				((EditorEventHandler)this).Editor.TakeSnaphot();
			}
		}

		protected override void HandleEvent(IEditorEvent evt)
		{
		}
	}
	internal class SmasherDelayHandler : EditorEventHandler, ITransformModifyingEditorEventHandler
	{
		private bool _isChanging;

		private DelayProperty _prevDelay;

		[CompilerGenerated]
		[DebuggerBrowsable(DebuggerBrowsableState.Never)]
		private TransformChangedEventHandler m_OnTransformChanged;

		public GameObject Content { get; private set; }

		public event TransformChangedEventHandler OnTransformChanged
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Combine((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				TransformChangedEventHandler val = this.m_OnTransformChanged;
				TransformChangedEventHandler val2;
				do
				{
					val2 = val;
					TransformChangedEventHandler value2 = (TransformChangedEventHandler)Delegate.Remove((Delegate?)(object)val2, (Delegate?)(object)value);
					val = Interlocked.CompareExchange(ref this.m_OnTransformChanged, value2, val2);
				}
				while (val != val2);
			}
		}

		protected override void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EditorEventHandler)this).Awake();
			Content = new GameObject("Delay Interaction Content");
			Content.transform.SetParent(((Component)this).transform);
			Content.transform.localScale = Vector3.one;
			Content.layer = 31;
			Content.AddComponent<GraphicRaycaster>();
			Canvas component = Content.GetComponent<Canvas>();
			component.renderMode = (RenderMode)2;
			component.worldCamera = MainCam.instance.cam;
		}

		protected virtual void Update()
		{
		}

		public virtual void SetValue(DelayProperty delay)
		{
			((Component)this).GetComponent<DelayPropertyInstance>().Delay = delay;
			DelayEvent val = ((Component)this).GetComponentInChildren<DelayEvent>() ?? throw new ArgumentException("GameObject does not have a delay script", "gameObject");
			val.time = ((ValueProperty<float>)(object)delay).Value;
			TransformChangedEventHandler onTransformChanged = this.OnTransformChanged;
			if (onTransformChanged != null)
			{
				onTransformChanged.Invoke();
			}
		}

		public virtual DelayProperty GetValue()
		{
			return ((Component)this).GetComponent<DelayPropertyInstance>().Delay;
		}

		private void OnChangeStart()
		{
			_isChanging = true;
			_prevDelay = GetValue();
		}

		private void OnChangeEnd()
		{
			_isChanging = false;
			if ((ValueProperty<float>)(object)GetValue() != (ValueProperty<float>)(object)_prevDelay)
			{
				((EditorEventHandler)this).Editor.TakeSnaphot();
			}
		}

		protected override void HandleEvent(IEditorEvent evt)
		{
		}
	}
}