UEP.dll

Decompiled a day 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.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using HutongGames.PlayMaker;
using Microsoft.CodeAnalysis;
using UEP;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.U2D;
using UnityEngine.UI;
using UnityEngine.UIElements;
using UnityExplorer;
using UnityExplorer.CacheObject;
using UnityExplorer.CacheObject.Views;
using UnityExplorer.Config;
using UnityExplorer.Inspectors;
using UnityExplorer.Inspectors.MouseInspectors;
using UnityExplorer.UI;
using UnityExplorer.UI.Panels;
using UnityExplorer.UI.Widgets;
using UnityExplorerPlus;
using UnityExplorerPlus.Inspectors.Reflect;
using UnityExplorerPlus.LineDrawing;
using UnityExplorerPlus.Widgets.Sprites;
using UnityExplorerPlus.Widgets.tk2d;
using UniverseLib;
using UniverseLib.UI;
using UniverseLib.UI.Models;
using UniverseLib.UI.ObjectPool;
using UniverseLib.UI.Panels;
using UniverseLib.UI.Widgets;
using UniverseLib.UI.Widgets.ButtonList;
using UniverseLib.UI.Widgets.ScrollView;
using UniverseLib.Utility;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Accessibility")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("CinematicUnityExplorer.BIE5.Mono")]
[assembly: IgnoresAccessChecksTo("Coffee.SoftMaskForUGUI")]
[assembly: IgnoresAccessChecksTo("com.rlabrecque.steamworks.net")]
[assembly: IgnoresAccessChecksTo("ConditionalExpression")]
[assembly: IgnoresAccessChecksTo("GalaxyCSharp")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Addressables")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters")]
[assembly: IgnoresAccessChecksTo("Newtonsoft.Json.UnityConverters.Mathematics")]
[assembly: IgnoresAccessChecksTo("PlayMaker")]
[assembly: IgnoresAccessChecksTo("SharpDX.DirectInput")]
[assembly: IgnoresAccessChecksTo("SharpDX")]
[assembly: IgnoresAccessChecksTo("TeamCherry.BuildBot")]
[assembly: IgnoresAccessChecksTo("TeamCherry.Cinematics")]
[assembly: IgnoresAccessChecksTo("TeamCherry.Localization")]
[assembly: IgnoresAccessChecksTo("TeamCherry.NestedFadeGroup")]
[assembly: IgnoresAccessChecksTo("TeamCherry.SharedUtils")]
[assembly: IgnoresAccessChecksTo("TeamCherry.Splines")]
[assembly: IgnoresAccessChecksTo("TeamCherry.TK2D")]
[assembly: IgnoresAccessChecksTo("Unity.Addressables")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Recorder.Base")]
[assembly: IgnoresAccessChecksTo("Unity.Recorder")]
[assembly: IgnoresAccessChecksTo("Unity.ResourceManager")]
[assembly: IgnoresAccessChecksTo("Unity.ScriptableBuildPipeline")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("UnityEngine.AMDModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UniverseLib.Mono")]
[assembly: IgnoresAccessChecksTo("XblPCSandbox")]
[assembly: IgnoresAccessChecksTo("XGamingRuntime")]
[assembly: IgnoresAccessChecksTo("zlib.net")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UEP")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.5.2.0")]
[assembly: AssemblyInformationalVersion("0.5.2+9fdb761389e4f723d2530e53a549347391a6fb97")]
[assembly: AssemblyProduct("UEP")]
[assembly: AssemblyTitle("UEP")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.5.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal static class FsmUtils
{
	public static void Init()
	{
		PatchParse.RegisterToString<FsmState>(ParseFsmState);
		PatchParse.RegisterToString<PlayMakerFSM>(ParsePlayMakerFSM);
		PatchParse.RegisterToString<FsmEvent>(ParseFsmEvent);
		PatchParse.RegisterToString<NamedVariable>(ParseNamedVariable);
		PatchParse.RegisterToString<FsmTransition>(ParseFsmTransition);
		PatchParse.Register(typeof(FsmEvent), (PatchParse.TParseMethod)FsmEvent.GetFsmEvent, (PatchParse.TToStringMethod)SimpleParseFsmEvent);
		PatchParse.RegisterComponent<PlayMakerFSM>((PatchParse.TComponentToStringMethod)ParsePlayMakerFSM);
		PatchParse.RegisterComponent<EventRegister>((PatchParse.TComponentToStringMethod)ParseEventRegister);
	}

	private static string ParseEventRegister(object obj, string originalString)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		EventRegister val = (EventRegister)obj;
		if (string.IsNullOrEmpty(((EventBase)val).InspectorInfo))
		{
			return originalString;
		}
		return originalString + "<color=grey>(</color><color=#7FFF00>" + val.subscribedEvent + " events</color><color=grey>)</color>";
	}

	private static string ParsePlayMakerFSM(object obj, string originalString)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		PlayMakerFSM val = (PlayMakerFSM)obj;
		if (string.IsNullOrEmpty(val.FsmName))
		{
			return originalString;
		}
		return originalString + "<color=grey>(</color><color=#7FFF00>" + val.FsmName + "</color><color=grey>)</color>";
	}

	internal static string ParseFsmState(object state)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return "<color=grey>Fsm State: </color><color=green>" + ((FsmState)state).name + "</color>";
	}

	internal static string ParseFsmEvent(object ev)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return "<color=grey>Fsm Event: </color><color=green>" + ((FsmEvent)ev).Name + "</color>";
	}

	internal static string ParseNamedVariable(object v)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		NamedVariable val = (NamedVariable)v;
		return $"<color=grey>Fsm Variable(</color><color=green>{val.VariableType}</color><color=grey>): </color><color=green>{val.Name}</color> | " + ToStringUtility.ToStringWithType(val.RawValue, typeof(object), true);
	}

	internal static string ParsePlayMakerFSM(object fsm)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		return "<color=grey>PlayMakerFSM: </color><color=green>" + ((Object)(PlayMakerFSM)fsm).name + "</color><color=grey>(</color><color=#2df7b2>" + ((PlayMakerFSM)fsm).FsmName + "</color><color=grey>)</color>";
	}

	internal static string ParseFsmTransition(object t)
	{
		FsmTransition val = (FsmTransition)((t is FsmTransition) ? t : null);
		if (val != null)
		{
			string[] obj = new string[5] { "<color=grey>Fsm Transition: </color><color=green>", null, null, null, null };
			FsmEvent fsmEvent = val.FsmEvent;
			obj[1] = ((fsmEvent != null) ? fsmEvent.Name : null) ?? val.EventName;
			obj[2] = "</color><color=grey> -> </color><color=green>";
			FsmState toFsmState = val.ToFsmState;
			obj[3] = ((toFsmState != null) ? toFsmState.Name : null) ?? val.ToState;
			obj[4] = "</color>";
			return string.Concat(obj);
		}
		return null;
	}

	internal static string SimpleParseFsmEvent(object ev)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		return ((FsmEvent)ev).Name;
	}
}
public static class HelperFun
{
	public static void LogInfo(this object msg)
	{
		UEPPlugin.logger.LogInfo(msg);
	}

	public static void LogWarning(this object msg)
	{
		UEPPlugin.logger.LogWarning(msg);
	}

	public static void LogError(this object msg)
	{
		UEPPlugin.logger.LogError(msg);
	}
}
public class ButtonLabel : IPooledObject
{
	public GameObject UIRoot { get; set; }

	public RectTransform Rect { get; set; }

	public float DefaultHeight => 25f;

	public Text Label { get; set; }

	public ButtonRef Button { get; set; }

	public GameObject CreateContent(GameObject parent)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		UIRoot = UIFactory.CreateHorizontalGroup(parent, "ButtonLabel", false, false, true, true, 0, default(Vector4), default(Color), (TextAnchor?)null);
		Transform transform = UIRoot.transform;
		Rect = (RectTransform)(object)((transform is RectTransform) ? transform : null);
		GameObject uIRoot = UIRoot;
		int? num = 9999;
		int? num2 = 40;
		UIFactory.SetLayoutElement(uIRoot, (int?)null, num2, num, (int?)null, (int?)null, (int?)null, (bool?)null);
		Label = UIFactory.CreateLabel(UIRoot, "Label", "NotSet", (TextAnchor)3, default(Color), true, 14);
		GameObject gameObject = ((Component)Label).gameObject;
		num2 = 9999;
		num = 9999;
		UIFactory.SetLayoutElement(gameObject, (int?)null, (int?)null, num2, num, (int?)null, (int?)null, (bool?)null);
		Button = UIFactory.CreateButton(UIRoot, "Button", "NotSet", (Color?)null);
		GameObject gameObject2 = Button.GameObject;
		int? num3 = 80;
		num = 0;
		UIFactory.SetLayoutElement(gameObject2, num3, (int?)25, num, (int?)9999, (int?)null, (int?)null, (bool?)null);
		return UIRoot;
	}

	public static ButtonLabel OnBorredFromPool(GameObject parent, string text, Action button_action = null, string button_text = null)
	{
		ButtonLabel buttonLabel = Pool<ButtonLabel>.Borrow();
		((Transform)buttonLabel.Rect).SetParent(parent.transform, false);
		if (button_action == null)
		{
			buttonLabel.Button.GameObject.SetActive(false);
		}
		else
		{
			buttonLabel.Button.GameObject.SetActive(true);
			ButtonRef button = buttonLabel.Button;
			button.OnClick = (Action)Delegate.Combine(button.OnClick, button_action);
			buttonLabel.Button.ButtonText.text = button_text;
		}
		buttonLabel.Label.text = text;
		return buttonLabel;
	}

	public void OnReturnToPool()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		Button.OnClick = null;
		((Graphic)Label).color = Color.white;
		Pool<ButtonLabel>.Return(this);
	}
}
public class CheckScroll : MonoBehaviour, IScrollHandler, IEventSystemHandler
{
	public Action<Vector2> returnScrollData = null;

	public void OnScroll(PointerEventData eventData)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		if (returnScrollData != null)
		{
			returnScrollData(eventData.scrollDelta);
		}
	}
}
public class EventsPage : ICellPoolDataSource<FsmEventCell>
{
	public List<FsmEvent> fsmEvents;

	public ScrollPool<FsmEventCell> events;

	public FsmInspector Ownner { get; set; }

	public PlayMakerFSM Target { get; set; }

	public int ItemCount => (!((Object)(object)Target == (Object)null)) ? Target.FsmEvents.Length : 0;

	public GameObject UIRoot { get; set; }

	public EventsPage(FsmInspector owner)
	{
		Ownner = owner;
		Target = owner?.Target;
		fsmEvents = new List<FsmEvent>();
		base..ctor();
	}

	public void OnCellBorrowed(FsmEventCell cell)
	{
	}

	public void ClearAll()
	{
		SetTarget(null);
	}

	public static EventsPage Create(GameObject parent, FsmInspector owner)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		EventsPage eventsPage = new EventsPage(owner);
		eventsPage.UIRoot = UIFactory.CreateVerticalGroup(parent, "EventsPage", false, false, true, true, 0, default(Vector4), default(Color), (TextAnchor?)null);
		GameObject uIRoot = eventsPage.UIRoot;
		int? num = 9999;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(uIRoot, (int?)null, (int?)null, num2, num, (int?)null, (int?)null, (bool?)null);
		GameObject val = default(GameObject);
		GameObject val2 = default(GameObject);
		eventsPage.events = UIFactory.CreateScrollPool<FsmEventCell>(eventsPage.UIRoot, "Events", ref val, ref val2, (Color?)null);
		GameObject obj = val;
		num2 = 9999;
		num = 9999;
		UIFactory.SetLayoutElement(obj, (int?)null, (int?)null, num, num2, (int?)null, (int?)null, (bool?)null);
		eventsPage.events.Initialize((ICellPoolDataSource<FsmEventCell>)eventsPage, (Action)null);
		return eventsPage;
	}

	public void SetTarget(PlayMakerFSM fsm)
	{
		Target = fsm;
		events.Refresh(true, true);
	}

	public void SetCell(FsmEventCell cell, int index)
	{
		if (!((Object)(object)Target == (Object)null))
		{
			if (index < 0 || index >= ItemCount)
			{
				cell.Disable();
				return;
			}
			cell.Enable();
			cell.SetTarget(Target.FsmEvents[index]);
		}
	}

	public void Update()
	{
	}
}
public class FsmEventCell : ICell, IPooledObject
{
	public Toggle isGlobal;

	public Toggle isSystem;

	public FsmEvent Target { get; set; }

	public bool Enabled => UIRoot.activeSelf;

	public RectTransform Rect { get; set; }

	public GameObject UIRoot { get; set; }

	public float DefaultHeight => 25f;

	public Text EventName { get; set; }

	public GameObject CreateContent(GameObject parent)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		UIRoot = UIFactory.CreateHorizontalGroup(parent, "EventCell", false, false, true, true, 0, default(Vector4), default(Color), (TextAnchor?)null);
		GameObject uIRoot = UIRoot;
		int? num = 9999;
		int? num2 = 25;
		int? num3 = 0;
		UIFactory.SetLayoutElement(uIRoot, (int?)null, num2, num, num3, (int?)null, (int?)null, (bool?)null);
		Rect = UIRoot.GetComponent<RectTransform>();
		EventName = UIFactory.CreateLabel(UIRoot, "EventName", "NotSet", (TextAnchor)3, Color.green, true, 14);
		GameObject gameObject = ((Component)EventName).gameObject;
		num3 = 9999;
		num2 = 9999;
		UIFactory.SetLayoutElement(gameObject, (int?)null, (int?)null, num2, num3, (int?)null, (int?)null, (bool?)null);
		Text val = default(Text);
		GameObject val2 = UIFactory.CreateToggle(UIRoot, "GlobalToggle", ref isGlobal, ref val, default(Color), 20, 20);
		val.text = "GLOBAL";
		((Selectable)isGlobal).interactable = false;
		int? num4 = 80;
		num2 = 0;
		UIFactory.SetLayoutElement(val2, num4, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		Text val3 = default(Text);
		GameObject val4 = UIFactory.CreateToggle(UIRoot, "GlobalToggle", ref isSystem, ref val3, default(Color), 20, 20);
		val3.text = "SYSTEM";
		((Selectable)isSystem).interactable = false;
		int? num5 = 80;
		num2 = 0;
		UIFactory.SetLayoutElement(val4, num5, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		return UIRoot;
	}

	public void SetTarget(FsmEvent fsmEvent)
	{
		Target = fsmEvent;
		EventName.text = fsmEvent.Name;
		isGlobal.isOn = fsmEvent.IsGlobal;
		isSystem.isOn = fsmEvent.isSystemEvent;
	}

	public void Disable()
	{
		UIRoot.SetActive(false);
	}

	public void Enable()
	{
		UIRoot.SetActive(true);
	}
}
public static class FsmLayoutUtility
{
	public const float MinSpacing = 50f;

	public const int MaxRelaxIterations = 50;

	public static readonly List<Color> STATE_COLORS = new List<Color>(13)
	{
		new Color(0.1f, 0.1f, 0.1f),
		new Color(0.2745f, 0.3137f, 0.4706f),
		new Color(0.4314f, 0.3529f, 0.2549f),
		new Color(0.3922f, 0.2353f, 0.3137f),
		new Color(0.2157f, 0.3922f, 0.3529f),
		new Color(0.2549f, 0.3137f, 0.5098f),
		new Color(0.4706f, 0.3137f, 0.2353f),
		new Color(0.3922f, 0.2353f, 0.3922f),
		new Color(0.3137f, 0.3529f, 0.2353f),
		new Color(0.3333f, 0.4118f, 0.5098f),
		new Color(0.4706f, 0.2745f, 0.2353f),
		new Color(0.2353f, 0.3922f, 0.4314f),
		new Color(0.4314f, 0.2353f, 0.3922f)
	};

	public static readonly List<Color> TRANSITION_COLORS = new List<Color>();

	public static Color GetColor(int color_index)
	{
		//IL_0040: 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_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_0048: Unknown result type (might be due to invalid IL or missing references)
		if (color_index >= STATE_COLORS.Count)
		{
			("Need Add More Color, At Least " + color_index).LogWarning();
			return STATE_COLORS.Last();
		}
		return STATE_COLORS[color_index];
	}

	public static void TestAddNewState(PlayMakerFSM fsm, string name, int num = 1)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Expected O, but got Unknown
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		List<FsmState> list = fsm.FsmStates.ToList();
		FsmState val = null;
		for (int i = 0; i < num; i++)
		{
			string text = name;
			for (int j = 0; j < i; j++)
			{
				text += j;
			}
			FsmState val2 = new FsmState(fsm.Fsm);
			val2.Name = text;
			if (val != null)
			{
				List<FsmTransition> list2 = val.Transitions.ToList();
				for (int k = 0; k < i; k++)
				{
					FsmTransition val3 = new FsmTransition();
					val3.FsmEvent = FsmEvent.Finished;
					if (k == 0)
					{
						val3.toState = text;
						val3.ToFsmState = val2;
					}
					list2.Add(val3);
				}
				val.Transitions = list2.ToArray();
			}
			list.Add(val2);
			val = val2;
		}
		fsm.Fsm.States = list.ToArray();
	}

	public static void AutoPlaceNode(RectTransform newrect, string name, List<RectTransform> rects, Random rng)
	{
		//IL_0009: 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_0075: 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)
		List<Vector2> list = new List<Vector2>(1) { newrect.anchoredPosition };
		bool flag = false;
		bool random = false;
		int num = 0;
		while (true)
		{
			if (!ApplyRelaxation(newrect, rects, random, rng))
			{
				return;
			}
			num++;
			random = false;
			Vector2 anchoredPosition = newrect.anchoredPosition;
			if (num > 50)
			{
				if (flag)
				{
					break;
				}
				random = true;
				flag = true;
			}
			if (list.Contains(anchoredPosition))
			{
				num = 0;
				random = true;
				list.Clear();
			}
			list.Add(anchoredPosition);
		}
		("ERROR:Too many Relaxation for " + name).LogWarning();
	}

	private static bool ApplyRelaxation(RectTransform target, List<RectTransform> rects, bool random = false, Random rng = null)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: 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_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: 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_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: 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_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = target.anchoredPosition;
		bool result = false;
		foreach (RectTransform rect in rects)
		{
			if (!((Object)(object)rect == (Object)(object)target) && IsOverlapping(target, rect))
			{
				result = true;
				Vector2 val2 = val - rect.anchoredPosition;
				Vector2 normalized = ((Vector2)(ref val2)).normalized;
				bool flag = false;
				if (normalized == Vector2.zero)
				{
					val2 = new Vector2(0f, -1f);
					normalized = ((Vector2)(ref val2)).normalized;
					flag = true;
				}
				if (random)
				{
					val2 = new Vector2((float)(rng.NextDouble() * 2.0 - 1.0), (float)(rng.NextDouble() * 2.0 - 1.0));
					normalized = ((Vector2)(ref val2)).normalized;
				}
				float overlapDistance = GetOverlapDistance(target, rect);
				float num = (flag ? 50f : overlapDistance) + 50f;
				val += normalized * num;
			}
		}
		target.anchoredPosition = val;
		return result;
	}

	private static bool IsOverlapping(RectTransform a, RectTransform b)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		Rect val = RectAABB(a);
		return ((Rect)(ref val)).Overlaps(RectAABB(b));
	}

	private static Rect RectAABB(RectTransform rt)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: 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_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		Rect rect = rt.rect;
		((Rect)(ref rect)).center = ((Rect)(ref rect)).center + rt.anchoredPosition;
		return rect;
	}

	private static float GetOverlapDistance(RectTransform a, RectTransform b)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		Rect val = RectAABB(a);
		Rect val2 = RectAABB(b);
		float num = Mathf.Min(((Rect)(ref val)).xMax, ((Rect)(ref val2)).xMax) - Mathf.Max(((Rect)(ref val)).xMin, ((Rect)(ref val2)).xMin);
		float num2 = Mathf.Min(((Rect)(ref val)).yMax, ((Rect)(ref val2)).yMax) - Mathf.Max(((Rect)(ref val)).yMin, ((Rect)(ref val2)).yMin);
		return Mathf.Min(num, num2);
	}
}
[HarmonyPatch]
public static class FsmWatcher
{
	private class FsmInfo
	{
		internal bool is_event = false;

		internal bool global_event = false;

		internal string set_state_name = "";

		internal OperationBlock writer;

		internal string event_name = "";

		internal string event_state_name = "";

		internal string last_state_name = "";

		internal FsmInfo(OperationBlock block)
		{
			writer = block;
		}
	}

	private static readonly Dictionary<PlayMakerFSM, FsmInfo> fsms = new Dictionary<PlayMakerFSM, FsmInfo>();

	public static void Register(PlayMakerFSM fsm, OperationBlock block)
	{
		if (block != null && !fsms.ContainsKey(fsm))
		{
			fsms.Add(fsm, new FsmInfo(block));
		}
	}

	public static void Unregister(PlayMakerFSM fsm)
	{
		fsms.Remove(fsm);
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(Fsm), "DoTransition", new Type[]
	{
		typeof(FsmTransition),
		typeof(bool)
	})]
	public static bool PrefixDoTransition(Fsm __instance, FsmTransition transition, bool isGlobal)
	{
		try
		{
			if (transition.toFsmState == null)
			{
				return true;
			}
			if (fsms.TryGetValue(__instance.FsmComponent, out var value))
			{
				value.is_event = true;
				value.event_name = transition.EventName;
				value.global_event = isGlobal;
				value.event_state_name = transition.toState;
				value.last_state_name = __instance.activeStateName;
			}
		}
		catch (Exception)
		{
		}
		return true;
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(Fsm), "SetState", new Type[] { typeof(string) })]
	public static bool PrefixSetState(Fsm __instance, string stateName)
	{
		try
		{
			if (fsms.TryGetValue(__instance.FsmComponent, out var value))
			{
				value.is_event = false;
				value.set_state_name = stateName;
				value.last_state_name = __instance.activeStateName;
			}
		}
		catch
		{
		}
		return true;
	}

	[HarmonyPrefix]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public static bool PrefixEnterState(Fsm __instance, FsmState state)
	{
		try
		{
			if (state == null)
			{
				return true;
			}
			if (fsms.TryGetValue(__instance.FsmComponent, out var value) && state.loopCount < __instance.MaxLoopCount)
			{
				if (value.is_event && value.event_state_name == state.Name)
				{
					value.writer.AddEventRecord(value.global_event, value.last_state_name, value.event_name, value.event_state_name);
				}
				else if (!value.is_event && value.set_state_name == state.Name)
				{
					value.writer.AddSetStateRecord(value.set_state_name);
				}
				else
				{
					value.writer.AddErrorRecord("UnRecorded EnterState: " + state.Name);
				}
			}
		}
		catch
		{
		}
		return true;
	}
}
public class GraphicLine : MaskableGraphic
{
	public enum CurveType
	{
		Line,
		QuadraticBezier,
		CubicBezier
	}

	[Header("Curve Type")]
	public CurveType curveType = CurveType.Line;

	[Header("Control Points (local Vector2)")]
	private Vector2 p0;

	private Vector2 p1;

	private Vector2 p2;

	private Vector2 p3;

	[Header("Curve Settings")]
	public int segments = 50;

	public float lineWidth = 2f;

	[Header("Arrow Settings")]
	public bool showArrow = true;

	public float arrowLength = 10f;

	public float arrowWidth = 7.5f;

	private bool resize_scheduled = false;

	private bool should_autoresize = false;

	private List<Vector2> last_points = new List<Vector2>();

	private float margin = 10f;

	public Vector2 P0
	{
		get
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return p0;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			if (p0 != value)
			{
				should_autoresize = true;
				p0 = value;
			}
		}
	}

	public Vector2 P1
	{
		get
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return p1;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			if (p1 != value)
			{
				should_autoresize = true;
				p1 = value;
			}
		}
	}

	public Vector2 P2
	{
		get
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return p2;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			if (p2 != value)
			{
				should_autoresize = true;
				p2 = value;
			}
		}
	}

	public Vector2 P3
	{
		get
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return p3;
		}
		set
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			if (p3 != value)
			{
				should_autoresize = true;
				p3 = value;
			}
		}
	}

	public override void OnPopulateMesh(VertexHelper vh)
	{
		//IL_002d: 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_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		vh.Clear();
		List<Vector2> list = new List<Vector2>();
		switch (curveType)
		{
		case CurveType.Line:
			list.Add(P0);
			list.Add(P1);
			break;
		case CurveType.QuadraticBezier:
			GenerateQuadraticBezier(list);
			break;
		case CurveType.CubicBezier:
			GenerateCubicBezier(list);
			break;
		}
		if (!resize_scheduled && should_autoresize)
		{
			CanvasUpdateRegistry.RegisterCanvasElementForLayoutRebuild((ICanvasElement)(object)this);
			last_points = new List<Vector2>(list);
			resize_scheduled = true;
		}
		for (int i = 0; i < list.Count - 1; i++)
		{
			DrawLine(vh, list[i], list[i + 1], lineWidth);
		}
		if (showArrow && list.Count >= 2)
		{
			DrawArrow(vh, list[list.Count - 2], list[list.Count - 1]);
		}
	}

	private void GenerateQuadraticBezier(List<Vector2> result)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//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_005f: 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)
		for (int i = 0; i <= segments; i++)
		{
			float num = (float)i / (float)segments;
			Vector2 item = Mathf.Pow(1f - num, 2f) * P0 + 2f * (1f - num) * num * P1 + num * num * P2;
			result.Add(item);
		}
	}

	private void GenerateCubicBezier(List<Vector2> result)
	{
		//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_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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: 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_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i <= segments; i++)
		{
			float num = (float)i / (float)segments;
			Vector2 item = Mathf.Pow(1f - num, 3f) * P0 + 3f * Mathf.Pow(1f - num, 2f) * num * P1 + 3f * (1f - num) * num * num * P2 + num * num * num * P3;
			result.Add(item);
		}
	}

	private void DrawLine(VertexHelper vh, Vector2 start, Vector2 end, float width)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: 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_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: 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_0030: 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_0036: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0045: 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_0047: 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_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		Vector2 val = end - start;
		Vector2 normalized = ((Vector2)(ref val)).normalized;
		Vector2 val2 = new Vector2(0f - normalized.y, normalized.x) * width * 0.5f;
		Vector2 val3 = start + val2;
		Vector2 val4 = start - val2;
		Vector2 val5 = end + val2;
		Vector2 val6 = end - val2;
		int currentVertCount = vh.currentVertCount;
		vh.AddVert(Vector2.op_Implicit(val3), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddVert(Vector2.op_Implicit(val4), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddVert(Vector2.op_Implicit(val5), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddVert(Vector2.op_Implicit(val6), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
		vh.AddTriangle(currentVertCount + 2, currentVertCount + 1, currentVertCount + 3);
	}

	private void AutoResizeRectTransform(List<Vector2> points)
	{
		//IL_0040: 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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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_0088: 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)
		if (points == null || points.Count == 0)
		{
			return;
		}
		float num = float.MaxValue;
		float num2 = float.MinValue;
		float num3 = float.MaxValue;
		float num4 = float.MinValue;
		foreach (Vector2 point in points)
		{
			if (point.x < num)
			{
				num = point.x;
			}
			if (point.x > num2)
			{
				num2 = point.x;
			}
			if (point.y < num3)
			{
				num3 = point.y;
			}
			if (point.y > num4)
			{
				num4 = point.y;
			}
		}
		num -= margin;
		num3 -= margin;
		num2 += margin;
		num4 += margin;
		float num5 = num2 - num;
		float num6 = num4 - num3;
		RectTransform rectTransform = ((Graphic)this).rectTransform;
		rectTransform.sizeDelta = new Vector2(num5, num6);
		rectTransform.pivot = new Vector2((0f - num) / num5, (0f - num3) / num6);
		should_autoresize = false;
	}

	private bool IsPointNearLine(Vector2 point, List<Vector2> line, float threshold)
	{
		//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_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < line.Count - 1; i++)
		{
			Vector2 a = line[i];
			Vector2 b = line[i + 1];
			float num = DistancePointToSegment(point, a, b);
			if (num <= threshold)
			{
				return true;
			}
		}
		return false;
	}

	private float DistancePointToSegment(Vector2 p, Vector2 a, Vector2 b)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: 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_0011: 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_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = p - a;
		Vector2 val2 = b - a;
		float num = Mathf.Clamp01(Vector2.Dot(val, val2) / ((Vector2)(ref val2)).sqrMagnitude);
		return Vector2.Distance(p, a + val2 * num);
	}

	public override bool Raycast(Vector2 sp, Camera eventCamera)
	{
		//IL_0007: 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)
		Vector2 point = default(Vector2);
		RectTransformUtility.ScreenPointToLocalPointInRectangle(((Graphic)this).rectTransform, sp, eventCamera, ref point);
		return IsPointNearLine(point, last_points, lineWidth * 1.2f);
	}

	private void DrawArrow(VertexHelper vh, Vector2 from, Vector2 to)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: 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_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0053: 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_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: 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_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: 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_009c: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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_00c5: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = to - from;
		Vector2 normalized = ((Vector2)(ref val)).normalized;
		Vector2 val2 = to - normalized * arrowLength;
		Vector2 val3 = default(Vector2);
		((Vector2)(ref val3))..ctor(0f - normalized.y, normalized.x);
		Vector2 val4 = val2 + val3 * (arrowWidth * 0.5f);
		Vector2 val5 = val2 - val3 * (arrowWidth * 0.5f);
		int currentVertCount = vh.currentVertCount;
		vh.AddVert(Vector2.op_Implicit(to), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddVert(Vector2.op_Implicit(val4), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddVert(Vector2.op_Implicit(val5), Color32.op_Implicit(((Graphic)this).color), Vector4.op_Implicit(Vector2.zero));
		vh.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
	}

	public override void Rebuild(CanvasUpdate update)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Invalid comparison between Unknown and I4
		((Graphic)this).Rebuild(update);
		if ((int)update == 2)
		{
			if (should_autoresize)
			{
				AutoResizeRectTransform(last_points);
			}
			resize_scheduled = false;
		}
	}

	public void Refresh()
	{
		((Graphic)this).SetVerticesDirty();
	}
}
public class SelectableLine : Selectable, IPointerClickHandler, IEventSystemHandler
{
	public Action OnLineClick;

	public Action OnLineSelect;

	public Action OnLineDeselect;

	public void OnPointerClick(PointerEventData eventData)
	{
		OnLineClick?.Invoke();
	}

	public override void OnPointerEnter(PointerEventData eventData)
	{
		((Selectable)this).OnPointerEnter(eventData);
	}

	public override void OnSelect(BaseEventData eventData)
	{
		((Selectable)this).OnSelect(eventData);
		OnLineSelect?.Invoke();
	}

	public override void OnDeselect(BaseEventData eventData)
	{
		((Selectable)this).OnDeselect(eventData);
		OnLineDeselect?.Invoke();
	}

	public void ClearAction()
	{
		OnLineClick = null;
		OnLineSelect = null;
		OnLineDeselect = null;
	}
}
public class LineRef : IPooledObject
{
	public static ColorBlock default_colors;

	public SelectableLine SLine { get; set; }

	public GraphicLine GLine { get; set; }

	public RectTransform Rect => ReflectionExtensions.TryCast<RectTransform>((object)((Component)SLine).transform);

	public Color CurrentNormalColor { get; set; } = ((ColorBlock)(ref default_colors)).normalColor;


	public bool Enabled => UIRoot.activeSelf;

	public GameObject UIRoot { get; set; }

	public float DefaultHeight => 10f;

	public void Select()
	{
		((Selectable)SLine).interactable = false;
	}

	public void UnSelect()
	{
		((Selectable)SLine).interactable = true;
	}

	public void Mark()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		RuntimeHelper.SetColorBlock((Selectable)(object)SLine, (Color?)Color.cyan, (Color?)null, (Color?)null, (Color?)null);
	}

	public void UnMark()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		RuntimeHelper.SetColorBlock((Selectable)(object)SLine, (Color?)CurrentNormalColor, (Color?)null, (Color?)null, (Color?)null);
	}

	internal static void SetDefaultSelectableValues(Selectable selectable)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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_001a: Unknown result type (might be due to invalid IL or missing references)
		Navigation navigation = selectable.navigation;
		((Navigation)(ref navigation)).mode = (Mode)4;
		selectable.navigation = navigation;
		RuntimeHelper.SetColorBlock(selectable, default_colors);
	}

	public void SetPath(List<Vector2> path, bool should_arrow = true, Color? normal_color = null)
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		int count = path.Count;
		if (count >= 2 && count <= 4)
		{
			switch (count)
			{
			case 2:
				GLine.curveType = GraphicLine.CurveType.Line;
				GLine.P0 = path[0];
				GLine.P1 = path[1];
				break;
			case 3:
				GLine.curveType = GraphicLine.CurveType.QuadraticBezier;
				GLine.P0 = path[0];
				GLine.P1 = path[1];
				GLine.P2 = path[2];
				break;
			case 4:
				GLine.curveType = GraphicLine.CurveType.CubicBezier;
				GLine.P0 = path[0];
				GLine.P1 = path[1];
				GLine.P2 = path[2];
				GLine.P3 = path[3];
				break;
			}
			if (normal_color.HasValue)
			{
				CurrentNormalColor = normal_color.Value;
				RuntimeHelper.SetColorBlock((Selectable)(object)SLine, (Color?)CurrentNormalColor, (Color?)null, (Color?)null, (Color?)null);
			}
			GLine.Refresh();
		}
	}

	public static LineRef OnBorrowedFromPool(GameObject parent)
	{
		LineRef lineRef = Pool<LineRef>.Borrow();
		((Transform)lineRef.Rect).SetParent((Transform)(object)parent.GetComponent<RectTransform>(), false);
		((Transform)lineRef.Rect).SetAsFirstSibling();
		return lineRef;
	}

	public void OnReturnToPool()
	{
		//IL_0009: 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_0026: 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)
		SetPath(new List<Vector2>(2)
		{
			Vector2.zero,
			Vector2.zero
		}, should_arrow: false, ((ColorBlock)(ref default_colors)).normalColor);
		RuntimeHelper.SetColorBlock((Selectable)(object)SLine, default_colors);
		SLine.ClearAction();
		UnSelect();
		UnMark();
		Pool<LineRef>.Return(this);
	}

	public GameObject CreateContent(GameObject parent)
	{
		//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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		UIRoot = UIFactory.CreateUIObject("Line", parent, default(Vector2));
		GLine = UIRoot.AddComponent<GraphicLine>();
		SLine = UIRoot.AddComponent<SelectableLine>();
		SetDefaultSelectableValues((Selectable)(object)SLine);
		SetPath(new List<Vector2>(2)
		{
			Vector2.zero,
			Vector2.zero
		});
		return UIRoot;
	}

	static LineRef()
	{
		//IL_0002: 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_0035: 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_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		ColorBlock val = default(ColorBlock);
		((ColorBlock)(ref val)).normalColor = new Color(0.2f, 0.2f, 0.2f);
		((ColorBlock)(ref val)).selectedColor = new Color(0.2f, 0.2f, 0.2f);
		((ColorBlock)(ref val)).pressedColor = Color.white;
		((ColorBlock)(ref val)).highlightedColor = Color.white;
		((ColorBlock)(ref val)).disabledColor = Color.white;
		((ColorBlock)(ref val)).colorMultiplier = 1f;
		default_colors = val;
	}
}
public class NICacheField : CacheField
{
	public object Target { get; set; }

	public object DeclaringInstance => ((CacheMember)this).IsStatic ? null : ReflectionExtensions.TryCast(Target, ((CacheMember)this).DeclaringType);

	public NICacheField(FieldInfo fi, object target)
		: base(fi)
	{
		((CacheObjectBase)this).NameLabelText = "<color=" + SignatureHighlighter.keywordBlueHex + ">" + fi.Name + "</color>";
		((CacheMember)this).NameForFiltering = SignatureHighlighter.RemoveHighlighting(((CacheObjectBase)this).NameLabelText);
		((CacheObjectBase)this).NameLabelTextRaw = ((CacheMember)this).NameForFiltering;
		Target = target;
	}

	public override object TryEvaluate()
	{
		try
		{
			object value = ((CacheField)this).FieldInfo.GetValue(DeclaringInstance);
			((CacheObjectBase)this).LastException = null;
			return value;
		}
		catch (Exception lastException)
		{
			((CacheObjectBase)this).LastException = lastException;
			return null;
		}
	}

	public override void TrySetValue(object value)
	{
		try
		{
			((CacheField)this).FieldInfo.SetValue(DeclaringInstance, value);
		}
		catch (Exception msg)
		{
			msg.LogInfo();
		}
	}
}
public class NICacheMethod : CacheMethod
{
	public object Target { get; set; }

	public object DeclaringInstance => ReflectionExtensions.TryCast(Target, ((CacheMember)this).DeclaringType);

	public NICacheMethod(MethodInfo mi, object target)
		: base(mi)
	{
		Target = target;
		((CacheMethod)this).SetInspectorOwner((ReflectionInspector)null, (MemberInfo)mi);
	}

	public override object TryEvaluate()
	{
		try
		{
			MethodInfo methodInfo = ((CacheMethod)this).MethodInfo;
			if (methodInfo.IsGenericMethod)
			{
				methodInfo = ((CacheMethod)this).MethodInfo.MakeGenericMethod(((CacheMember)this).Evaluator.TryParseGenericArguments());
			}
			object result = ((!((CacheObjectBase)this).HasArguments) ? methodInfo.Invoke(DeclaringInstance, ArgumentUtility.EmptyArgs) : methodInfo.Invoke(DeclaringInstance, ((CacheMember)this).Evaluator.TryParseArguments()));
			((CacheObjectBase)this).LastException = null;
			return result;
		}
		catch (Exception lastException)
		{
			((CacheObjectBase)this).LastException = lastException;
			return null;
		}
	}
}
public class NICacheProperty : CacheProperty
{
	public object Target { get; set; }

	public object DeclaringInstance => ((CacheMember)this).IsStatic ? null : ReflectionExtensions.TryCast(Target, ((CacheMember)this).DeclaringType);

	public NICacheProperty(PropertyInfo pi, object target)
		: base(pi)
	{
		((CacheObjectBase)this).NameLabelText = "<color=" + SignatureHighlighter.keywordBlueHex + ">" + pi.Name + "</color>";
		((CacheMember)this).NameForFiltering = SignatureHighlighter.RemoveHighlighting(((CacheObjectBase)this).NameLabelText);
		((CacheObjectBase)this).NameLabelTextRaw = ((CacheMember)this).NameForFiltering;
		Target = target;
	}

	public override object TryEvaluate()
	{
		try
		{
			object result = ((!((CacheObjectBase)this).HasArguments) ? ((CacheProperty)this).PropertyInfo.GetValue(DeclaringInstance, null) : ((CacheProperty)this).PropertyInfo.GetValue(DeclaringInstance, ((CacheMember)this).Evaluator.TryParseArguments()));
			((CacheObjectBase)this).LastException = null;
			return result;
		}
		catch (Exception lastException)
		{
			((CacheObjectBase)this).LastException = lastException;
			return null;
		}
	}

	public override void TrySetValue(object value)
	{
		if (!((CacheObjectBase)this).CanWrite)
		{
			return;
		}
		try
		{
			bool isStatic = ((CacheProperty)this).PropertyInfo.GetAccessors(nonPublic: true)[0].IsStatic;
			if (((CacheObjectBase)this).HasArguments)
			{
				((CacheProperty)this).PropertyInfo.SetValue(DeclaringInstance, value, ((CacheMember)this).Evaluator.TryParseArguments());
			}
			else
			{
				((CacheProperty)this).PropertyInfo.SetValue(DeclaringInstance, value, null);
			}
		}
		catch (Exception msg)
		{
			msg.LogInfo();
		}
	}
}
public class OperationsPage
{
	public GameObject UIRoot { get; set; }

	public FsmInspector Owner { get; set; }

	public GameObject ScrollView { get; set; }

	public GameObject ContentGroup { get; set; }

	public OperationBlock SelectedTransition { get; set; }

	public OperationBlock SelectedState { get; set; }

	public OperationBlock Method { get; set; }

	public OperationBlock Record { get; set; }

	public static OperationsPage Create(GameObject parent, FsmInspector Owner)
	{
		//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_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_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		OperationsPage operationsPage = new OperationsPage();
		operationsPage.Owner = Owner;
		Color clear = Color.clear;
		TextAnchor? val = (TextAnchor)1;
		operationsPage.UIRoot = UIFactory.CreateVerticalGroup(parent, "OperationsPage", false, false, true, true, 0, default(Vector4), clear, val);
		GameObject uIRoot = operationsPage.UIRoot;
		int? num = 9999;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(uIRoot, (int?)null, (int?)null, num2, num, (int?)null, (int?)null, (bool?)null);
		GameObject val2 = default(GameObject);
		AutoSliderScrollbar val3 = default(AutoSliderScrollbar);
		operationsPage.ScrollView = UIFactory.CreateScrollView(operationsPage.UIRoot, "ScrollView", ref val2, ref val3, default(Color));
		GameObject scrollView = operationsPage.ScrollView;
		num2 = 9999;
		num = 9999;
		UIFactory.SetLayoutElement(scrollView, (int?)null, (int?)null, num, num2, (int?)null, (int?)null, (bool?)null);
		GameObject obj = val2;
		clear = Color.clear;
		val = (TextAnchor)1;
		operationsPage.ContentGroup = UIFactory.CreateVerticalGroup(obj, "ContentGroup", false, false, true, true, 0, default(Vector4), clear, val);
		GameObject contentGroup = operationsPage.ContentGroup;
		num = 9999;
		num2 = 9999;
		UIFactory.SetLayoutElement(contentGroup, (int?)null, (int?)null, num2, num, (int?)null, (int?)null, (bool?)null);
		operationsPage.SelectedTransition = new OperationBlock(operationsPage, operationsPage.ContentGroup, OperationBlock.OperationBlockType.SelectedTransition);
		operationsPage.SelectedState = new OperationBlock(operationsPage, operationsPage.ContentGroup, OperationBlock.OperationBlockType.SelectedState);
		operationsPage.Method = new OperationBlock(operationsPage, operationsPage.ContentGroup, OperationBlock.OperationBlockType.Method);
		operationsPage.Record = new OperationBlock(operationsPage, operationsPage.ContentGroup, OperationBlock.OperationBlockType.Record);
		return operationsPage;
	}

	public void Refresh()
	{
		SelectedState.Refresh();
		SelectedTransition.Refresh();
		Method.Refresh();
		Record.Refresh();
	}

	public void ClearAll()
	{
		SelectedState.ClearAll();
		SelectedTransition.ClearAll();
		Method.ClearAll();
		Record.ClearAll();
	}
}
public class OperationBlock
{
	public enum OperationBlockType
	{
		SelectedTransition,
		SelectedState,
		Method,
		Record
	}

	public readonly Color subInactiveColor = new Color(0.23f, 0.23f, 0.23f);

	public readonly Color subActiveColor = new Color(0.23f, 0.33f, 0.23f);

	private Toggle record_toggle;

	private Toggle mark_toggle;

	private ButtonRef clear_button;

	private List<ButtonLabel> labels = new List<ButtonLabel>();

	private List<CacheMemberCell> method_cells = new List<CacheMemberCell>();

	public List<CacheMember> methods = new List<CacheMember>();

	private List<ButtonLabel> record_labels = new List<ButtonLabel>();

	public RectTransform Rect { get; set; }

	public OperationBlockType Type { get; set; }

	public OperationsPage Owner { get; set; }

	public GameObject UIRoot { get; set; }

	public Text Title { get; set; }

	public GameObject NameRow { get; set; }

	public GameObject SubContentHolder { get; set; }

	public ButtonRef SubContentButton { get; set; }

	public bool IsRecording => (Object)(object)record_toggle != (Object)null && record_toggle.isOn;

	public bool AddMark => (Object)(object)mark_toggle != (Object)null && mark_toggle.isOn;

	public OperationBlock(OperationsPage owner, GameObject parent, OperationBlockType type)
	{
		//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_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_050d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0513: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Unknown result type (might be due to invalid IL or missing references)
		//IL_051d: Unknown result type (might be due to invalid IL or missing references)
		Owner = owner;
		Type = type;
		TextAnchor? val = (TextAnchor)1;
		UIRoot = UIFactory.CreateVerticalGroup(parent, "StateActionCell", false, false, true, true, 0, default(Vector4), default(Color), val);
		GameObject gameObject = UIRoot.gameObject;
		int? num = 300;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(gameObject, num, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		Rect = UIRoot.GetComponent<RectTransform>();
		ContentSizeFitter val2 = UIRoot.AddComponent<ContentSizeFitter>();
		val2.verticalFit = (FitMode)2;
		NameRow = UIFactory.CreateHorizontalGroup(UIRoot, "NameRow", false, false, true, true, 0, new Vector4(0f, 0f, 10f, 0f), new Color(0f, 1f, 1f, 0.7f), (TextAnchor?)(TextAnchor)3);
		GameObject nameRow = NameRow;
		int? num3 = 200;
		num2 = 9999;
		UIFactory.SetLayoutElement(nameRow, num3, (int?)30, num2, (int?)0, (int?)null, (int?)null, (bool?)null);
		SubContentButton = UIFactory.CreateButton(NameRow, "SubContentButton", "▲", (Color?)subInactiveColor);
		UIFactory.SetLayoutElement(((Component)SubContentButton.Component).gameObject, (int?)25, (int?)25, (int?)0, (int?)0, (int?)null, (int?)null, (bool?)null);
		ButtonRef subContentButton = SubContentButton;
		subContentButton.OnClick = (Action)Delegate.Combine(subContentButton.OnClick, new Action(SubContentClicked));
		Title = UIFactory.CreateLabel(NameRow, "ActionName", "notset", (TextAnchor)3, Color.black, true, 14);
		GameObject gameObject2 = ((Component)Title).gameObject;
		int? num4 = 150;
		num2 = 9999;
		int? num5 = 9999;
		UIFactory.SetLayoutElement(gameObject2, num4, (int?)null, num2, num5, (int?)null, (int?)null, (bool?)null);
		Title.text = Type.ToString();
		Text val3 = default(Text);
		GameObject val4 = UIFactory.CreateToggle(NameRow, "RecordToggle", ref record_toggle, ref val3, default(Color), 20, 20);
		val3.text = "Recording";
		record_toggle.isOn = false;
		GameObject obj = val4;
		int? num6 = 80;
		num5 = 9999;
		num2 = 0;
		UIFactory.SetLayoutElement(obj, num6, (int?)null, num2, num5, (int?)null, (int?)null, (bool?)null);
		val4.SetActive(type == OperationBlockType.Record);
		Text val5 = default(Text);
		val4 = UIFactory.CreateToggle(NameRow, "MarkToggle", ref mark_toggle, ref val5, default(Color), 20, 20);
		val5.text = "Mark";
		mark_toggle.isOn = false;
		GameObject obj2 = val4;
		int? num7 = 80;
		num2 = 9999;
		num5 = 0;
		UIFactory.SetLayoutElement(obj2, num7, (int?)null, num5, num2, (int?)null, (int?)null, (bool?)null);
		val4.SetActive(type == OperationBlockType.Record);
		clear_button = UIFactory.CreateButton(NameRow, "ClearButton", "Clear", (Color?)null);
		GameObject gameObject3 = clear_button.GameObject;
		int? num8 = 80;
		num5 = 25;
		num2 = 0;
		UIFactory.SetLayoutElement(gameObject3, num8, (int?)null, num2, (int?)null, (int?)null, num5, (bool?)null);
		ButtonRef obj3 = clear_button;
		obj3.OnClick = (Action)Delegate.Combine(obj3.OnClick, new Action(ClearButtonClicked));
		clear_button.GameObject.SetActive(type == OperationBlockType.Record);
		SubContentHolder = UIFactory.CreateVerticalGroup(UIRoot, "SubContentHolder", false, false, true, true, 0, default(Vector4), default(Color), (TextAnchor?)null);
		GameObject subContentHolder = SubContentHolder;
		int? num9 = 300;
		num2 = 9999;
		UIFactory.SetLayoutElement(subContentHolder, num9, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		RefreshSubcontentButton();
	}

	public void RefreshSubcontentButton()
	{
		//IL_0041: 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: 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_0064: 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)
		SubContentButton.ButtonText.text = (SubContentHolder.activeSelf ? "▼" : "▲");
		Color val = (SubContentHolder.activeSelf ? subActiveColor : subInactiveColor);
		val.a = 0.5f;
		RuntimeHelper.SetColorBlock((Selectable)(object)SubContentButton.Component, (Color?)val, (Color?)(val * 1.3f), (Color?)null, (Color?)null);
	}

	private void SubContentClicked()
	{
		SubContentHolder.SetActive(!SubContentHolder.activeSelf);
		RefreshSubcontentButton();
	}

	public void Update()
	{
	}

	public void Refresh()
	{
		switch (Type)
		{
		case OperationBlockType.Method:
			ClearMethods();
			CreateMethods();
			break;
		case OperationBlockType.Record:
			((UnityEvent<bool>)(object)record_toggle.onValueChanged).RemoveListener((UnityAction<bool>)OnRecordToggleChange);
			((UnityEvent<bool>)(object)record_toggle.onValueChanged).AddListener((UnityAction<bool>)OnRecordToggleChange);
			break;
		}
	}

	public void ClearAll()
	{
		switch (Type)
		{
		case OperationBlockType.SelectedTransition:
			ClearSelect();
			break;
		case OperationBlockType.SelectedState:
			ClearSelect();
			break;
		case OperationBlockType.Method:
			ClearMethods();
			break;
		case OperationBlockType.Record:
			StopRecord();
			((UnityEvent<bool>)(object)record_toggle.onValueChanged).RemoveListener((UnityAction<bool>)OnRecordToggleChange);
			ClearButtonClicked();
			break;
		}
	}

	public void ClearSelect()
	{
		foreach (ButtonLabel label in labels)
		{
			label.OnReturnToPool();
		}
		labels.Clear();
	}

	public void Select(FsmTransition transition)
	{
		if (Type == OperationBlockType.SelectedTransition)
		{
			ClearSelect();
			string text = FsmUtils.ParseFsmTransition(transition);
			Action button_action = ((transition.toFsmState == null) ? null : ((Action)delegate
			{
				Owner.Owner.SelectState(transition.toState);
			}));
			string button_text = "Select";
			ButtonLabel item = ButtonLabel.OnBorredFromPool(SubContentHolder, text, button_action, button_text);
			labels.Add(item);
		}
	}

	public void Select(FsmState state)
	{
		if (Type != OperationBlockType.SelectedState || state == null)
		{
			return;
		}
		ClearSelect();
		Title.text = "SelectedState: <color=green>" + state.Name + "</color>";
		FsmTransition[] transitions = state.transitions;
		foreach (FsmTransition transition in transitions)
		{
			if (transition != null)
			{
				string text = FsmUtils.ParseFsmTransition(transition);
				Action button_action = ((transition.toFsmState == null) ? null : ((Action)delegate
				{
					Owner.Owner.SelectLine(transition);
				}));
				string button_text = "Select";
				ButtonLabel item = ButtonLabel.OnBorredFromPool(SubContentHolder, text, button_action, button_text);
				labels.Add(item);
			}
		}
	}

	public void ClearMethods()
	{
		foreach (CacheMemberCell method_cell in method_cells)
		{
			if (method_cell != null)
			{
				((CacheObjectCell)method_cell).Disable();
				Pool<CacheMemberCell>.Return(method_cell);
			}
		}
		method_cells.Clear();
		methods.Clear();
	}

	public void GetMethodInfos()
	{
		MethodInfo method = typeof(PlayMakerFSM).GetMethod("SendEvent");
		methods.Add((CacheMember)(object)new NICacheMethod(method, Owner.Owner.Target));
		MethodInfo method2 = typeof(PlayMakerFSM).GetMethod("SetState");
		methods.Add((CacheMember)(object)new NICacheMethod(method2, Owner.Owner.Target));
	}

	public void CreateMethods()
	{
		if (!((Object)(object)Owner.Owner.Target == (Object)null))
		{
			GetMethodInfos();
			for (int i = 0; i < methods.Count; i++)
			{
				CacheMemberCell val = Pool<CacheMemberCell>.Borrow();
				((Transform)((CacheObjectCell)val).Rect).SetParent(SubContentHolder.transform, false);
				method_cells.Add(val);
				CacheObjectControllerHelper.SetCell((CacheObjectCell)(object)val, i, (IList)methods, (Action<CacheObjectCell>)null);
				((CacheObjectCell)val).Enable();
			}
		}
	}

	private void OnRecordToggleChange(bool val)
	{
		if (val)
		{
			FsmWatcher.Register(Owner.Owner.Target, this);
		}
		else
		{
			FsmWatcher.Unregister(Owner.Owner.Target);
		}
	}

	private void StopRecord()
	{
		mark_toggle.isOn = false;
		record_toggle.isOn = false;
	}

	private void ClearButtonClicked()
	{
		foreach (ButtonLabel record_label in record_labels)
		{
			record_label.OnReturnToPool();
		}
		record_labels.Clear();
		Owner.Owner.ClearAllMarks();
	}

	public void AddEventRecord(bool is_global, string from_state_name, string event_name, string to_state_name)
	{
		string text = "";
		ButtonLabel item = ButtonLabel.OnBorredFromPool(text: (!is_global) ? ("<color=green>" + from_state_name + "</color><color=grey>--</color>" + event_name + "<color=grey>--></color><color=green>" + to_state_name + "</color>") : ("<color=grey>Global: </color>" + event_name + "<color=grey>--></color><color=green>" + to_state_name + "</color>"), parent: SubContentHolder, button_action: delegate
		{
			Owner.Owner.SelectLine(is_global, from_state_name, event_name);
		}, button_text: "Select");
		if (AddMark)
		{
			Owner.Owner.MarkLine(is_global, from_state_name, event_name);
			Owner.Owner.MarkState(to_state_name);
		}
		record_labels.Add(item);
	}

	public void AddSetStateRecord(string state_name)
	{
		ButtonLabel item = ButtonLabel.OnBorredFromPool(SubContentHolder, "<color=grey>SetState: </color><color=green>" + state_name + "</color>", delegate
		{
			Owner.Owner.SelectState(state_name);
		}, "Select");
		if (AddMark)
		{
			Owner.Owner.MarkState(state_name);
		}
		record_labels.Add(item);
	}

	public void AddErrorRecord(string msg)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		ButtonLabel buttonLabel = ButtonLabel.OnBorredFromPool(SubContentHolder, "Error: " + msg);
		((Graphic)buttonLabel.Label).color = Color.red;
		record_labels.Add(buttonLabel);
	}
}
public class StateActionCell : ICell, IPooledObject
{
	public GameObject name_row;

	public Text action_name_text;

	public List<CacheMemberCell> member_cells = new List<CacheMemberCell>();

	public List<CacheMember> members = new List<CacheMember>();

	public readonly Color subInactiveColor = new Color(0.23f, 0.23f, 0.23f);

	public readonly Color subActiveColor = new Color(0.23f, 0.33f, 0.23f);

	public bool Enabled => UIRoot.activeSelf;

	public RectTransform Rect { get; set; }

	public GameObject UIRoot { get; set; }

	public float DefaultHeight => 50f;

	public FsmStateAction Target { get; set; }

	public GameObject SubContentHolder { get; set; }

	public ButtonRef SubContentButton { get; set; }

	public GameObject CreateContent(GameObject parent)
	{
		//IL_0017: 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_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_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: 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_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		TextAnchor? val = (TextAnchor)1;
		UIRoot = UIFactory.CreateVerticalGroup(parent, "StateActionCell", false, false, true, true, 0, default(Vector4), default(Color), val);
		GameObject gameObject = UIRoot.gameObject;
		int? num = 300;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(gameObject, num, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		Rect = UIRoot.GetComponent<RectTransform>();
		ContentSizeFitter val2 = UIRoot.AddComponent<ContentSizeFitter>();
		val2.verticalFit = (FitMode)2;
		name_row = UIFactory.CreateHorizontalGroup(UIRoot, "NameRow", false, false, true, true, 0, new Vector4(0f, 0f, 10f, 0f), new Color(0f, 1f, 1f), (TextAnchor?)(TextAnchor)3);
		GameObject obj = name_row;
		int? num3 = 200;
		num2 = 9999;
		UIFactory.SetLayoutElement(obj, num3, (int?)25, num2, (int?)0, (int?)null, (int?)null, (bool?)null);
		SubContentButton = UIFactory.CreateButton(name_row, "SubContentButton", "▲", (Color?)subInactiveColor);
		UIFactory.SetLayoutElement(((Component)SubContentButton.Component).gameObject, (int?)25, (int?)25, (int?)0, (int?)0, (int?)null, (int?)null, (bool?)null);
		ButtonRef subContentButton = SubContentButton;
		subContentButton.OnClick = (Action)Delegate.Combine(subContentButton.OnClick, new Action(SubContentClicked));
		action_name_text = UIFactory.CreateLabel(name_row, "ActionName", "notset", (TextAnchor)3, Color.black, true, 14);
		GameObject gameObject2 = ((Component)action_name_text).gameObject;
		int? num4 = 150;
		num2 = 9999;
		int? num5 = 9999;
		UIFactory.SetLayoutElement(gameObject2, num4, (int?)null, num2, num5, (int?)null, (int?)null, (bool?)null);
		ButtonRef val3 = UIFactory.CreateButton(name_row, "InspectButton", "Inspect", (Color?)null);
		GameObject gameObject3 = val3.GameObject;
		int? num6 = 80;
		num5 = 0;
		num2 = 9999;
		UIFactory.SetLayoutElement(gameObject3, num6, (int?)null, num5, num2, (int?)null, (int?)null, (bool?)null);
		val3.OnClick = (Action)Delegate.Combine(val3.OnClick, (Action)delegate
		{
			InspectorManager.Inspect((object)Target, (CacheObjectBase)null);
		});
		SubContentHolder = UIFactory.CreateVerticalGroup(UIRoot, "SubContentHolder", false, false, true, true, 0, default(Vector4), default(Color), (TextAnchor?)null);
		GameObject subContentHolder = SubContentHolder;
		int? num7 = 300;
		num2 = 9999;
		UIFactory.SetLayoutElement(subContentHolder, num7, (int?)null, num2, (int?)null, (int?)null, (int?)null, (bool?)null);
		return UIRoot;
	}

	public void RefreshSubcontentButton()
	{
		//IL_0041: 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: 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_0064: 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)
		SubContentButton.ButtonText.text = (SubContentHolder.activeSelf ? "▼" : "▲");
		Color val = (SubContentHolder.activeSelf ? subActiveColor : subInactiveColor);
		val.a = 0.5f;
		RuntimeHelper.SetColorBlock((Selectable)(object)SubContentButton.Component, (Color?)val, (Color?)(val * 1.3f), (Color?)null, (Color?)null);
	}

	private void SubContentClicked()
	{
		SubContentHolder.SetActive(!SubContentHolder.activeSelf);
		RefreshSubcontentButton();
	}

	public void SetTarget(FsmStateAction action, int index)
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: 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)
		((Graphic)name_row.GetComponent<Image>()).color = (action.enabled ? new Color(0f, 1f, 1f, 0.7f) : new Color(1f, 0f, 0f, 0.7f));
		((Graphic)action_name_text).color = (action.enabled ? Color.black : Color.white);
		action_name_text.text = " (" + index + ") " + ReflectionExtensions.GetActualType((object)action).Name;
		Target = action;
		AddParameters();
		SubContentHolder.SetActive(true);
		RefreshSubcontentButton();
	}

	public void AddParameters()
	{
		ClearAll();
		members = GetCacheMemberList();
		for (int i = 0; i < members.Count; i++)
		{
			CacheMemberCell val = Pool<CacheMemberCell>.Borrow();
			((Transform)((CacheObjectCell)val).Rect).SetParent((Transform)(object)SubContentHolder.GetComponent<RectTransform>(), false);
			member_cells.Add(val);
			CacheObjectControllerHelper.SetCell((CacheObjectCell)(object)val, i, (IList)members, (Action<CacheObjectCell>)null);
			((CacheObjectCell)val).Enable();
		}
	}

	public List<CacheMember> GetCacheMemberList()
	{
		List<CacheMember> list = new List<CacheMember>();
		List<CacheMember> second = new List<CacheMember>();
		Type type2 = ((object)Target).GetType();
		BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
		PropertyInfo[] properties = type2.GetProperties(bindingAttr);
		foreach (PropertyInfo propertyInfo in properties)
		{
			if (propertyInfo.DeclaringType == type2)
			{
				TryCacheProperty(list, type2, propertyInfo);
			}
		}
		FieldInfo[] fields2 = type2.GetFields(bindingAttr);
		foreach (FieldInfo fieldInfo in fields2)
		{
			if (fieldInfo.DeclaringType == type2)
			{
				TryCacheField(list, type2, fieldInfo);
			}
		}
		return list.Concat(second).ToList();
		void TryCacheField(List<CacheMember> fields, Type type, FieldInfo info)
		{
			try
			{
				NICacheField nICacheField = new NICacheField(info, Target);
				((CacheObjectBase)nICacheField).SetFallbackType(info.FieldType);
				fields.Add((CacheMember)(object)nICacheField);
			}
			catch (Exception)
			{
			}
		}
		void TryCacheProperty(List<CacheMember> props, Type type, PropertyInfo info)
		{
			try
			{
				if (info.CanRead || !info.CanWrite)
				{
					NICacheProperty nICacheProperty = new NICacheProperty(info, Target);
					((CacheObjectBase)nICacheProperty).SetFallbackType(info.PropertyType);
					props.Add((CacheMember)(object)nICacheProperty);
				}
			}
			catch (Exception)
			{
			}
		}
	}

	public void ClearAll()
	{
		foreach (CacheMemberCell member_cell in member_cells)
		{
			((CacheObjectCell)member_cell).Disable();
			Pool<CacheMemberCell>.Return(member_cell);
		}
		member_cells.Clear();
		members.Clear();
	}

	public void Disable()
	{
		GameObject uIRoot = UIRoot;
		if (uIRoot != null)
		{
			uIRoot.SetActive(false);
		}
	}

	public void Enable()
	{
		GameObject uIRoot = UIRoot;
		if (uIRoot != null)
		{
			uIRoot.SetActive(true);
		}
	}

	public void Update()
	{
		if (!SubContentHolder.activeSelf)
		{
			return;
		}
		foreach (CacheMemberCell member_cell in member_cells)
		{
			if (((CacheObjectCell)member_cell).Enabled && ((CacheObjectCell)member_cell).Occupant != null)
			{
				CacheMember memberOccupant = member_cell.MemberOccupant;
				if (((CacheObjectBase)memberOccupant).ShouldAutoEvaluate)
				{
					memberOccupant.Evaluate();
					((CacheObjectBase)memberOccupant).SetDataToCell(((CacheObjectBase)memberOccupant).CellView);
				}
			}
		}
	}
}
public class StateActionPage : ICellPoolDataSource<StateActionCell>
{
	public StateNode Target;

	public ScrollPool<StateActionCell> cells;

	public FsmInspector Owner { get; set; }

	public GameObject UIRoot { get; set; }

	public int ItemCount => (Target != null && Target.Target != null && Target.Target.Actions != null) ? IEnumerableExtensions.GetCount((IEnumerable)Target.Target.Actions) : 0;

	public bool AutoRefresh => Target.owner.AutoRefresh;

	public void OnCellBorrowed(StateActionCell cell)
	{
	}

	public void SetTarget(StateNode target)
	{
		Target = target;
		cells.Refresh(true, true);
	}

	public static StateActionPage Create(GameObject parent, FsmInspector owner)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references)
		StateActionPage stateActionPage = new StateActionPage();
		Color clear = Color.clear;
		TextAnchor? val = (TextAnchor)1;
		stateActionPage.UIRoot = UIFactory.CreateVerticalGroup(parent, "StateActionPage", false, false, true, true, 0, default(Vector4), clear, val);
		GameObject uIRoot = stateActionPage.UIRoot;
		int? num = 9999;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(uIRoot, (int?)null, (int?)null, num, num2, (int?)null, (int?)null, (bool?)null);
		GameObject val2 = default(GameObject);
		GameObject val3 = default(GameObject);
		stateActionPage.cells = UIFactory.CreateScrollPool<StateActionCell>(stateActionPage.UIRoot, "Actions", ref val2, ref val3, (Color?)null);
		GameObject obj = val2;
		num2 = 9999;
		num = 9999;
		UIFactory.SetLayoutElement(obj, (int?)null, (int?)null, num, num2, (int?)null, (int?)null, (bool?)null);
		stateActionPage.cells.Initialize((ICellPoolDataSource<StateActionCell>)stateActionPage, (Action)null);
		return stateActionPage;
	}

	public void ClearAll()
	{
		SetTarget(null);
	}

	public void SetCell(StateActionCell cell, int index)
	{
		if (index < 0 || index >= ItemCount)
		{
			cell.Disable();
			return;
		}
		cell.Enable();
		cell.SetTarget(Target.Target.actions[index], index);
	}

	public void Update()
	{
		foreach (StateActionCell item in cells.CellPool)
		{
			if (item.Enabled && item.Target != null)
			{
				item.Update();
			}
		}
	}
}
public class StateNode : IPooledObject
{
	public List<TransitionCell> transitions = new List<TransitionCell>();

	private GameObject transition_ui_root;

	public FsmInspector owner;

	public ColorBlock default_color;

	public GameObject UIRoot { get; set; }

	public float DefaultHeight => -1f;

	public GameObject GameObject { get; set; }

	public RectTransform RectTransform { get; set; }

	public ButtonRef StateName { get; set; }

	public FsmState Target { get; set; }

	public GameObject CreateContent(GameObject parent)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: 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_030b: Unknown result type (might be due to invalid IL or missing references)
		UIRoot = UIFactory.CreateVerticalGroup(parent, "FsmNode", false, false, true, true, 0, new Vector4(2f, 2f, 2f, 2f), Color.black, (TextAnchor?)(TextAnchor)1);
		RectTransform = UIRoot.GetComponent<RectTransform>();
		ContentSizeFitter val = UIRoot.AddComponent<ContentSizeFitter>();
		val.horizontalFit = (FitMode)2;
		val.verticalFit = (FitMode)2;
		GameObject uIRoot = UIRoot;
		Color val2 = default(Color);
		((Color)(ref val2))..ctor(0.1f, 0.1f, 0.1f, 0.5f);
		TextAnchor? val3 = (TextAnchor)1;
		GameObject val4 = UIFactory.CreateHorizontalGroup(uIRoot, "Content", false, false, true, true, 0, default(Vector4), val2, val3);
		int? num = 100;
		int? num2 = 16;
		int? num3 = 0;
		UIFactory.SetLayoutElement(val4, num, num2, (int?)9999, num3, (int?)null, (int?)null, (bool?)null);
		ContentSizeFitter val5 = val4.AddComponent<ContentSizeFitter>();
		val5.verticalFit = (FitMode)2;
		val5.horizontalFit = (FitMode)2;
		((Behaviour)val5).enabled = false;
		ColorBlock val6 = default(ColorBlock);
		((ColorBlock)(ref val6)).highlightedColor = Color.yellow;
		((ColorBlock)(ref val6)).normalColor = Color.grey;
		((ColorBlock)(ref val6)).disabledColor = Color.blue;
		((ColorBlock)(ref val6)).selectedColor = Color.grey;
		ColorBlock val7 = val6;
		StateName = UIFactory.CreateButton(val4, "StateName", "StateName", val7);
		default_color = ((Selectable)StateName.Component).colors;
		StateName.ButtonText.horizontalOverflow = (HorizontalWrapMode)0;
		GameObject gameObject = StateName.GameObject;
		int? num4 = 100;
		int? num5 = 16;
		num3 = 0;
		UIFactory.SetLayoutElement(gameObject, num4, num5, (int?)9999, num3, (int?)null, (int?)null, (bool?)null);
		StateName.GameObject.AddComponent<ContentSizeFitter>().horizontalFit = (FitMode)2;
		((Behaviour)StateName.GameObject.GetComponent<ContentSizeFitter>()).enabled = false;
		GameObject gameObject2 = StateName.GameObject;
		num3 = 5;
		int? num6 = 5;
		UIFactory.SetLayoutGroup<HorizontalLayoutGroup>(gameObject2, (bool?)null, (bool?)null, (bool?)null, (bool?)null, (int?)null, (int?)null, (int?)null, num3, num6, (TextAnchor?)null);
		((Component)StateName.ButtonText).gameObject.AddComponent<ContentSizeFitter>().horizontalFit = (FitMode)2;
		ButtonRef stateName = StateName;
		stateName.OnClick = (Action)Delegate.Combine(stateName.OnClick, new Action(OnClickNode));
		GameObject uIRoot2 = UIRoot;
		((Color)(ref val2))..ctor(1f, 1f, 1f, 0.5f);
		val3 = (TextAnchor)1;
		transition_ui_root = UIFactory.CreateVerticalGroup(uIRoot2, "StateEvents", false, false, true, true, 1, default(Vector4), val2, val3);
		UIFactory.SetLayoutElement(transition_ui_root, (int?)100, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (bool?)null);
		transition_ui_root.gameObject.AddComponent<ContentSizeFitter>().verticalFit = (FitMode)2;
		GameObject obj = transition_ui_root;
		num6 = 0;
		UIFactory.SetLayoutElement(obj, (int?)100, num6, (int?)9999, (int?)null, (int?)null, (int?)null, (bool?)null);
		return UIRoot;
	}

	public void OnCellBorrowed(TransitionCell cell)
	{
	}

	public void Mark()
	{
		//IL_000c: 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)
		RuntimeHelper.SetColorBlock((Selectable)(object)StateName.Component, (Color?)Color.cyan, (Color?)null, (Color?)null, (Color?)null);
		((Graphic)StateName.ButtonText).color = Color.black;
	}

	public void UnMark()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		RuntimeHelper.SetColorBlock((Selectable)(object)StateName.Component, default_color);
		((Graphic)StateName.ButtonText).color = Color.white;
	}

	public void ClearEvents()
	{
		foreach (TransitionCell transition in transitions)
		{
			transition.OnReturnToPool();
		}
		transitions.Clear();
	}

	private void RefreshEvents()
	{
		ClearEvents();
		FsmTransition[] array = Target.Transitions;
		foreach (FsmTransition val in array)
		{
			TransitionCell transitionCell = Pool<TransitionCell>.Borrow();
			transitionCell.UIRoot.transform.SetParent(transition_ui_root.transform, false);
			transitionCell.SetTarget(val, in_global_transition: false, val.toFsmState == null, Target.ColorIndex);
			transitions.Add(transitionCell);
		}
	}

	public void OnReturnToPool()
	{
		UnSelect();
		NotBeginState();
		UnMark();
		FsmInActive();
		ClearEvents();
		Target = null;
		owner = null;
		Pool<StateNode>.Return(this);
	}

	public void OnClickNode()
	{
		owner.SelectState(this);
	}

	public void Select()
	{
		((Selectable)StateName.Component).interactable = false;
	}

	public void UnSelect()
	{
		((Selectable)StateName.Component).interactable = true;
	}

	public void FsmActive()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)UIRoot.GetComponent<Image>()).color = Color.white;
	}

	public void FsmInActive()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)UIRoot.GetComponent<Image>()).color = Color.black;
	}

	public void IsBeginState()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)StateName.ButtonText).color = Color.yellow;
	}

	public void NotBeginState()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)StateName.ButtonText).color = Color.white;
	}

	public void SetTarget(FsmInspector owner, FsmState fsmState, bool is_begin_state = false)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		this.owner = owner;
		Vector2 center = ((Rect)(ref fsmState.position)).center;
		RectTransform.anchoredPosition = new Vector2(center.x, 0f - center.y);
		UIFactory.SetLayoutElement(UIRoot, (int?)(int)((Rect)(ref fsmState.position)).width, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (bool?)null);
		StateName.ButtonText.text = fsmState.Name;
		Target = fsmState;
		RefreshEvents();
		if (is_begin_state)
		{
			IsBeginState();
		}
		LayoutRebuilder.ForceRebuildLayoutImmediate(RectTransform);
	}
}
public class TransitionCell : ICell, IPooledObject
{
	public Color default_color = Color.black;

	public int color_index;

	private ContentSizeFitter contentSizeFitter;

	public GameObject UIRoot { get; set; }

	public float DefaultHeight => 16f;

	public string Name => EventText.text;

	public Text EventText { get; set; }

	public bool Enabled => UIRoot.activeSelf;

	public RectTransform Rect { get; set; }

	public FsmTransition Target { get; set; }

	public bool InGlobalTransition { get; set; }

	public GameObject CreateContent(GameObject parent)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: 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_006a: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		UIRoot = UIFactory.CreateHorizontalGroup(parent, "NodeEventCell", true, false, true, true, 2, default(Vector4), default_color, (TextAnchor?)(TextAnchor)4);
		Rect = UIRoot.GetComponent<RectTransform>();
		Rect.anchorMin = new Vector2(0.5f, 0.5f);
		Rect.anchorMax = new Vector2(0.5f, 0.5f);
		Rect.pivot = new Vector2(0.5f, 0.5f);
		Rect.sizeDelta = new Vector2(25f, 25f);
		contentSizeFitter = UIRoot.AddComponent<ContentSizeFitter>();
		contentSizeFitter.horizontalFit = (FitMode)2;
		GameObject uIRoot = UIRoot;
		int? num = 100;
		int? num2 = 9999;
		UIFactory.SetLayoutElement(uIRoot, num, (int?)16, num2, (int?)0, (int?)null, (int?)null, (bool?)null);
		EventText = UIFactory.CreateLabel(UIRoot, "NodeEventText", "NotSet", (TextAnchor)4, Color.white, true, 14);
		GameObject gameObject = ((Component)EventText).gameObject;
		num2 = 9999;
		int? num3 = 16;
		int? num4 = 0;
		UIFactory.SetLayoutElement(gameObject, (int?)null, num3, num2, num4, (int?)null, (int?)null, (bool?)null);
		return UIRoot;
	}

	public void OnReturnToPool()
	{
		//IL_000c: 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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		((Graphic)UIRoot.GetComponent<Image>()).color = Color.clear;
		Pool<TransitionCell>.Return(this);