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.Text; using System.Threading; using System.Threading.Tasks; using Cysharp.Threading.Tasks; using Damntry.Utils.ExtensionMethods; using Damntry.Utils.Logging; using Damntry.Utils.Reflection; using Damntry.Utils.Tasks.AsyncDelay; using Damntry.Utils.Timers.StopwatchImpl; using Damntry.UtilsUnity; using Damntry.UtilsUnity.Components.InputManagement.Model; using Damntry.UtilsUnity.Rendering; using Damntry.UtilsUnity.UI.Extensions; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Experimental.Rendering; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Damntry Globals unity")] [assembly: AssemblyDescription("Utils for projects using Unity")] [assembly: AssemblyCompany("Damntry")] [assembly: AssemblyProduct("Damntry Globals unity")] [assembly: AssemblyCopyright("Copyright © Damntry 2025")] [assembly: AssemblyFileVersion("0.1.3")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyVersion("0.1.3.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class ParamCollectionAttribute : Attribute { } [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; } } } public class LeanAudioStream { public int position; public AudioClip audioClip; public float[] audioArr; public LeanAudioStream(float[] audioArr) { this.audioArr = audioArr; } public void OnAudioRead(float[] data) { for (int i = 0; i < data.Length; i++) { data[i] = audioArr[position]; position++; } } public void OnAudioSetPosition(int newPosition) { position = newPosition; } } public class LeanAudio { [CompilerGenerated] private static class <>O { public static PCMSetPositionCallback <0>__OnAudioSetPosition; } public static float MIN_FREQEUNCY_PERIOD = 0.000115f; public static int PROCESSING_ITERATIONS_MAX = 50000; public static float[] generatedWaveDistances; public static int generatedWaveDistancesCount = 0; private static float[] longList; public static LeanAudioOptions options() { if (generatedWaveDistances == null) { generatedWaveDistances = new float[PROCESSING_ITERATIONS_MAX]; longList = new float[PROCESSING_ITERATIONS_MAX]; } return new LeanAudioOptions(); } public static LeanAudioStream createAudioStream(AnimationCurve volume, AnimationCurve frequency, LeanAudioOptions options = null) { if (options == null) { options = new LeanAudioOptions(); } options.useSetData = false; createAudioFromWave(createAudioWave(volume, frequency, options), options); return options.stream; } public static AudioClip createAudio(AnimationCurve volume, AnimationCurve frequency, LeanAudioOptions options = null) { if (options == null) { options = new LeanAudioOptions(); } return createAudioFromWave(createAudioWave(volume, frequency, options), options); } private static int createAudioWave(AnimationCurve volume, AnimationCurve frequency, LeanAudioOptions options) { //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) Keyframe val = volume[volume.length - 1]; float time = ((Keyframe)(ref val)).time; int num = 0; float num2 = 0f; for (int i = 0; i < PROCESSING_ITERATIONS_MAX; i++) { float num3 = frequency.Evaluate(num2); if (num3 < MIN_FREQEUNCY_PERIOD) { num3 = MIN_FREQEUNCY_PERIOD; } float num4 = volume.Evaluate(num2 + 0.5f * num3); if (options.vibrato != null) { for (int j = 0; j < options.vibrato.Length; j++) { float num5 = Mathf.Abs(Mathf.Sin(1.5708f + num2 * (1f / ((Vector3)(ref options.vibrato[j]))[0]) * (float)Math.PI)); float num6 = 1f - ((Vector3)(ref options.vibrato[j]))[1]; num5 = ((Vector3)(ref options.vibrato[j]))[1] + num6 * num5; num4 *= num5; } } if (num2 + 0.5f * num3 >= time) { break; } if (num >= PROCESSING_ITERATIONS_MAX - 1) { Debug.LogError((object)("LeanAudio has reached it's processing cap. To avoid this error increase the number of iterations ex: LeanAudio.PROCESSING_ITERATIONS_MAX = " + PROCESSING_ITERATIONS_MAX * 2)); break; } int num7 = num / 2; num2 += num3; generatedWaveDistances[num7] = num2; longList[num] = num2; longList[num + 1] = ((i % 2 == 0) ? (0f - num4) : num4); num += 2; } num += -2; generatedWaveDistancesCount = num / 2; return num; } private static AudioClip createAudioFromWave(int waveLength, LeanAudioOptions options) { //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_029a: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown float num = longList[waveLength - 2]; float[] array = new float[(int)((float)options.frequencyRate * num)]; int num2 = 0; float num3 = longList[num2]; float num4 = 0f; _ = longList[num2]; float num5 = longList[num2 + 1]; for (int i = 0; i < array.Length; i++) { float num6 = (float)i / (float)options.frequencyRate; if (num6 > longList[num2]) { num4 = longList[num2]; num2 += 2; num3 = longList[num2] - longList[num2 - 2]; num5 = longList[num2 + 1]; } float num7 = (num6 - num4) / num3; float num8 = Mathf.Sin(num7 * (float)Math.PI); if (options.waveStyle == LeanAudioOptions.LeanAudioWaveStyle.Square) { if (num8 > 0f) { num8 = 1f; } if (num8 < 0f) { num8 = -1f; } } else if (options.waveStyle == LeanAudioOptions.LeanAudioWaveStyle.Sawtooth) { float num9 = ((num8 > 0f) ? 1f : (-1f)); num8 = ((!(num7 < 0.5f)) ? ((1f - num7) * 2f * num9) : (num7 * 2f * num9)); } else if (options.waveStyle == LeanAudioOptions.LeanAudioWaveStyle.Noise) { float num10 = 1f - options.waveNoiseInfluence + Mathf.PerlinNoise(0f, num6 * options.waveNoiseScale) * options.waveNoiseInfluence; num8 *= num10; } num8 *= num5; if (options.modulation != null) { for (int j = 0; j < options.modulation.Length; j++) { float num11 = Mathf.Abs(Mathf.Sin(1.5708f + num6 * (1f / ((Vector3)(ref options.modulation[j]))[0]) * (float)Math.PI)); float num12 = 1f - ((Vector3)(ref options.modulation[j]))[1]; num11 = ((Vector3)(ref options.modulation[j]))[1] + num12 * num11; num8 *= num11; } } array[i] = num8; } int num13 = array.Length; AudioClip val = null; if (options.useSetData) { int frequencyRate = options.frequencyRate; object obj = <>O.<0>__OnAudioSetPosition; if (obj == null) { PCMSetPositionCallback val2 = OnAudioSetPosition; <>O.<0>__OnAudioSetPosition = val2; obj = (object)val2; } val = AudioClip.Create("Generated Audio", num13, 1, frequencyRate, false, (PCMReaderCallback)null, (PCMSetPositionCallback)obj); val.SetData(array, 0); } else { options.stream = new LeanAudioStream(array); val = AudioClip.Create("Generated Audio", num13, 1, options.frequencyRate, false, new PCMReaderCallback(options.stream.OnAudioRead), new PCMSetPositionCallback(options.stream.OnAudioSetPosition)); options.stream.audioClip = val; } return val; } private static void OnAudioSetPosition(int newPosition) { } public static AudioClip generateAudioFromCurve(AnimationCurve curve, int frequencyRate = 44100) { //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) Keyframe val = curve[curve.length - 1]; float time = ((Keyframe)(ref val)).time; float[] array = new float[(int)((float)frequencyRate * time)]; for (int i = 0; i < array.Length; i++) { float num = (float)i / (float)frequencyRate; array[i] = curve.Evaluate(num); } int num2 = array.Length; AudioClip obj = AudioClip.Create("Generated Audio", num2, 1, frequencyRate, false); obj.SetData(array, 0); return obj; } public static AudioSource play(AudioClip audio, float volume) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) AudioSource obj = playClipAt(audio, Vector3.zero); obj.volume = volume; return obj; } public static AudioSource play(AudioClip audio) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return playClipAt(audio, Vector3.zero); } public static AudioSource play(AudioClip audio, Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return playClipAt(audio, pos); } public static AudioSource play(AudioClip audio, Vector3 pos, float volume) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) AudioSource obj = playClipAt(audio, pos); obj.minDistance = 1f; obj.volume = volume; return obj; } public static AudioSource playClipAt(AudioClip clip, Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(); val.transform.position = pos; AudioSource obj = val.AddComponent(); obj.clip = clip; obj.Play(); Object.Destroy((Object)(object)val, clip.length); return obj; } public static void printOutAudioClip(AudioClip audioClip, ref AnimationCurve curve, float scaleX = 1f) { //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) //IL_004e: Expected O, but got Unknown float[] array = new float[audioClip.samples * audioClip.channels]; audioClip.GetData(array, 0); int i = 0; Keyframe[] array2 = (Keyframe[])(object)new Keyframe[array.Length]; for (; i < array.Length; i++) { array2[i] = new Keyframe((float)i * scaleX, array[i]); } curve = new AnimationCurve(array2); } } public class LeanAudioOptions { public enum LeanAudioWaveStyle { Sine, Square, Sawtooth, Noise } public LeanAudioWaveStyle waveStyle; public Vector3[] vibrato; public Vector3[] modulation; public int frequencyRate = 44100; public float waveNoiseScale = 1000f; public float waveNoiseInfluence = 1f; public bool useSetData = true; public LeanAudioStream stream; public LeanAudioOptions setFrequency(int frequencyRate) { this.frequencyRate = frequencyRate; return this; } public LeanAudioOptions setVibrato(Vector3[] vibrato) { this.vibrato = vibrato; return this; } public LeanAudioOptions setWaveSine() { waveStyle = LeanAudioWaveStyle.Sine; return this; } public LeanAudioOptions setWaveSquare() { waveStyle = LeanAudioWaveStyle.Square; return this; } public LeanAudioOptions setWaveSawtooth() { waveStyle = LeanAudioWaveStyle.Sawtooth; return this; } public LeanAudioOptions setWaveNoise() { waveStyle = LeanAudioWaveStyle.Noise; return this; } public LeanAudioOptions setWaveStyle(LeanAudioWaveStyle style) { waveStyle = style; return this; } public LeanAudioOptions setWaveNoiseScale(float waveScale) { waveNoiseScale = waveScale; return this; } public LeanAudioOptions setWaveNoiseInfluence(float influence) { waveNoiseInfluence = influence; return this; } } public class LeanTester : MonoBehaviour { [CompilerGenerated] private sealed class d__2 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public LeanTester <>4__this; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LeanTester leanTester = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = Time.realtimeSinceStartup + leanTester.timeout; break; case 1: <>1__state = -1; break; } if (Time.realtimeSinceStartup < 5__2) { <>2__current = 0; <>1__state = 1; return true; } if (!LeanTest.testsFinished) { Debug.Log((object)LeanTest.formatB("Tests timed out!")); LeanTest.overview(); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public float timeout = 15f; public void Start() { ((MonoBehaviour)this).StartCoroutine(timeoutCheck()); } [IteratorStateMachine(typeof(d__2))] private IEnumerator timeoutCheck() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } } public class LeanTest { public static int expected = 0; private static int tests = 0; private static int passes = 0; public static float timeout = 15f; public static bool timeoutStarted = false; public static bool testsFinished = false; public static void debug(string name, bool didPass, string failExplaination = null) { expect(didPass, name, failExplaination); } public static void expect(bool didPass, string definition, string failExplaination = null) { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) float num = printOutLength(definition); int totalWidth = 40 - (int)(num * 1.05f); string text = "".PadRight(totalWidth, "_"[0]); string text2 = formatB(definition) + " " + text + " [ " + (didPass ? formatC("pass", "green") : formatC("fail", "red")) + " ]"; if (!didPass && failExplaination != null) { text2 = text2 + " - " + failExplaination; } Debug.Log((object)text2); if (didPass) { passes++; } tests++; if (tests == expected && !testsFinished) { overview(); } else if (tests > expected) { Debug.Log((object)(formatB("Too many tests for a final report!") + " set LeanTest.expected = " + tests)); } if (!timeoutStarted) { timeoutStarted = true; GameObject val = new GameObject { name = "~LeanTest" }; (val.AddComponent(typeof(LeanTester)) as LeanTester).timeout = timeout; ((Object)val).hideFlags = (HideFlags)61; } } public static string padRight(int len) { string text = ""; for (int i = 0; i < len; i++) { text += "_"; } return text; } public static float printOutLength(string str) { float num = 0f; for (int i = 0; i < str.Length; i++) { num = ((str[i] != "I"[0]) ? ((str[i] != "J"[0]) ? (num + 1f) : (num + 0.85f)) : (num + 0.5f)); } return num; } public static string formatBC(string str, string color) { return formatC(formatB(str), color); } public static string formatB(string str) { return "" + str + ""; } public static string formatC(string str, string color) { return "" + str + ""; } public static void overview() { testsFinished = true; int num = expected - passes; string text = ((num > 0) ? formatBC(num.ToString() ?? "", "red") : (num.ToString() ?? "")); Debug.Log((object)(formatB("Final Report:") + " _____________________ PASSED: " + formatBC(passes.ToString() ?? "", "green") + " FAILED: " + text + " ")); } } public enum TweenAction { MOVE_X, MOVE_Y, MOVE_Z, MOVE_LOCAL_X, MOVE_LOCAL_Y, MOVE_LOCAL_Z, MOVE_CURVED, MOVE_CURVED_LOCAL, MOVE_SPLINE, MOVE_SPLINE_LOCAL, SCALE_X, SCALE_Y, SCALE_Z, ROTATE_X, ROTATE_Y, ROTATE_Z, ROTATE_AROUND, ROTATE_AROUND_LOCAL, CANVAS_ROTATEAROUND, CANVAS_ROTATEAROUND_LOCAL, CANVAS_PLAYSPRITE, ALPHA, TEXT_ALPHA, CANVAS_ALPHA, CANVASGROUP_ALPHA, ALPHA_VERTEX, COLOR, CALLBACK_COLOR, TEXT_COLOR, CANVAS_COLOR, CANVAS_MOVE_X, CANVAS_MOVE_Y, CANVAS_MOVE_Z, CALLBACK, MOVE, MOVE_LOCAL, MOVE_TO_TRANSFORM, ROTATE, ROTATE_LOCAL, SCALE, VALUE3, GUI_MOVE, GUI_MOVE_MARGIN, GUI_SCALE, GUI_ALPHA, GUI_ROTATE, DELAYED_SOUND, CANVAS_MOVE, CANVAS_SCALE, CANVAS_SIZEDELTA } public enum LeanTweenType { notUsed, linear, easeOutQuad, easeInQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInSine, easeOutSine, easeInOutSine, easeInExpo, easeOutExpo, easeInOutExpo, easeInCirc, easeOutCirc, easeInOutCirc, easeInBounce, easeOutBounce, easeInOutBounce, easeInBack, easeOutBack, easeInOutBack, easeInElastic, easeOutElastic, easeInOutElastic, easeSpring, easeShake, punch, once, clamp, pingPong, animationCurve } public class LeanTween : MonoBehaviour { public static bool throwErrors = true; public static float tau = (float)Math.PI * 2f; public static float PI_DIV2 = (float)Math.PI / 2f; private static LTSeq[] sequences; private static LTDescr[] tweens; private static int[] tweensFinished; private static LTDescr tween; private static int tweenMaxSearch = -1; private static int maxTweens = 400; private static int maxSequences = 400; private static int frameRendered = -1; private static GameObject _tweenEmpty; public static float dtEstimated = -1f; public static float dtManual; public static float dtActual; private static uint global_counter = 0u; private static int i; private static int j; private static int finishedCnt; public static AnimationCurve punch = new AnimationCurve((Keyframe[])(object)new Keyframe[9] { new Keyframe(0f, 0f), new Keyframe(0.112586f, 0.9976035f), new Keyframe(0.3120486f, -0.1720615f), new Keyframe(0.4316337f, 0.07030682f), new Keyframe(0.5524869f, -0.03141804f), new Keyframe(0.6549395f, 0.003909959f), new Keyframe(0.770987f, -0.009817753f), new Keyframe(0.8838775f, 0.001939224f), new Keyframe(1f, 0f) }); public static AnimationCurve shake = new AnimationCurve((Keyframe[])(object)new Keyframe[4] { new Keyframe(0f, 0f), new Keyframe(0.25f, 1f), new Keyframe(0.75f, -1f), new Keyframe(1f, 0f) }); private static int maxTweenReached; public static int startSearch = 0; public static LTDescr d; private static Action[] eventListeners; private static GameObject[] goListeners; private static int eventsMaxSearch = 0; public static int EVENTS_MAX = 10; public static int LISTENERS_MAX = 10; private static int INIT_LISTENERS_MAX = LISTENERS_MAX; public static int maxSearch => tweenMaxSearch; public static int maxSimulataneousTweens => maxTweens; public static int tweensRunning { get { int num = 0; for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].toggle) { num++; } } return num; } } public static GameObject tweenEmpty { get { init(maxTweens); return _tweenEmpty; } } public static void init() { init(maxTweens); } public static void init(int maxSimultaneousTweens) { init(maxSimultaneousTweens, maxSequences); } public static void init(int maxSimultaneousTweens, int maxSimultaneousSequences) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown if (tweens == null) { maxTweens = maxSimultaneousTweens; tweens = new LTDescr[maxTweens]; tweensFinished = new int[maxTweens]; _tweenEmpty = new GameObject(); ((Object)_tweenEmpty).name = "~LeanTween"; _tweenEmpty.AddComponent(typeof(LeanTween)); _tweenEmpty.isStatic = true; ((Object)_tweenEmpty).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)_tweenEmpty); for (int i = 0; i < maxTweens; i++) { tweens[i] = new LTDescr(); } SceneManager.sceneLoaded += onLevelWasLoaded54; sequences = new LTSeq[maxSimultaneousSequences]; for (int j = 0; j < maxSimultaneousSequences; j++) { sequences[j] = new LTSeq(); } } } public static void reset() { if (tweens != null) { for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i] != null) { tweens[i].toggle = false; } } } tweens = null; Object.Destroy((Object)(object)_tweenEmpty); } public void LateUpdate() { update(); } private static void onLevelWasLoaded54(Scene scene, LoadSceneMode mode) { internalOnLevelWasLoaded(((Scene)(ref scene)).buildIndex); } private static void internalOnLevelWasLoaded(int lvl) { LTGUI.reset(); } public static void update() { if (frameRendered == Time.frameCount) { return; } init(); dtEstimated = ((dtEstimated < 0f) ? 0f : (dtEstimated = Time.unscaledDeltaTime)); dtActual = Time.deltaTime; maxTweenReached = 0; finishedCnt = 0; for (int i = 0; i <= tweenMaxSearch && i < maxTweens; i++) { tween = tweens[i]; if (tween.toggle) { maxTweenReached = i; if (tween.updateInternal()) { tweensFinished[finishedCnt] = i; finishedCnt++; } } } tweenMaxSearch = maxTweenReached; frameRendered = Time.frameCount; for (int j = 0; j < finishedCnt; j++) { LeanTween.j = tweensFinished[j]; tween = tweens[LeanTween.j]; removeTween(LeanTween.j); if (tween.hasExtraOnCompletes && (Object)(object)tween.trans != (Object)null) { tween.callOnCompletes(); } } } public static void removeTween(int i, int uniqueId) { if (tweens[i].uniqueId == uniqueId) { removeTween(i); } } public static void removeTween(int i) { if (!tweens[i].toggle) { return; } tweens[i].toggle = false; if (tweens[i].destroyOnComplete) { if (tweens[i].ltRect != null) { LTGUI.destroy(tweens[i].ltRect.id); } else if ((Object)(object)tweens[i].trans != (Object)null && (Object)(object)((Component)tweens[i].trans).gameObject != (Object)(object)_tweenEmpty) { Object.Destroy((Object)(object)((Component)tweens[i].trans).gameObject); } } startSearch = i; if (i + 1 >= tweenMaxSearch) { startSearch = 0; } } public static Vector3[] add(Vector3[] a, Vector3 b) { //IL_001d: 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_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) Vector3[] array = (Vector3[])(object)new Vector3[a.Length]; for (i = 0; i < a.Length; i++) { array[i] = a[i] + b; } return array; } public static float closestRot(float from, float to) { float num = 0f - (360f - to); float num2 = 360f + to; float num3 = Mathf.Abs(to - from); float num4 = Mathf.Abs(num - from); float num5 = Mathf.Abs(num2 - from); if (num3 < num4 && num3 < num5) { return to; } if (num4 < num5) { return num; } return num2; } public static void cancelAll() { cancelAll(callComplete: false); } public static void cancelAll(bool callComplete) { init(); for (int i = 0; i <= tweenMaxSearch; i++) { if ((Object)(object)tweens[i].trans != (Object)null) { if (callComplete && tweens[i].optional.onComplete != null) { tweens[i].optional.onComplete(); } removeTween(i); } } } public static void cancel(GameObject gameObject) { cancel(gameObject, callOnComplete: false); } public static void cancel(GameObject gameObject, bool callOnComplete) { init(); Transform transform = gameObject.transform; for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].toggle && (Object)(object)tweens[i].trans == (Object)(object)transform) { if (callOnComplete && tweens[i].optional.onComplete != null) { tweens[i].optional.onComplete(); } removeTween(i); } } } public static void cancel(RectTransform rect) { cancel(((Component)rect).gameObject, callOnComplete: false); } public static void cancel(GameObject gameObject, int uniqueId, bool callOnComplete = false) { if (uniqueId < 0) { return; } init(); int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if ((Object)(object)tweens[num].trans == (Object)null || ((Object)(object)((Component)tweens[num].trans).gameObject == (Object)(object)gameObject && tweens[num].counter == num2)) { if (callOnComplete && tweens[num].optional.onComplete != null) { tweens[num].optional.onComplete(); } removeTween(num); } } public static void cancel(LTRect ltRect, int uniqueId) { if (uniqueId >= 0) { init(); int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (tweens[num].ltRect == ltRect && tweens[num].counter == num2) { removeTween(num); } } } public static void cancel(int uniqueId) { cancel(uniqueId, callOnComplete: false); } public static void cancel(int uniqueId, bool callOnComplete) { if (uniqueId < 0) { return; } init(); int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (num > tweens.Length - 1) { int num3 = num - tweens.Length; LTSeq lTSeq = sequences[num3]; for (int i = 0; i < maxSequences; i++) { if (lTSeq.current.tween != null) { removeTween(lTSeq.current.tween.uniqueId & 0xFFFF); } if (lTSeq.previous != null) { lTSeq.current = lTSeq.previous; continue; } break; } } else if (tweens[num].counter == num2) { if (callOnComplete && tweens[num].optional.onComplete != null) { tweens[num].optional.onComplete(); } removeTween(num); } } public static LTDescr descr(int uniqueId) { int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (tweens[num] != null && tweens[num].uniqueId == uniqueId && tweens[num].counter == num2) { return tweens[num]; } for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].uniqueId == uniqueId && tweens[i].counter == num2) { return tweens[i]; } } return null; } public static LTDescr description(int uniqueId) { return descr(uniqueId); } public static LTDescr[] descriptions(GameObject gameObject = null) { if ((Object)(object)gameObject == (Object)null) { return null; } List list = new List(); Transform transform = gameObject.transform; for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].toggle && (Object)(object)tweens[i].trans == (Object)(object)transform) { list.Add(tweens[i]); } } return list.ToArray(); } [Obsolete("Use 'pause( id )' instead")] public static void pause(GameObject gameObject, int uniqueId) { pause(uniqueId); } public static void pause(int uniqueId) { int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (tweens[num].counter == num2) { tweens[num].pause(); } } public static void pause(GameObject gameObject) { Transform transform = gameObject.transform; for (int i = 0; i <= tweenMaxSearch; i++) { if ((Object)(object)tweens[i].trans == (Object)(object)transform) { tweens[i].pause(); } } } public static void pauseAll() { init(); for (int i = 0; i <= tweenMaxSearch; i++) { tweens[i].pause(); } } public static void resumeAll() { init(); for (int i = 0; i <= tweenMaxSearch; i++) { tweens[i].resume(); } } [Obsolete("Use 'resume( id )' instead")] public static void resume(GameObject gameObject, int uniqueId) { resume(uniqueId); } public static void resume(int uniqueId) { int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (tweens[num].counter == num2) { tweens[num].resume(); } } public static void resume(GameObject gameObject) { Transform transform = gameObject.transform; for (int i = 0; i <= tweenMaxSearch; i++) { if ((Object)(object)tweens[i].trans == (Object)(object)transform) { tweens[i].resume(); } } } public static bool isTweening(GameObject gameObject = null) { if ((Object)(object)gameObject == (Object)null) { for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].toggle) { return true; } } return false; } Transform transform = gameObject.transform; for (int j = 0; j <= tweenMaxSearch; j++) { if (tweens[j].toggle && (Object)(object)tweens[j].trans == (Object)(object)transform) { return true; } } return false; } public static bool isTweening(RectTransform rect) { return isTweening(((Component)rect).gameObject); } public static bool isTweening(int uniqueId) { int num = uniqueId & 0xFFFF; int num2 = uniqueId >> 16; if (num < 0 || num >= maxTweens) { return false; } if (tweens[num].counter == num2 && tweens[num].toggle) { return true; } return false; } public static bool isTweening(LTRect ltRect) { for (int i = 0; i <= tweenMaxSearch; i++) { if (tweens[i].toggle && tweens[i].ltRect == ltRect) { return true; } } return false; } public static void drawBezierPath(Vector3 a, Vector3 b, Vector3 c, Vector3 d, float arrowSize = 0f, Transform arrowTransform = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00c0: 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_00c9: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) Vector3 val = a; Vector3 val2 = -a + 3f * (b - c) + d; Vector3 val3 = 3f * (a + c) - 6f * b; Vector3 val4 = 3f * (b - a); if (arrowSize > 0f) { Vector3 position = arrowTransform.position; Quaternion rotation = arrowTransform.rotation; float num = 0f; for (float num2 = 1f; num2 <= 120f; num2 += 1f) { float num3 = num2 / 120f; Vector3 val5 = ((val2 * num3 + val3) * num3 + val4) * num3 + a; Gizmos.DrawLine(val, val5); float num4 = num; Vector3 val6 = val5 - val; num = num4 + ((Vector3)(ref val6)).magnitude; if (num > 1f) { num -= 1f; arrowTransform.position = val5; arrowTransform.LookAt(val, Vector3.forward); Vector3 val7 = arrowTransform.TransformDirection(Vector3.right); Vector3 val8 = val - val5; val8 = ((Vector3)(ref val8)).normalized; Gizmos.DrawLine(val5, val5 + (val7 + val8) * arrowSize); val7 = arrowTransform.TransformDirection(-Vector3.right); Gizmos.DrawLine(val5, val5 + (val7 + val8) * arrowSize); } val = val5; } arrowTransform.position = position; arrowTransform.rotation = rotation; } else { for (float num5 = 1f; num5 <= 30f; num5 += 1f) { float num3 = num5 / 30f; Vector3 val5 = ((val2 * num3 + val3) * num3 + val4) * num3 + a; Gizmos.DrawLine(val, val5); val = val5; } } } public static object logError(string error) { if (throwErrors) { Debug.LogError((object)error); } else { Debug.Log((object)error); } return null; } public static LTDescr options(LTDescr seed) { Debug.LogError((object)"error this function is no longer used"); return null; } public static LTDescr options() { init(); bool flag = false; j = 0; i = startSearch; while (j <= maxTweens) { if (j >= maxTweens) { return logError("LeanTween - You have run out of available spaces for tweening. To avoid this error increase the number of spaces to available for tweening when you initialize the LeanTween class ex: LeanTween.init( " + maxTweens * 2 + " );") as LTDescr; } if (i >= maxTweens) { i = 0; } if (!tweens[i].toggle) { if (i + 1 > tweenMaxSearch) { tweenMaxSearch = i + 1; } startSearch = i + 1; flag = true; break; } j++; i++; } if (!flag) { logError("no available tween found!"); } tweens[i].reset(); global_counter++; if (global_counter > 32768) { global_counter = 0u; } tweens[i].setId((uint)i, global_counter); return tweens[i]; } private static LTDescr pushNewTween(GameObject gameObject, Vector3 to, float time, LTDescr tween) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) init(maxTweens); if ((Object)(object)gameObject == (Object)null || tween == null) { return null; } tween.trans = gameObject.transform; tween.to = to; tween.time = time; return tween; } public static LTDescr play(RectTransform rectTransform, Sprite[] sprites) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) float time = 0.25f * (float)sprites.Length; return pushNewTween(((Component)rectTransform).gameObject, new Vector3((float)sprites.Length - 1f, 0f, 0f), time, options().setCanvasPlaySprite().setSprites(sprites).setRepeat(-1)); } public static LTDescr alpha(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) LTDescr lTDescr = pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setAlpha()); SpriteRenderer component = gameObject.GetComponent(); lTDescr.spriteRen = component; return lTDescr; } public static LTSeq sequence(bool initSequence = true) { init(maxTweens); for (int i = 0; i < sequences.Length; i++) { if ((sequences[i].tween != null && sequences[i].tween.toggle) || sequences[i].toggle) { continue; } LTSeq lTSeq = sequences[i]; if (initSequence) { lTSeq.init((uint)(i + tweens.Length), global_counter); global_counter++; if (global_counter > 32768) { global_counter = 0u; } } else { lTSeq.reset(); } return lTSeq; } return null; } public static LTDescr alpha(LTRect ltRect, float to, float time) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) ltRect.alphaEnabled = true; return pushNewTween(tweenEmpty, new Vector3(to, 0f, 0f), time, options().setGUIAlpha().setRect(ltRect)); } public static LTDescr textAlpha(RectTransform rectTransform, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTransform).gameObject, new Vector3(to, 0f, 0f), time, options().setTextAlpha()); } public static LTDescr alphaText(RectTransform rectTransform, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTransform).gameObject, new Vector3(to, 0f, 0f), time, options().setTextAlpha()); } public static LTDescr alphaCanvas(CanvasGroup canvasGroup, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)canvasGroup).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasGroupAlpha()); } public static LTDescr alphaVertex(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setAlphaVertex()); } public static LTDescr color(GameObject gameObject, Color to, float time) { //IL_0006: 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_0021: 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_002d: 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) LTDescr lTDescr = pushNewTween(gameObject, new Vector3(1f, to.a, 0f), time, options().setColor().setPoint(new Vector3(to.r, to.g, to.b))); SpriteRenderer component = gameObject.GetComponent(); lTDescr.spriteRen = component; return lTDescr; } public static LTDescr textColor(RectTransform rectTransform, Color to, float time) { //IL_000b: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) return pushNewTween(((Component)rectTransform).gameObject, new Vector3(1f, to.a, 0f), time, options().setTextColor().setPoint(new Vector3(to.r, to.g, to.b))); } public static LTDescr colorText(RectTransform rectTransform, Color to, float time) { //IL_000b: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) return pushNewTween(((Component)rectTransform).gameObject, new Vector3(1f, to.a, 0f), time, options().setTextColor().setPoint(new Vector3(to.r, to.g, to.b))); } public static LTDescr delayedCall(float delayTime, Action callback) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector3.zero, delayTime, options().setCallback().setOnComplete(callback)); } public static LTDescr delayedCall(float delayTime, Action callback) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector3.zero, delayTime, options().setCallback().setOnComplete(callback)); } public static LTDescr delayedCall(GameObject gameObject, float delayTime, Action callback) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, Vector3.zero, delayTime, options().setCallback().setOnComplete(callback)); } public static LTDescr delayedCall(GameObject gameObject, float delayTime, Action callback) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, Vector3.zero, delayTime, options().setCallback().setOnComplete(callback)); } public static LTDescr destroyAfter(LTRect rect, float delayTime) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector3.zero, delayTime, options().setCallback().setRect(rect).setDestroyOnComplete(doesDestroy: true)); } public static LTDescr move(GameObject gameObject, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setMove()); } public static LTDescr move(GameObject gameObject, Vector2 to, float time) { //IL_0001: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to.x, to.y, gameObject.transform.position.z), time, options().setMove()); } public static LTDescr move(GameObject gameObject, Vector3[] to, float time) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveCurved(); if (d.optional.path == null) { d.optional.path = new LTBezierPath(to); } else { d.optional.path.setPoints(to); } return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr move(GameObject gameObject, LTBezierPath to, float time) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveCurved(); d.optional.path = to; return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr move(GameObject gameObject, LTSpline to, float time) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveSpline(); d.optional.spline = to; return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr moveSpline(GameObject gameObject, Vector3[] to, float time) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveSpline(); d.optional.spline = new LTSpline(to); return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr moveSpline(GameObject gameObject, LTSpline to, float time) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveSpline(); d.optional.spline = to; return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr moveSplineLocal(GameObject gameObject, Vector3[] to, float time) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveSplineLocal(); d.optional.spline = new LTSpline(to); return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr move(LTRect ltRect, Vector2 to, float time) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector2.op_Implicit(to), time, options().setGUIMove().setRect(ltRect)); } public static LTDescr moveMargin(LTRect ltRect, Vector2 to, float time) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector2.op_Implicit(to), time, options().setGUIMoveMargin().setRect(ltRect)); } public static LTDescr moveX(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveX()); } public static LTDescr moveY(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveY()); } public static LTDescr moveZ(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveZ()); } public static LTDescr moveLocal(GameObject gameObject, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setMoveLocal()); } public static LTDescr moveLocal(GameObject gameObject, Vector3[] to, float time) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveCurvedLocal(); if (d.optional.path == null) { d.optional.path = new LTBezierPath(to); } else { d.optional.path.setPoints(to); } return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr moveLocalX(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveLocalX()); } public static LTDescr moveLocalY(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveLocalY()); } public static LTDescr moveLocalZ(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setMoveLocalZ()); } public static LTDescr moveLocal(GameObject gameObject, LTBezierPath to, float time) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveCurvedLocal(); d.optional.path = to; return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr moveLocal(GameObject gameObject, LTSpline to, float time) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) d = options().setMoveSplineLocal(); d.optional.spline = to; return pushNewTween(gameObject, new Vector3(1f, 0f, 0f), time, d); } public static LTDescr move(GameObject gameObject, Transform to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, Vector3.zero, time, options().setTo(to).setMoveToTransform()); } public static LTDescr rotate(GameObject gameObject, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setRotate()); } public static LTDescr rotate(LTRect ltRect, float to, float time) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, new Vector3(to, 0f, 0f), time, options().setGUIRotate().setRect(ltRect)); } public static LTDescr rotateLocal(GameObject gameObject, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setRotateLocal()); } public static LTDescr rotateX(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setRotateX()); } public static LTDescr rotateY(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setRotateY()); } public static LTDescr rotateZ(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setRotateZ()); } public static LTDescr rotateAround(GameObject gameObject, Vector3 axis, float add, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(add, 0f, 0f), time, options().setAxis(axis).setRotateAround()); } public static LTDescr rotateAroundLocal(GameObject gameObject, Vector3 axis, float add, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(add, 0f, 0f), time, options().setRotateAroundLocal().setAxis(axis)); } public static LTDescr scale(GameObject gameObject, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setScale()); } public static LTDescr scale(LTRect ltRect, Vector2 to, float time) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(tweenEmpty, Vector2.op_Implicit(to), time, options().setGUIScale().setRect(ltRect)); } public static LTDescr scaleX(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setScaleX()); } public static LTDescr scaleY(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setScaleY()); } public static LTDescr scaleZ(GameObject gameObject, float to, float time) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setScaleZ()); } public static LTDescr value(GameObject gameObject, float from, float to, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setCallback().setFrom(new Vector3(from, 0f, 0f))); } public static LTDescr value(float from, float to, float time) { //IL_0010: 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) return pushNewTween(tweenEmpty, new Vector3(to, 0f, 0f), time, options().setCallback().setFrom(new Vector3(from, 0f, 0f))); } public static LTDescr value(GameObject gameObject, Vector2 from, Vector2 to, float time) { //IL_0001: 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_0022: 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_0033: 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_0043: 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) return pushNewTween(gameObject, new Vector3(to.x, to.y, 0f), time, options().setValue3().setTo(new Vector3(to.x, to.y, 0f)).setFrom(new Vector3(from.x, from.y, 0f))); } public static LTDescr value(GameObject gameObject, Vector3 from, Vector3 to, float time) { //IL_0001: 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) return pushNewTween(gameObject, to, time, options().setValue3().setFrom(from)); } public static LTDescr value(GameObject gameObject, Color from, Color to, float time) { //IL_0006: 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_0021: 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_002d: 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_003d: Unknown result type (might be due to invalid IL or missing references) LTDescr lTDescr = pushNewTween(gameObject, new Vector3(1f, to.a, 0f), time, options().setCallbackColor().setPoint(new Vector3(to.r, to.g, to.b)).setFromColor(from) .setHasInitialized(has: false)); SpriteRenderer component = gameObject.GetComponent(); lTDescr.spriteRen = component; return lTDescr; } public static LTDescr value(GameObject gameObject, Action callOnUpdate, float from, float to, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setCallback().setTo(new Vector3(to, 0f, 0f)).setFrom(new Vector3(from, 0f, 0f)) .setOnUpdate(callOnUpdate)); } public static LTDescr value(GameObject gameObject, Action callOnUpdateRatio, float from, float to, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setCallback().setTo(new Vector3(to, 0f, 0f)).setFrom(new Vector3(from, 0f, 0f)) .setOnUpdateRatio(callOnUpdateRatio)); } public static LTDescr value(GameObject gameObject, Action callOnUpdate, Color from, Color to, float time) { //IL_0006: 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_0022: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0050: 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_006a: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(1f, to.a, 0f), time, options().setCallbackColor().setPoint(new Vector3(to.r, to.g, to.b)).setAxis(new Vector3(from.r, from.g, from.b)) .setFrom(new Vector3(0f, from.a, 0f)) .setHasInitialized(has: false) .setOnUpdateColor(callOnUpdate)); } public static LTDescr value(GameObject gameObject, Action callOnUpdate, Color from, Color to, float time) { //IL_0006: 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_0022: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0050: 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_006a: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, new Vector3(1f, to.a, 0f), time, options().setCallbackColor().setPoint(new Vector3(to.r, to.g, to.b)).setAxis(new Vector3(from.r, from.g, from.b)) .setFrom(new Vector3(0f, from.a, 0f)) .setHasInitialized(has: false) .setOnUpdateColor(callOnUpdate)); } public static LTDescr value(GameObject gameObject, Action callOnUpdate, Vector2 from, Vector2 to, float time) { //IL_0001: 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_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_0034: 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_0044: 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) return pushNewTween(gameObject, new Vector3(to.x, to.y, 0f), time, options().setValue3().setTo(new Vector3(to.x, to.y, 0f)).setFrom(new Vector3(from.x, from.y, 0f)) .setOnUpdateVector2(callOnUpdate)); } public static LTDescr value(GameObject gameObject, Action callOnUpdate, Vector3 from, Vector3 to, float time) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, to, time, options().setValue3().setTo(to).setFrom(from) .setOnUpdateVector3(callOnUpdate)); } public static LTDescr value(GameObject gameObject, Action callOnUpdate, float from, float to, float time) { //IL_000c: 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) return pushNewTween(gameObject, new Vector3(to, 0f, 0f), time, options().setCallback().setTo(new Vector3(to, 0f, 0f)).setFrom(new Vector3(from, 0f, 0f)) .setOnUpdate(callOnUpdate, gameObject)); } public static LTDescr delayedSound(AudioClip audio, Vector3 pos, float volume) { //IL_0005: 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) return pushNewTween(tweenEmpty, pos, 0f, options().setDelayedSound().setTo(pos).setFrom(new Vector3(volume, 0f, 0f)) .setAudio(audio)); } public static LTDescr delayedSound(GameObject gameObject, AudioClip audio, Vector3 pos, float volume) { //IL_0001: 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_0022: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(gameObject, pos, 0f, options().setDelayedSound().setTo(pos).setFrom(new Vector3(volume, 0f, 0f)) .setAudio(audio)); } public static LTDescr move(RectTransform rectTrans, Vector3 to, float time) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, to, time, options().setCanvasMove().setRect(rectTrans)); } public static LTDescr moveX(RectTransform rectTrans, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasMoveX().setRect(rectTrans)); } public static LTDescr moveY(RectTransform rectTrans, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasMoveY().setRect(rectTrans)); } public static LTDescr moveZ(RectTransform rectTrans, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasMoveZ().setRect(rectTrans)); } public static LTDescr rotate(RectTransform rectTrans, float to, float time) { //IL_0011: 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) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasRotateAround().setRect(rectTrans).setAxis(Vector3.forward)); } public static LTDescr rotate(RectTransform rectTrans, Vector3 to, float time) { //IL_0006: 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) return pushNewTween(((Component)rectTrans).gameObject, to, time, options().setCanvasRotateAround().setRect(rectTrans).setAxis(Vector3.forward)); } public static LTDescr rotateAround(RectTransform rectTrans, Vector3 axis, float to, float time) { //IL_0011: 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) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasRotateAround().setRect(rectTrans).setAxis(axis)); } public static LTDescr rotateAroundLocal(RectTransform rectTrans, Vector3 axis, float to, float time) { //IL_0011: 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) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasRotateAroundLocal().setRect(rectTrans).setAxis(axis)); } public static LTDescr scale(RectTransform rectTrans, Vector3 to, float time) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, to, time, options().setCanvasScale().setRect(rectTrans)); } public static LTDescr size(RectTransform rectTrans, Vector2 to, float time) { //IL_0006: 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) return pushNewTween(((Component)rectTrans).gameObject, Vector2.op_Implicit(to), time, options().setCanvasSizeDelta().setRect(rectTrans)); } public static LTDescr alpha(RectTransform rectTrans, float to, float time) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(to, 0f, 0f), time, options().setCanvasAlpha().setRect(rectTrans)); } public static LTDescr color(RectTransform rectTrans, Color to, float time) { //IL_000b: 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_002c: 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_0038: 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) return pushNewTween(((Component)rectTrans).gameObject, new Vector3(1f, to.a, 0f), time, options().setCanvasColor().setRect(rectTrans).setPoint(new Vector3(to.r, to.g, to.b))); } public static float tweenOnCurve(LTDescr tweenDescr, float ratioPassed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return tweenDescr.from.x + tweenDescr.diff.x * tweenDescr.optional.animationCurve.Evaluate(ratioPassed); } public static Vector3 tweenOnCurveVector(LTDescr tweenDescr, float ratioPassed) { //IL_0001: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) return new Vector3(tweenDescr.from.x + tweenDescr.diff.x * tweenDescr.optional.animationCurve.Evaluate(ratioPassed), tweenDescr.from.y + tweenDescr.diff.y * tweenDescr.optional.animationCurve.Evaluate(ratioPassed), tweenDescr.from.z + tweenDescr.diff.z * tweenDescr.optional.animationCurve.Evaluate(ratioPassed)); } public static float easeOutQuadOpt(float start, float diff, float ratioPassed) { return (0f - diff) * ratioPassed * (ratioPassed - 2f) + start; } public static float easeInQuadOpt(float start, float diff, float ratioPassed) { return diff * ratioPassed * ratioPassed + start; } public static float easeInOutQuadOpt(float start, float diff, float ratioPassed) { ratioPassed /= 0.5f; if (ratioPassed < 1f) { return diff / 2f * ratioPassed * ratioPassed + start; } ratioPassed -= 1f; return (0f - diff) / 2f * (ratioPassed * (ratioPassed - 2f) - 1f) + start; } public static Vector3 easeInOutQuadOpt(Vector3 start, Vector3 diff, float ratioPassed) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_001d: 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_0028: 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) ratioPassed /= 0.5f; if (ratioPassed < 1f) { return diff / 2f * ratioPassed * ratioPassed + start; } ratioPassed -= 1f; return -diff / 2f * (ratioPassed * (ratioPassed - 2f) - 1f) + start; } public static float linear(float start, float end, float val) { return Mathf.Lerp(start, end, val); } public static float clerp(float start, float end, float val) { float num = 0f; float num2 = 360f; float num3 = Mathf.Abs((num2 - num) / 2f); float num4 = 0f; float num5 = 0f; if (end - start < 0f - num3) { num5 = (num2 - start + end) * val; return start + num5; } if (end - start > num3) { num5 = (0f - (num2 - end + start)) * val; return start + num5; } return start + (end - start) * val; } public static float spring(float start, float end, float val) { val = Mathf.Clamp01(val); val = (Mathf.Sin(val * (float)Math.PI * (0.2f + 2.5f * val * val * val)) * Mathf.Pow(1f - val, 2.2f) + val) * (1f + 1.2f * (1f - val)); return start + (end - start) * val; } public static float easeInQuad(float start, float end, float val) { end -= start; return end * val * val + start; } public static float easeOutQuad(float start, float end, float val) { end -= start; return (0f - end) * val * (val - 2f) + start; } public static float easeInOutQuad(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return end / 2f * val * val + start; } val -= 1f; return (0f - end) / 2f * (val * (val - 2f) - 1f) + start; } public static float easeInOutQuadOpt2(float start, float diffBy2, float val, float val2) { val /= 0.5f; if (val < 1f) { return diffBy2 * val2 + start; } val -= 1f; return (0f - diffBy2) * (val2 - 2f - 1f) + start; } public static float easeInCubic(float start, float end, float val) { end -= start; return end * val * val * val + start; } public static float easeOutCubic(float start, float end, float val) { val -= 1f; end -= start; return end * (val * val * val + 1f) + start; } public static float easeInOutCubic(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return end / 2f * val * val * val + start; } val -= 2f; return end / 2f * (val * val * val + 2f) + start; } public static float easeInQuart(float start, float end, float val) { end -= start; return end * val * val * val * val + start; } public static float easeOutQuart(float start, float end, float val) { val -= 1f; end -= start; return (0f - end) * (val * val * val * val - 1f) + start; } public static float easeInOutQuart(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return end / 2f * val * val * val * val + start; } val -= 2f; return (0f - end) / 2f * (val * val * val * val - 2f) + start; } public static float easeInQuint(float start, float end, float val) { end -= start; return end * val * val * val * val * val + start; } public static float easeOutQuint(float start, float end, float val) { val -= 1f; end -= start; return end * (val * val * val * val * val + 1f) + start; } public static float easeInOutQuint(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return end / 2f * val * val * val * val * val + start; } val -= 2f; return end / 2f * (val * val * val * val * val + 2f) + start; } public static float easeInSine(float start, float end, float val) { end -= start; return (0f - end) * Mathf.Cos(val / 1f * ((float)Math.PI / 2f)) + end + start; } public static float easeOutSine(float start, float end, float val) { end -= start; return end * Mathf.Sin(val / 1f * ((float)Math.PI / 2f)) + start; } public static float easeInOutSine(float start, float end, float val) { end -= start; return (0f - end) / 2f * (Mathf.Cos((float)Math.PI * val / 1f) - 1f) + start; } public static float easeInExpo(float start, float end, float val) { end -= start; return end * Mathf.Pow(2f, 10f * (val / 1f - 1f)) + start; } public static float easeOutExpo(float start, float end, float val) { end -= start; return end * (0f - Mathf.Pow(2f, -10f * val / 1f) + 1f) + start; } public static float easeInOutExpo(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return end / 2f * Mathf.Pow(2f, 10f * (val - 1f)) + start; } val -= 1f; return end / 2f * (0f - Mathf.Pow(2f, -10f * val) + 2f) + start; } public static float easeInCirc(float start, float end, float val) { end -= start; return (0f - end) * (Mathf.Sqrt(1f - val * val) - 1f) + start; } public static float easeOutCirc(float start, float end, float val) { val -= 1f; end -= start; return end * Mathf.Sqrt(1f - val * val) + start; } public static float easeInOutCirc(float start, float end, float val) { val /= 0.5f; end -= start; if (val < 1f) { return (0f - end) / 2f * (Mathf.Sqrt(1f - val * val) - 1f) + start; } val -= 2f; return end / 2f * (Mathf.Sqrt(1f - val * val) + 1f) + start; } public static float easeInBounce(float start, float end, float val) { end -= start; float num = 1f; return end - easeOutBounce(0f, end, num - val) + start; } public static float easeOutBounce(float start, float end, float val) { val /= 1f; end -= start; if (val < 0.36363637f) { return end * (7.5625f * val * val) + start; } if (val < 0.72727275f) { val -= 0.54545456f; return end * (7.5625f * val * val + 0.75f) + start; } if ((double)val < 0.9090909090909091) { val -= 0.8181818f; return end * (7.5625f * val * val + 0.9375f) + start; } val -= 21f / 22f; return end * (7.5625f * val * val + 63f / 64f) + start; } public static float easeInOutBounce(float start, float end, float val) { end -= start; float num = 1f; if (val < num / 2f) { return easeInBounce(0f, end, val * 2f) * 0.5f + start; } return easeOutBounce(0f, end, val * 2f - num) * 0.5f + end * 0.5f + start; } public static float easeInBack(float start, float end, float val, float overshoot = 1f) { end -= start; val /= 1f; float num = 1.70158f * overshoot; return end * val * val * ((num + 1f) * val - num) + start; } public static float easeOutBack(float start, float end, float val, float overshoot = 1f) { float num = 1.70158f * overshoot; end -= start; val = val / 1f - 1f; return end * (val * val * ((num + 1f) * val + num) + 1f) + start; } public static float easeInOutBack(float start, float end, float val, float overshoot = 1f) { float num = 1.70158f * overshoot; end -= start; val /= 0.5f; if (val < 1f) { num *= 1.525f * overshoot; return end / 2f * (val * val * ((num + 1f) * val - num)) + start; } val -= 2f; num *= 1.525f * overshoot; return end / 2f * (val * val * ((num + 1f) * val + num) + 2f) + start; } public static float easeInElastic(float start, float end, float val, float overshoot = 1f, float period = 0.3f) { end -= start; float num = 0f; float num2 = 0f; if (val == 0f) { return start; } if (val == 1f) { return start + end; } if (num2 == 0f || num2 < Mathf.Abs(end)) { num2 = end; num = period / 4f; } else { num = period / ((float)Math.PI * 2f) * Mathf.Asin(end / num2); } if (overshoot > 1f && val > 0.6f) { overshoot = 1f + (1f - val) / 0.4f * (overshoot - 1f); } val -= 1f; return start - num2 * Mathf.Pow(2f, 10f * val) * Mathf.Sin((val - num) * ((float)Math.PI * 2f) / period) * overshoot; } public static float easeOutElastic(float start, float end, float val, float overshoot = 1f, float period = 0.3f) { end -= start; float num = 0f; float num2 = 0f; if (val == 0f) { return start; } if (val == 1f) { return start + end; } if (num2 == 0f || num2 < Mathf.Abs(end)) { num2 = end; num = period / 4f; } else { num = period / ((float)Math.PI * 2f) * Mathf.Asin(end / num2); } if (overshoot > 1f && val < 0.4f) { overshoot = 1f + val / 0.4f * (overshoot - 1f); } return start + end + num2 * Mathf.Pow(2f, -10f * val) * Mathf.Sin((val - num) * ((float)Math.PI * 2f) / period) * overshoot; } public static float easeInOutElastic(float start, float end, float val, float overshoot = 1f, float period = 0.3f) { end -= start; float num = 0f; float num2 = 0f; if (val == 0f) { return start; } val /= 0.5f; if (val == 2f) { return start + end; } if (num2 == 0f || num2 < Mathf.Abs(end)) { num2 = end; num = period / 4f; } else { num = period / ((float)Math.PI * 2f) * Mathf.Asin(end / num2); } if (overshoot > 1f) { if (val < 0.2f) { overshoot = 1f + val / 0.2f * (overshoot - 1f); } else if (val > 0.8f) { overshoot = 1f + (1f - val) / 0.2f * (overshoot - 1f); } } if (val < 1f) { val -= 1f; return start - 0.5f * (num2 * Mathf.Pow(2f, 10f * val) * Mathf.Sin((val - num) * ((float)Math.PI * 2f) / period)) * overshoot; } val -= 1f; return end + start + num2 * Mathf.Pow(2f, -10f * val) * Mathf.Sin((val - num) * ((float)Math.PI * 2f) / period) * 0.5f * overshoot; } public static void addListener(int eventId, Action callback) { addListener(tweenEmpty, eventId, callback); } public static void addListener(GameObject caller, int eventId, Action callback) { if (eventListeners == null) { INIT_LISTENERS_MAX = LISTENERS_MAX; eventListeners = new Action[EVENTS_MAX * LISTENERS_MAX]; goListeners = (GameObject[])(object)new GameObject[EVENTS_MAX * LISTENERS_MAX]; } for (i = 0; i < INIT_LISTENERS_MAX; i++) { int num = eventId * INIT_LISTENERS_MAX + i; if ((Object)(object)goListeners[num] == (Object)null || eventListeners[num] == null) { eventListeners[num] = callback; goListeners[num] = caller; if (i >= eventsMaxSearch) { eventsMaxSearch = i + 1; } return; } if ((Object)(object)goListeners[num] == (Object)(object)caller && object.Equals(eventListeners[num], callback)) { return; } } Debug.LogError((object)("You ran out of areas to add listeners, consider increasing LISTENERS_MAX, ex: LeanTween.LISTENERS_MAX = " + LISTENERS_MAX * 2)); } public static bool removeListener(int eventId, Action callback) { return removeListener(tweenEmpty, eventId, callback); } public static bool removeListener(int eventId) { int num = eventId * INIT_LISTENERS_MAX + i; eventListeners[num] = null; goListeners[num] = null; return true; } public static bool removeListener(GameObject caller, int eventId, Action callback) { for (i = 0; i < eventsMaxSearch; i++) { int num = eventId * INIT_LISTENERS_MAX + i; if ((Object)(object)goListeners[num] == (Object)(object)caller && object.Equals(eventListeners[num], callback)) { eventListeners[num] = null; goListeners[num] = null; return true; } } return false; } public static void dispatchEvent(int eventId) { dispatchEvent(eventId, null); } public static void dispatchEvent(int eventId, object data) { for (int i = 0; i < eventsMaxSearch; i++) { int num = eventId * INIT_LISTENERS_MAX + i; if (eventListeners[num] != null) { if (Object.op_Implicit((Object)(object)goListeners[num])) { eventListeners[num](new LTEvent(eventId, data)); } else { eventListeners[num] = null; } } } } } public class LTUtility { public static Vector3[] reverse(Vector3[] arr) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) int num = arr.Length; int num2 = 0; int num3 = num - 1; while (num2 < num3) { Vector3 val = arr[num2]; arr[num2] = arr[num3]; arr[num3] = val; num2++; num3--; } return arr; } } public class LTBezier { public float length; private Vector3 a; private Vector3 aa; private Vector3 bb; private Vector3 cc; private float len; private float[] arcLengths; public LTBezier(Vector3 a, Vector3 b, Vector3 c, Vector3 d, float precision) { //IL_0007: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0020: 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) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0058: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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) this.a = a; aa = -a + 3f * (b - c) + d; bb = 3f * (a + c) - 6f * b; cc = 3f * (b - a); len = 1f / precision; arcLengths = new float[(int)len + 1]; arcLengths[0] = 0f; Vector3 val = a; float num = 0f; for (int i = 1; (float)i <= len; i++) { Vector3 val2 = bezierPoint((float)i * precision); float num2 = num; Vector3 val3 = val - val2; num = num2 + ((Vector3)(ref val3)).magnitude; arcLengths[i] = num; val = val2; } length = num; } private float map(float u) { float num = u * arcLengths[(int)len]; int num2 = 0; int num3 = (int)len; int num4 = 0; while (num2 < num3) { num4 = num2 + ((int)((float)(num3 - num2) / 2f) | 0); if (arcLengths[num4] < num) { num2 = num4 + 1; } else { num3 = num4; } } if (arcLengths[num4] > num) { num4--; } if (num4 < 0) { num4 = 0; } return ((float)num4 + (num - arcLengths[num4]) / (arcLengths[num4 + 1] - arcLengths[num4])) / len; } private Vector3 bezierPoint(float t) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) return ((aa * t + bb) * t + cc) * t + a; } public Vector3 point(float t) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) return bezierPoint(map(t)); } } public class LTBezierPath { public Vector3[] pts; public float length; public bool orientToPath; public bool orientToPath2d; private LTBezier[] beziers; private float[] lengthRatio; private int currentBezier; private int previousBezier; public float distance => length; public LTBezierPath() { } public LTBezierPath(Vector3[] pts_) { setPoints(pts_); } public void setPoints(Vector3[] pts_) { //IL_0071: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (pts_.Length < 4) { LeanTween.logError("LeanTween - When passing values for a vector path, you must pass four or more values!"); } if (pts_.Length % 4 != 0) { LeanTween.logError("LeanTween - When passing values for a vector path, they must be in sets of four: controlPoint1, controlPoint2, endPoint2, controlPoint2, controlPoint2..."); } pts = pts_; int num = 0; beziers = new LTBezier[pts.Length / 4]; lengthRatio = new float[beziers.Length]; length = 0f; for (int i = 0; i < pts.Length; i += 4) { beziers[num] = new LTBezier(pts[i], pts[i + 2], pts[i + 1], pts[i + 3], 0.05f); length += beziers[num].length; num++; } for (int i = 0; i < beziers.Length; i++) { lengthRatio[i] = beziers[i].length / length; } } public Vector3 point(float ratio) { //IL_0061: 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) float num = 0f; for (int i = 0; i < lengthRatio.Length; i++) { num += lengthRatio[i]; if (num >= ratio) { return beziers[i].point((ratio - (num - lengthRatio[i])) / lengthRatio[i]); } } return beziers[lengthRatio.Length - 1].point(1f); } public void place2d(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0037: 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) transform.position = point(ratio); ratio += 0.001f; if (ratio <= 1f) { Vector3 val = point(ratio) - transform.position; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; transform.eulerAngles = new Vector3(0f, 0f, num); } } public void placeLocal2d(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0037: 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) transform.localPosition = point(ratio); ratio += 0.001f; if (ratio <= 1f) { Vector3 val = point(ratio) - transform.localPosition; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; transform.localEulerAngles = new Vector3(0f, 0f, num); } } public void place(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) place(transform, ratio, Vector3.up); } public void place(Transform transform, float ratio, Vector3 worldUp) { //IL_0003: 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) transform.position = point(ratio); ratio += 0.001f; if (ratio <= 1f) { transform.LookAt(point(ratio), worldUp); } } public void placeLocal(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) placeLocal(transform, ratio, Vector3.up); } public void placeLocal(Transform transform, float ratio, Vector3 worldUp) { //IL_000c: 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_003b: 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) ratio = getRationInOneRange(ratio); transform.localPosition = point(ratio); ratio = getRationInOneRange(ratio + 0.001f); if (ratio <= 1f) { transform.LookAt(transform.parent.TransformPoint(point(ratio)), worldUp); } } public float getRationInOneRange(float ratio) { if (ratio >= 0f && ratio <= 1f) { return ratio; } if (ratio < 0f) { return Mathf.Ceil(ratio) - ratio; } return ratio - Mathf.Floor(ratio); } public void gizmoDraw(float t = -1f) { //IL_0006: 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_001b: 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_002e: 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_0046: Unknown result type (might be due to invalid IL or missing references) Vector3 val = point(0f); for (int i = 1; i <= 120; i++) { float ratio = (float)i / 120f; Vector3 val2 = point(ratio); Gizmos.color = ((previousBezier == currentBezier) ? Color.magenta : Color.grey); Gizmos.DrawLine(val2, val); val = val2; previousBezier = currentBezier; } } } [Serializable] public class LTSpline { public static int DISTANCE_COUNT = 3; public static int SUBLINE_COUNT = 20; public float distance; public bool constantSpeed = true; public Vector3[] pts; [NonSerialized] public Vector3[] ptsAdj; public int ptsAdjLength; public bool orientToPath; public bool orientToPath2d; private int numSections; private int currPt; public LTSpline(Vector3[] pts) { init(pts, constantSpeed: true); } public LTSpline(Vector3[] pts, bool constantSpeed) { this.constantSpeed = constantSpeed; init(pts, constantSpeed); } private void init(Vector3[] pts, bool constantSpeed) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00e7: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if (pts.Length < 4) { LeanTween.logError("LeanTween - When passing values for a spline path, you must pass four or more values!"); return; } this.pts = (Vector3[])(object)new Vector3[pts.Length]; Array.Copy(pts, this.pts, pts.Length); numSections = pts.Length - 3; float num = float.PositiveInfinity; Vector3 val = this.pts[1]; float num2 = 0f; for (int i = 1; i < this.pts.Length - 1; i++) { float num3 = Vector3.Distance(this.pts[i], val); if (num3 < num) { num = num3; } num2 += num3; } if (!constantSpeed) { return; } num = num2 / (float)(numSections * SUBLINE_COUNT); float num4 = num / (float)SUBLINE_COUNT; int num5 = (int)Mathf.Ceil(num2 / num4) * DISTANCE_COUNT; if (num5 <= 1) { num5 = 2; } ptsAdj = (Vector3[])(object)new Vector3[num5]; val = interp(0f); int num6 = 1; ptsAdj[0] = val; distance = 0f; for (int j = 0; j < num5 + 1; j++) { float num7 = (float)j / (float)num5; Vector3 val2 = interp(num7); float num8 = Vector3.Distance(val2, val); if (num8 >= num4 || num7 >= 1f) { ptsAdj[num6] = val2; distance += num8; val = val2; num6++; } } ptsAdjLength = num6; } public Vector3 map(float u) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0060: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (u >= 1f) { return pts[pts.Length - 2]; } float num = u * (float)(ptsAdjLength - 1); int num2 = (int)Mathf.Floor(num); int num3 = (int)Mathf.Ceil(num); if (num2 < 0) { num2 = 0; } Vector3 val = ptsAdj[num2]; Vector3 val2 = ptsAdj[num3]; float num4 = num - (float)num2; return val + (val2 - val) * num4; } public Vector3 interp(float t) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) currPt = Mathf.Min(Mathf.FloorToInt(t * (float)numSections), numSections - 1); float num = t * (float)numSections - (float)currPt; Vector3 val = pts[currPt]; Vector3 val2 = pts[currPt + 1]; Vector3 val3 = pts[currPt + 2]; Vector3 val4 = pts[currPt + 3]; return 0.5f * ((-val + 3f * val2 - 3f * val3 + val4) * (num * num * num) + (2f * val - 5f * val2 + 4f * val3 - val4) * (num * num) + (-val + val3) * num + 2f * val2); } public float ratioAtPoint(Vector3 pt) { //IL_000c: 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) float num = float.MaxValue; int num2 = 0; for (int i = 0; i < ptsAdjLength; i++) { float num3 = Vector3.Distance(pt, ptsAdj[i]); if (num3 < num) { num = num3; num2 = i; } } return (float)num2 / (float)(ptsAdjLength - 1); } public Vector3 point(float ratio) { //IL_0023: 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) float num = ((ratio > 1f) ? 1f : ratio); if (!constantSpeed) { return interp(num); } return map(num); } public void place2d(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0037: 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) transform.position = point(ratio); ratio += 0.001f; if (ratio <= 1f) { Vector3 val = point(ratio) - transform.position; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; transform.eulerAngles = new Vector3(0f, 0f, num); } } public void placeLocal2d(Transform transform, float ratio) { //IL_001a: 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_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_0048: 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_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform.parent == (Object)null) { place2d(transform, ratio); return; } transform.localPosition = point(ratio); ratio += 0.001f; if (ratio <= 1f) { Vector3 val = point(ratio) - transform.localPosition; float num = Mathf.Atan2(val.y, val.x) * 57.29578f; transform.localEulerAngles = new Vector3(0f, 0f, num); } } public void place(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) place(transform, ratio, Vector3.up); } public void place(Transform transform, float ratio, Vector3 worldUp) { //IL_0003: 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) transform.position = point(ratio); ratio += 0.001f; if (ratio <= 1f) { transform.LookAt(point(ratio), worldUp); } } public void placeLocal(Transform transform, float ratio) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) placeLocal(transform, ratio, Vector3.up); } public void placeLocal(Transform transform, float ratio, Vector3 worldUp) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) transform.localPosition = point(ratio); ratio += 0.001f; if (ratio <= 1f) { transform.LookAt(transform.parent.TransformPoint(point(ratio)), worldUp); } } public void gizmoDraw(float t = -1f) { //IL_0019: 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_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_0030: 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_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) if (ptsAdj != null && ptsAdj.Length != 0) { Vector3 val = ptsAdj[0]; for (int i = 0; i < ptsAdjLength; i++) { Vector3 val2 = ptsAdj[i]; Gizmos.DrawLine(val, val2); val = val2; } } } public void drawGizmo(Color color) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0034: 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_003b: 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) if (ptsAdjLength >= 4) { Vector3 val = ptsAdj[0]; Color color2 = Gizmos.color; Gizmos.color = color; for (int i = 0; i < ptsAdjLength; i++) { Vector3 val2 = ptsAdj[i]; Gizmos.DrawLine(val, val2); val = val2; } Gizmos.color = color2; } } public static void drawGizmo(Transform[] arr, Color color) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_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_004f: 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_0067: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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) if (arr.Length >= 4) { Vector3[] array = (Vector3[])(object)new Vector3[arr.Length]; for (int i = 0; i < arr.Length; i++) { array[i] = arr[i].position; } LTSpline lTSpline = new LTSpline(array); Vector3 val = lTSpline.ptsAdj[0]; Color color2 = Gizmos.color; Gizmos.color = color; for (int j = 0; j < lTSpline.ptsAdjLength; j++) { Vector3 val2 = lTSpline.ptsAdj[j]; Gizmos.DrawLine(val, val2); val = val2; } Gizmos.color = color2; } } public static void drawLine(Transform[] arr, float width, Color color) { _ = arr.Length; _ = 4; } public void drawLinesGLLines(Material outlineMaterial, Color color, float width) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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) //IL_00c0: 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_0055: 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) GL.PushMatrix(); outlineMaterial.SetPass(0); GL.LoadPixelMatrix(); GL.Begin(1); GL.Color(color); if (constantSpeed) { if (ptsAdjLength >= 4) { Vector3 val = ptsAdj[0]; for (int i = 0; i < ptsAdjLength; i++) { Vector3 val2 = ptsAdj[i]; GL.Vertex(val); GL.Vertex(val2); val = val2; } } } else if (pts.Length >= 4) { Vector3 val3 = pts[0]; float num = 1f / ((float)pts.Length * 10f); for (float num2 = 0f; num2 < 1f; num2 += num) { float t = num2 / 1f; Vector3 val4 = interp(t); GL.Vertex(val3); GL.Vertex(val4); val3 = val4; } } GL.End(); GL.PopMatrix(); } public Vector3[] generateVectors() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0057: Unknown result type (might be due to invalid IL or missing references) if (pts.Length >= 4) { List list = new List(); Vector3 item = pts[0]; list.Add(item); float num = 1f / ((float)pts.Length * 10f); for (float num2 = 0f; num2 < 1f; num2 += num) { float t = num2 / 1f; Vector3 item2 = interp(t); list.Add(item2); } list.ToArray(); } return null; } } [Serializable] public class LTRect { public Rect _rect; public float alpha = 1f; public float rotation; public Vector2 pivot; public Vector2 margin; public Rect relativeRect = new Rect(0f, 0f, float.PositiveInfinity, float.PositiveInfinity); public bool rotateEnabled; [HideInInspector] public bool rotateFinished; public bool alphaEnabled; public string labelStr; public LTGUI.Element_Type type; public GUIStyle style; public bool useColor; public Color color = Color.white; public bool fontScaleToFit; public bool useSimpleScale; public bool sizeByHeight; public Texture texture; private int _id = -1; [HideInInspector] public int counter; public static bool colorTouched; public bool hasInitiliazed => _id != -1; public int id => _id | (counter << 16); public float x { get { return ((Rect)(ref _rect)).x; } set { ((Rect)(ref _rect)).x = value; } } public float y { get { return ((Rect)(ref _rect)).y; } set { ((Rect)(ref _rect)).y = value; } } public float width { get { return ((Rect)(ref _rect)).width; } set { ((Rect)(ref _rect)).width = value; } } public float height { get { return ((Rect)(ref _rect)).height; } set { ((Rect)(ref _rect)).height = value; } } public Rect rect { get { //IL_000d: 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_0021: 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_007e: 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_0092: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) if (colorTouched) { colorTouched = false; GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f); } if (rotateEnabled) { if (rotateFinished) { rotateFinished = false; rotateEnabled = false; pivot = Vector2.zero; } else { GUIUtility.RotateAroundPivot(rotation, pivot); } } if (alphaEnabled) { GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, alpha); colorTouched = true; } if (fontScaleToFit) { if (useSimpleScale) { style.fontSize = (int)(((Rect)(ref _rect)).height * ((Rect)(ref relativeRect)).height); } else { style.fontSize = (int)((Rect)(ref _rect)).height; } } return _rect; } set { //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) _rect = value; } } public LTRect() { //IL_0020: 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) //IL_002b: 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_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) reset(); rotateEnabled = (alphaEnabled = true); _rect = new Rect(0f, 0f, 1f, 1f); } public LTRect(Rect rect) { //IL_0020: 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) //IL_002b: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) _rect = rect; reset(); } public LTRect(float x, float y, float width, float height) { //IL_0020: 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) //IL_002b: 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_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) _rect = new Rect(x, y, width, height); alpha = 1f; rotation = 0f; rotateEnabled = (alphaEnabled = false); } public LTRect(float x, float y, float width, float height, float alpha) { //IL_0020: 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) //IL_002b: 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_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) _rect = new Rect(x, y, width, height); this.alpha = alpha; rotation = 0f; rotateEnabled = (alphaEnabled = false); } public LTRect(float x, float y, float width, float height, float alpha, float rotation) { //IL_0020: 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) //IL_002b: 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_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) _rect = new Rect(x, y, width, height); this.alpha = alpha; this.rotation = rotation; rotateEnabled = (alphaEnabled = false); if (rotation != 0f) { rotateEnabled = true; resetForRotation(); } } public void setId(int id, int counter) { _id = id; this.counter = counter; } public void reset() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) alpha = 1f; rotation = 0f; rotateEnabled = (alphaEnabled = false); margin = Vector2.zero; sizeByHeight = false; useColor = false; } public void resetForRotation() { //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_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_0020: 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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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) Matrix4x4 matrix = GUI.matrix; float num = ((Matrix4x4)(ref matrix))[0, 0]; matrix = GUI.matrix; float num2 = ((Matrix4x4)(ref matrix))[1, 1]; matrix = GUI.matrix; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num, num2, ((Matrix4x4)(ref matrix))[2, 2]); if (pivot == Vector2.zero) { float num3 = (((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width * 0.5f) * val.x; matrix = GUI.matrix; float num4 = num3 + ((Matrix4x4)(ref matrix))[0, 3]; float num5 = (((Rect)(ref _rect)).y + ((Rect)(ref _rect)).height * 0.5f) * val.y; matrix = GUI.matrix; pivot = new Vector2(num4, num5 + ((Matrix4x4)(ref matrix))[1, 3]); } } public LTRect setStyle(GUIStyle style) { this.style = style; return this; } public LTRect setFontScaleToFit(bool fontScaleToFit) { this.fontScaleToFit = fontScaleToFit; return this; } public LTRect setColor(Color color) { //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) this.color = color; useColor = true; return this; } public LTRect setAlpha(float alpha) { this.alpha = alpha; return this; } public LTRect setLabel(string str) { labelStr = str; return this; } public LTRect setUseSimpleScale(bool useSimpleScale, Rect relativeRect) { //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) this.useSimpleScale = useSimpleScale; this.relativeRect = relativeRect; return this; } public LTRect setUseSimpleScale(bool useSimpleScale) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) this.useSimpleScale = useSimpleScale; relativeRect = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height); return this; } public LTRect setSizeByHeight(bool sizeByHeight) { this.sizeByHeight = sizeByHeight; return this; } public override string ToString() { return "x:" + ((Rect)(ref _rect)).x + " y:" + ((Rect)(ref _rect)).y + " width:" + ((Rect)(ref _rect)).width + " height:" + ((Rect)(ref _rect)).height; } } public class LTEvent { public int id; public object data; public LTEvent(int id, object data) { this.id = id; this.data = data; } } public class LTGUI { public enum Element_Type { Texture, Label } public static int RECT_LEVELS = 5; public static int RECTS_PER_LEVEL = 10; public static int BUTTONS_MAX = 24; private static LTRect[] levels; private static int[] levelDepths; private static Rect[] buttons; private static int[] buttonLevels; private static int[] buttonLastFrame; private static LTRect r; private static Color color = Color.white; private static bool isGUIEnabled = false; private static int global_counter = 0; public static void init() { if (levels == null) { levels = new LTRect[RECT_LEVELS * RECTS_PER_LEVEL]; levelDepths = new int[RECT_LEVELS]; } } public static void initRectCheck() { if (buttons == null) { buttons = (Rect[])(object)new Rect[BUTTONS_MAX]; buttonLevels = new int[BUTTONS_MAX]; buttonLastFrame = new int[BUTTONS_MAX]; for (int i = 0; i < buttonLevels.Length; i++) { buttonLevels[i] = -1; } } } public static void reset() { if (isGUIEnabled) { isGUIEnabled = false; for (int i = 0; i < levels.Length; i++) { levels[i] = null; } for (int j = 0; j < levelDepths.Length; j++) { levelDepths[j] = 0; } } } public static void update(int updateLevel) { //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_03f6: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: 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) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) if (!isGUIEnabled) { return; } init(); if (levelDepths[updateLevel] <= 0) { return; } color = GUI.color; int num = updateLevel * RECTS_PER_LEVEL; int num2 = num + levelDepths[updateLevel]; for (int i = num; i < num2; i++) { r = levels[i]; if (r == null) { continue; } if (r.useColor) { GUI.color = r.color; } Rect rect; if (r.type == Element_Type.Label) { if (r.style != null) { GUI.skin.label = r.style; } if (r.useSimpleScale) { rect = r.rect; float num3 = (((Rect)(ref rect)).x + r.margin.x + ((Rect)(ref r.relativeRect)).x) * ((Rect)(ref r.relativeRect)).width; rect = r.rect; float num4 = (((Rect)(ref rect)).y + r.margin.y + ((Rect)(ref r.relativeRect)).y) * ((Rect)(ref r.relativeRect)).height; rect = r.rect; float num5 = ((Rect)(ref rect)).width * ((Rect)(ref r.relativeRect)).width; rect = r.rect; GUI.Label(new Rect(num3, num4, num5, ((Rect)(ref rect)).height * ((Rect)(ref r.relativeRect)).height), r.labelStr); } else { rect = r.rect; float num6 = ((Rect)(ref rect)).x + r.margin.x; rect = r.rect; float num7 = ((Rect)(ref rect)).y + r.margin.y; rect = r.rect; float width = ((Rect)(ref rect)).width; rect = r.rect; GUI.Label(new Rect(num6, num7, width, ((Rect)(ref rect)).height), r.labelStr); } } else if (r.type == Element_Type.Texture && (Object)(object)r.texture != (Object)null) { Vector2 val; if (!r.useSimpleScale) { rect = r.rect; float width2 = ((Rect)(ref rect)).width; rect = r.rect; val = new Vector2(width2, ((Rect)(ref rect)).height); } else { rect = r.rect; val = new Vector2(0f, ((Rect)(ref rect)).height * ((Rect)(ref r.relativeRect)).height); } Vector2 val2 = val; if (r.sizeByHeight) { val2.x = (float)r.texture.width / (float)r.texture.height * val2.y; } if (r.useSimpleScale) { rect = r.rect; float num8 = (((Rect)(ref rect)).x + r.margin.x + ((Rect)(ref r.relativeRect)).x) * ((Rect)(ref r.relativeRect)).width; rect = r.rect; GUI.DrawTexture(new Rect(num8, (((Rect)(ref rect)).y + r.margin.y + ((Rect)(ref r.relativeRect)).y) * ((Rect)(ref r.relativeRect)).height, val2.x, val2.y), r.texture); } else { rect = r.rect; float num9 = ((Rect)(ref rect)).x + r.margin.x; rect = r.rect; GUI.DrawTexture(new Rect(num9, ((Rect)(ref rect)).y + r.margin.y, val2.x, val2.y), r.texture); } } } GUI.color = color; } public static bool checkOnScreen(Rect rect) { bool num = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width < 0f; bool flag = ((Rect)(ref rect)).x > (float)Screen.width; bool flag2 = ((Rect)(ref rect)).y > (float)Screen.height; bool flag3 = ((Rect)(ref rect)).y + ((Rect)(ref rect)).height < 0f; return !(num || flag || flag2 || flag3); } public static void destroy(int id) { int num = id & 0xFFFF; int num2 = id >> 16; if (id >= 0 && levels[num] != null && levels[num].hasInitiliazed && levels[num].counter == num2) { levels[num] = null; } } public static void destroyAll(int depth) { int num = depth * RECTS_PER_LEVEL + RECTS_PER_LEVEL; int num2 = depth * RECTS_PER_LEVEL; while (levels != null && num2 < num) { levels[num2] = null; num2++; } } public static LTRect label(Rect rect, string label, int depth) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return LTGUI.label(new LTRect(rect), label, depth); } public static LTRect label(LTRect rect, string label, int depth) { rect.type = Element_Type.Label; rect.labelStr = label; return element(rect, depth); } public static LTRect texture(Rect rect, Texture texture, int depth) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return LTGUI.texture(new LTRect(rect), texture, depth); } public static LTRect texture(LTRect rect, Texture texture, int depth) { rect.type = Element_Type.Texture; rect.texture = texture; return element(rect, depth); } public static LTRect element(LTRect rect, int depth) { //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_0045: Unknown result type (might be due to invalid IL or missing references) isGUIEnabled = true; init(); int num = depth * RECTS_PER_LEVEL + RECTS_PER_LEVEL; int num2 = 0; if (rect != null) { destroy(rect.id); } if (rect.type == Element_Type.Label && rect.style != null && rect.style.normal.textColor.a <= 0f) { Debug.LogWarning((object)"Your GUI normal color has an alpha of zero, and will not be rendered."); } if (((Rect)(ref rect.relativeRect)).width == float.PositiveInfinity) { rect.relativeRect = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height); } for (int i = depth * RECTS_PER_LEVEL; i < num; i++) { r = levels[i]; if (r == null) { r = rect; r.rotateEnabled = true; r.alphaEnabled = true; r.setId(i, global_counter); levels[i] = r; if (num2 >= levelDepths[depth]) { levelDepths[depth] = num2 + 1; } global_counter++; return r; } num2++; } Debug.LogError((object)"You ran out of GUI Element spaces"); return null; } public static bool hasNoOverlap(Rect rect, int depth) { //IL_006c: 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_0041: Unknown result type (might be due to invalid IL or missing references) initRectCheck(); bool result = true; bool flag = false; for (int i = 0; i < buttonLevels.Length; i++) { if (buttonLevels[i] >= 0) { if (buttonLastFrame[i] + 1 < Time.frameCount) { buttonLevels[i] = -1; } else if (buttonLevels[i] > depth && pressedWithinRect(buttons[i])) { result = false; } } if (!flag && buttonLevels[i] < 0) { flag = true; buttonLevels[i] = depth; buttons[i] = rect; buttonLastFrame[i] = Time.frameCount; } } return result; } public static bool pressedWithinRect(Rect rect) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) Vector2 val = firstTouch(); if (val.x < 0f) { return false; } float num = (float)Screen.height - val.y; if (val.x > ((Rect)(ref rect)).x && val.x < ((Rect)(ref rect)).x + ((Rect)(ref rect)).width && num > ((Rect)(ref rect)).y) { return num < ((Rect)(ref rect)).y + ((Rect)(ref rect)).height; } return false; } public static bool checkWithinRect(Vector2 vec2, Rect rect) { //IL_0008: 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_0023: 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_0049: Unknown result type (might be due to invalid IL or missing references) vec2.y = (float)Screen.height - vec2.y; if (vec2.x > ((Rect)(ref rect)).x && vec2.x < ((Rect)(ref rect)).x + ((Rect)(ref rect)).width && vec2.y > ((Rect)(ref rect)).y) { return vec2.y < ((Rect)(ref rect)).y + ((Rect)(ref rect)).height; } return false; } public static Vector2 firstTouch() { //IL_0013: 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_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) if (Input.touchCount > 0) { return ((Touch)(ref Input.touches[0])).position; } if (Input.GetMouseButton(0)) { return Vector2.op_Implicit(Input.mousePosition); } return new Vector2(float.NegativeInfinity, float.NegativeInfinity); } } public class LTDescr { public delegate Vector3 EaseTypeDelegate(); public delegate void ActionMethodDelegate(); public bool toggle; public bool useEstimatedTime; public bool useFrames; public bool useManualTime; public bool usesNormalDt; public bool hasInitiliazed; public bool hasExtraOnCompletes; public bool hasPhysics; public bool onCompleteOnRepeat; public bool onCompleteOnStart; public bool useRecursion; public float ratioPassed; public float passed; public float delay; public float time; public float speed; public float lastVal; private uint _id; public int loopCount; public uint counter; public float direction; public float directionLast; public float overshoot; public float period; public float scale; public bool destroyOnComplete; public Transform trans; public LTRect ltRect; internal Vector3 fromInternal; internal Vector3 toInternal; internal Vector3 diff; internal Vector3 diffDiv2; public TweenAction type; private LeanTweenType easeType; public LeanTweenType loopType; public bool hasUpdateCallback; public EaseTypeDelegate easeMethod; public SpriteRenderer spriteRen; public RectTransform rectTransform; public Text uiText; public Image uiImage; public RawImage rawImage; public Sprite[] sprites; public LTDescrOptional _optional = new LTDescrOptional(); public static float val; public static float dt; public static Vector3 newVect; public Vector3 from { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return fromInternal; } set { //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) fromInternal = value; } } public Vector3 to { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return toInternal; } set { //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) toInternal = value; } } public ActionMethodDelegate easeInternal { get; set; } public ActionMethodDelegate initInternal { get; set; } public int uniqueId => (int)(_id | (counter << 16)); public int id => uniqueId; public LTDescrOptional optional { get { return _optional; } set { _optional = optional; } } public override string ToString() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) string[] obj = new string[27] { ((Object)(object)trans != (Object)null) ? ("name:" + ((Object)((Component)trans).gameObject).name) : "gameObject:null", " toggle:", toggle.ToString(), " passed:", passed.ToString(), " time:", time.ToString(), " delay:", delay.ToString(), " direction:", direction.ToString(), " from:", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null }; Vector3 val = from; obj[12] = ((object)(Vector3)(ref val)).ToString(); obj[13] = " to:"; val = to; obj[14] = ((object)(Vector3)(ref val)).ToString(); obj[15] = " diff:"; val = diff; obj[16] = ((object)(Vector3)(ref val)).ToString(); obj[17] = " type:"; obj[18] = type.ToString(); obj[19] = " ease:"; obj[20] = easeType.ToString(); obj[21] = " useEstimatedTime:"; obj[22] = useEstimatedTime.ToString(); obj[23] = " id:"; obj[24] = id.ToString(); obj[25] = " hasInitiliazed:"; obj[26] = hasInitiliazed.ToString(); return string.Concat(obj); } [Obsolete("Use 'LeanTween.cancel( id )' instead")] public LTDescr cancel(GameObject gameObject) { if ((Object)(object)gameObject == (Object)(object)((Component)trans).gameObject) { LeanTween.removeTween((int)_id, uniqueId); } return this; } public void reset() { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) toggle = (useRecursion = (usesNormalDt = true)); trans = null; spriteRen = null; passed = (delay = (lastVal = 0f)); hasUpdateCallback = (useEstimatedTime = (useFrames = (hasInitiliazed = (onCompleteOnRepeat = (destroyOnComplete = (onCompleteOnStart = (useManualTime = (hasExtraOnCompletes = false)))))))); easeType = LeanTweenType.linear; loopType = LeanTweenType.once; loopCount = 0; direction = (directionLast = (overshoot = (scale = 1f))); period = 0.3f; speed = -1f; easeMethod = easeLinear; Vector3 val = (to = Vector3.zero); from = val; _optional.reset(); } public LTDescr setMoveX() { type = TweenAction.MOVE_X; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.position.x; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.position = new Vector3(easeMethod().x, trans.position.y, trans.position.z); }; return this; } public LTDescr setMoveY() { type = TweenAction.MOVE_Y; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.position.y; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.position = new Vector3(trans.position.x, easeMethod().x, trans.position.z); }; return this; } public LTDescr setMoveZ() { type = TweenAction.MOVE_Z; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.position.z; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.position = new Vector3(trans.position.x, trans.position.y, easeMethod().x); }; return this; } public LTDescr setMoveLocalX() { type = TweenAction.MOVE_LOCAL_X; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localPosition.x; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localPosition = new Vector3(easeMethod().x, trans.localPosition.y, trans.localPosition.z); }; return this; } public LTDescr setMoveLocalY() { type = TweenAction.MOVE_LOCAL_Y; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localPosition.y; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localPosition = new Vector3(trans.localPosition.x, easeMethod().x, trans.localPosition.z); }; return this; } public LTDescr setMoveLocalZ() { type = TweenAction.MOVE_LOCAL_Z; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localPosition.z; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localPosition = new Vector3(trans.localPosition.x, trans.localPosition.y, easeMethod().x); }; return this; } private void initFromInternal() { fromInternal.x = 0f; } public LTDescr setMoveCurved() { type = TweenAction.MOVE_CURVED; initInternal = initFromInternal; easeInternal = delegate { //IL_0006: 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_0091: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); val = newVect.x; if (_optional.path.orientToPath) { if (_optional.path.orientToPath2d) { _optional.path.place2d(trans, val); } else { _optional.path.place(trans, val); } } else { trans.position = _optional.path.point(val); } }; return this; } public LTDescr setMoveCurvedLocal() { type = TweenAction.MOVE_CURVED_LOCAL; initInternal = initFromInternal; easeInternal = delegate { //IL_0006: 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_0091: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); val = newVect.x; if (_optional.path.orientToPath) { if (_optional.path.orientToPath2d) { _optional.path.placeLocal2d(trans, val); } else { _optional.path.placeLocal(trans, val); } } else { trans.localPosition = _optional.path.point(val); } }; return this; } public LTDescr setMoveSpline() { type = TweenAction.MOVE_SPLINE; initInternal = initFromInternal; easeInternal = delegate { //IL_0006: 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_0091: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); val = newVect.x; if (_optional.spline.orientToPath) { if (_optional.spline.orientToPath2d) { _optional.spline.place2d(trans, val); } else { _optional.spline.place(trans, val); } } else { trans.position = _optional.spline.point(val); } }; return this; } public LTDescr setMoveSplineLocal() { type = TweenAction.MOVE_SPLINE_LOCAL; initInternal = initFromInternal; easeInternal = delegate { //IL_0006: 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_0091: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); val = newVect.x; if (_optional.spline.orientToPath) { if (_optional.spline.orientToPath2d) { _optional.spline.placeLocal2d(trans, val); } else { _optional.spline.placeLocal(trans, val); } } else { trans.localPosition = _optional.spline.point(val); } }; return this; } public LTDescr setScaleX() { type = TweenAction.SCALE_X; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localScale.x; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localScale = new Vector3(easeMethod().x, trans.localScale.y, trans.localScale.z); }; return this; } public LTDescr setScaleY() { type = TweenAction.SCALE_Y; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localScale.y; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localScale = new Vector3(trans.localScale.x, easeMethod().x, trans.localScale.z); }; return this; } public LTDescr setScaleZ() { type = TweenAction.SCALE_Z; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.localScale.z; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.localScale = new Vector3(trans.localScale.x, trans.localScale.y, easeMethod().x); }; return this; } public LTDescr setRotateX() { type = TweenAction.ROTATE_X; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.eulerAngles.x; toInternal.x = LeanTween.closestRot(fromInternal.x, toInternal.x); }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.eulerAngles = new Vector3(easeMethod().x, trans.eulerAngles.y, trans.eulerAngles.z); }; return this; } public LTDescr setRotateY() { type = TweenAction.ROTATE_Y; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.eulerAngles.y; toInternal.x = LeanTween.closestRot(fromInternal.x, toInternal.x); }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.eulerAngles = new Vector3(trans.eulerAngles.x, easeMethod().x, trans.eulerAngles.z); }; return this; } public LTDescr setRotateZ() { type = TweenAction.ROTATE_Z; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = trans.eulerAngles.z; toInternal.x = LeanTween.closestRot(fromInternal.x, toInternal.x); }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) trans.eulerAngles = new Vector3(trans.eulerAngles.x, trans.eulerAngles.y, easeMethod().x); }; return this; } public LTDescr setRotateAround() { type = TweenAction.ROTATE_AROUND; initInternal = delegate { //IL_001c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = 0f; _optional.origRotation = trans.rotation; }; easeInternal = delegate { //IL_0006: 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_0025: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Vector3 localPosition = trans.localPosition; Vector3 val = trans.TransformPoint(_optional.point); trans.RotateAround(val, _optional.axis, 0f - _optional.lastVal); Vector3 val2 = localPosition - trans.localPosition; trans.localPosition = localPosition - val2; trans.rotation = _optional.origRotation; val = trans.TransformPoint(_optional.point); trans.RotateAround(val, _optional.axis, LTDescr.val); _optional.lastVal = LTDescr.val; }; return this; } public LTDescr setRotateAroundLocal() { type = TweenAction.ROTATE_AROUND_LOCAL; initInternal = delegate { //IL_001c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = 0f; _optional.origRotation = trans.localRotation; }; easeInternal = delegate { //IL_0006: 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_0025: 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_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0087: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Vector3 localPosition = trans.localPosition; trans.RotateAround(trans.TransformPoint(_optional.point), trans.TransformDirection(_optional.axis), 0f - _optional.lastVal); Vector3 val = localPosition - trans.localPosition; trans.localPosition = localPosition - val; trans.localRotation = _optional.origRotation; Vector3 val2 = trans.TransformPoint(_optional.point); trans.RotateAround(val2, trans.TransformDirection(_optional.axis), LTDescr.val); _optional.lastVal = LTDescr.val; }; return this; } public LTDescr setAlpha() { type = TweenAction.ALPHA; initInternal = delegate { //IL_001c: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) SpriteRenderer component = ((Component)trans).GetComponent(); if ((Object)(object)component != (Object)null) { fromInternal.x = component.color.a; } else if ((Object)(object)((Component)trans).GetComponent() != (Object)null && ((Component)trans).GetComponent().material.HasProperty("_Color")) { fromInternal.x = ((Component)trans).GetComponent().material.color.a; } else if ((Object)(object)((Component)trans).GetComponent() != (Object)null && ((Component)trans).GetComponent().material.HasProperty("_TintColor")) { Color color = ((Component)trans).GetComponent().material.GetColor("_TintColor"); fromInternal.x = color.a; } else if (trans.childCount > 0) { foreach (Transform tran in trans) { Transform val = tran; if ((Object)(object)((Component)val).gameObject.GetComponent() != (Object)null) { Color color2 = ((Component)val).gameObject.GetComponent().material.color; fromInternal.x = color2.a; break; } } } easeInternal = delegate { //IL_0006: 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_003f: 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_005e: Unknown result type (might be due to invalid IL or missing references) LTDescr.val = easeMethod().x; if ((Object)(object)spriteRen != (Object)null) { spriteRen.color = new Color(spriteRen.color.r, spriteRen.color.g, spriteRen.color.b, LTDescr.val); alphaRecursiveSprite(trans, LTDescr.val); } else { alphaRecursive(trans, LTDescr.val, useRecursion); } }; }; easeInternal = delegate { //IL_0006: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) newVect = easeMethod(); val = newVect.x; if ((Object)(object)spriteRen != (Object)null) { spriteRen.color = new Color(spriteRen.color.r, spriteRen.color.g, spriteRen.color.b, val); alphaRecursiveSprite(trans, val); } else { alphaRecursive(trans, val, useRecursion); } }; return this; } public LTDescr setTextAlpha() { type = TweenAction.TEXT_ALPHA; initInternal = delegate { //IL_0032: Unknown result type (might be due to invalid IL or missing references) uiText = ((Component)trans).GetComponent(); fromInternal.x = (((Object)(object)uiText != (Object)null) ? ((Graphic)uiText).color.a : 1f); }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) textAlphaRecursive(trans, easeMethod().x, useRecursion); }; return this; } public LTDescr setAlphaVertex() { type = TweenAction.ALPHA_VERTEX; initInternal = delegate { fromInternal.x = (int)((Component)trans).GetComponent().mesh.colors32[0].a; }; easeInternal = delegate { //IL_0006: 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_0093: 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_0099: 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_00a7: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Mesh mesh = ((Component)trans).GetComponent().mesh; Vector3[] vertices = mesh.vertices; Color32[] array = (Color32[])(object)new Color32[vertices.Length]; if (array.Length == 0) { Color32 val = default(Color32); ((Color32)(ref val))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)0); array = (Color32[])(object)new Color32[mesh.vertices.Length]; for (int i = 0; i < array.Length; i++) { array[i] = val; } mesh.colors32 = array; } Color32 val2 = mesh.colors32[0]; val2 = Color32.op_Implicit(new Color((float)(int)val2.r, (float)(int)val2.g, (float)(int)val2.b, LTDescr.val)); for (int j = 0; j < vertices.Length; j++) { array[j] = val2; } mesh.colors32 = array; }; return this; } public LTDescr setColor() { type = TweenAction.COLOR; initInternal = delegate { //IL_0017: 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_0067: 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_00b5: 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) //IL_00bc: 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_00ed: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) SpriteRenderer component = ((Component)trans).GetComponent(); if ((Object)(object)component != (Object)null) { setFromColor(component.color); } else if ((Object)(object)((Component)trans).GetComponent() != (Object)null && ((Component)trans).GetComponent().material.HasProperty("_Color")) { Color color = ((Component)trans).GetComponent().material.color; setFromColor(color); } else if ((Object)(object)((Component)trans).GetComponent() != (Object)null && ((Component)trans).GetComponent().material.HasProperty("_TintColor")) { Color color2 = ((Component)trans).GetComponent().material.GetColor("_TintColor"); setFromColor(color2); } else if (trans.childCount > 0) { foreach (Transform tran in trans) { Transform val2 = tran; if ((Object)(object)((Component)val2).gameObject.GetComponent() != (Object)null) { Color color3 = ((Component)val2).gameObject.GetComponent().material.color; setFromColor(color3); break; } } } }; easeInternal = delegate { //IL_0006: 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_0025: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Color val = tweenColor(this, LTDescr.val); if ((Object)(object)spriteRen != (Object)null) { spriteRen.color = val; colorRecursiveSprite(trans, val); } else if (type == TweenAction.COLOR) { colorRecursive(trans, val, useRecursion); } if (dt != 0f && _optional.onUpdateColor != null) { _optional.onUpdateColor(val); } else if (dt != 0f && _optional.onUpdateColorObject != null) { _optional.onUpdateColorObject(val, _optional.onUpdateParam); } }; return this; } public LTDescr setCallbackColor() { type = TweenAction.CALLBACK_COLOR; initInternal = delegate { //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) diff = new Vector3(1f, 0f, 0f); }; easeInternal = delegate { //IL_0006: 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_0025: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Color val = tweenColor(this, LTDescr.val); if ((Object)(object)spriteRen != (Object)null) { spriteRen.color = val; colorRecursiveSprite(trans, val); } else if (type == TweenAction.COLOR) { colorRecursive(trans, val, useRecursion); } if (dt != 0f && _optional.onUpdateColor != null) { _optional.onUpdateColor(val); } else if (dt != 0f && _optional.onUpdateColorObject != null) { _optional.onUpdateColorObject(val, _optional.onUpdateParam); } }; return this; } public LTDescr setTextColor() { type = TweenAction.TEXT_COLOR; initInternal = delegate { //IL_002d: 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) uiText = ((Component)trans).GetComponent(); setFromColor(((Object)(object)uiText != (Object)null) ? ((Graphic)uiText).color : Color.white); }; easeInternal = delegate { //IL_0006: 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_0025: 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_0031: 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_007d: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; Color val = tweenColor(this, LTDescr.val); ((Graphic)uiText).color = val; if (dt != 0f && _optional.onUpdateColor != null) { _optional.onUpdateColor(val); } if (useRecursion && trans.childCount > 0) { textColorRecursive(trans, val); } }; return this; } public LTDescr setCanvasAlpha() { type = TweenAction.CANVAS_ALPHA; initInternal = delegate { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) uiImage = ((Component)trans).GetComponent(); if ((Object)(object)uiImage != (Object)null) { fromInternal.x = ((Graphic)uiImage).color.a; } else { rawImage = ((Component)trans).GetComponent(); if ((Object)(object)rawImage != (Object)null) { fromInternal.x = ((Graphic)rawImage).color.a; } else { fromInternal.x = 1f; } } }; easeInternal = delegate { //IL_0006: 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_0033: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) newVect = easeMethod(); val = newVect.x; if ((Object)(object)uiImage != (Object)null) { Color color = ((Graphic)uiImage).color; color.a = val; ((Graphic)uiImage).color = color; } else if ((Object)(object)rawImage != (Object)null) { Color color2 = ((Graphic)rawImage).color; color2.a = val; ((Graphic)rawImage).color = color2; } if (useRecursion) { alphaRecursive(rectTransform, val); textAlphaChildrenRecursive((Transform)(object)rectTransform, val); } }; return this; } public LTDescr setCanvasGroupAlpha() { type = TweenAction.CANVASGROUP_ALPHA; initInternal = delegate { fromInternal.x = ((Component)trans).GetComponent().alpha; }; easeInternal = delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) ((Component)trans).GetComponent().alpha = easeMethod().x; }; return this; } public LTDescr setCanvasColor() { type = TweenAction.CANVAS_COLOR; initInternal = delegate { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) uiImage = ((Component)trans).GetComponent(); if ((Object)(object)uiImage == (Object)null) { rawImage = ((Component)trans).GetComponent(); setFromColor(((Object)(object)rawImage != (Object)null) ? ((Graphic)rawImage).color : Color.white); } else { setFromColor(((Graphic)uiImage).color); } }; easeInternal = delegate { //IL_0006: 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_0025: 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_003f: 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_0099: 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) newVect = easeMethod(); LTDescr.val = newVect.x; Color val = tweenColor(this, LTDescr.val); if ((Object)(object)uiImage != (Object)null) { ((Graphic)uiImage).color = val; } else if ((Object)(object)rawImage != (Object)null) { ((Graphic)rawImage).color = val; } if (dt != 0f && _optional.onUpdateColor != null) { _optional.onUpdateColor(val); } if (useRecursion) { colorRecursive(rectTransform, val); } }; return this; } public LTDescr setCanvasMoveX() { type = TweenAction.CANVAS_MOVE_X; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = rectTransform.anchoredPosition3D.x; }; easeInternal = delegate { //IL_0006: 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_0018: 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_0028: 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) Vector3 anchoredPosition3D = rectTransform.anchoredPosition3D; rectTransform.anchoredPosition3D = new Vector3(easeMethod().x, anchoredPosition3D.y, anchoredPosition3D.z); }; return this; } public LTDescr setCanvasMoveY() { type = TweenAction.CANVAS_MOVE_Y; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = rectTransform.anchoredPosition3D.y; }; easeInternal = delegate { //IL_0006: 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_0012: 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_0028: 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) Vector3 anchoredPosition3D = rectTransform.anchoredPosition3D; rectTransform.anchoredPosition3D = new Vector3(anchoredPosition3D.x, easeMethod().x, anchoredPosition3D.z); }; return this; } public LTDescr setCanvasMoveZ() { type = TweenAction.CANVAS_MOVE_Z; initInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal.x = rectTransform.anchoredPosition3D.z; }; easeInternal = delegate { //IL_0006: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 anchoredPosition3D = rectTransform.anchoredPosition3D; rectTransform.anchoredPosition3D = new Vector3(anchoredPosition3D.x, anchoredPosition3D.y, easeMethod().x); }; return this; } private void initCanvasRotateAround() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) lastVal = 0f; fromInternal.x = 0f; _optional.origRotation = ((Transform)rectTransform).rotation; } public LTDescr setCanvasRotateAround() { type = TweenAction.CANVAS_ROTATEAROUND; initInternal = initCanvasRotateAround; easeInternal = delegate { //IL_0006: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0063: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; RectTransform val = rectTransform; Vector3 localPosition = ((Transform)val).localPosition; ((Transform)val).RotateAround(((Transform)val).TransformPoint(_optional.point), _optional.axis, 0f - LTDescr.val); Vector3 val2 = localPosition - ((Transform)val).localPosition; ((Transform)val).localPosition = localPosition - val2; ((Transform)val).rotation = _optional.origRotation; ((Transform)val).RotateAround(((Transform)val).TransformPoint(_optional.point), _optional.axis, LTDescr.val); }; return this; } public LTDescr setCanvasRotateAroundLocal() { type = TweenAction.CANVAS_ROTATEAROUND_LOCAL; initInternal = initCanvasRotateAround; easeInternal = delegate { //IL_0006: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); LTDescr.val = newVect.x; RectTransform val = rectTransform; Vector3 localPosition = ((Transform)val).localPosition; ((Transform)val).RotateAround(((Transform)val).TransformPoint(_optional.point), ((Transform)val).TransformDirection(_optional.axis), 0f - LTDescr.val); Vector3 val2 = localPosition - ((Transform)val).localPosition; ((Transform)val).localPosition = localPosition - val2; ((Transform)val).rotation = _optional.origRotation; ((Transform)val).RotateAround(((Transform)val).TransformPoint(_optional.point), ((Transform)val).TransformDirection(_optional.axis), LTDescr.val); }; return this; } public LTDescr setCanvasPlaySprite() { type = TweenAction.CANVAS_PLAYSPRITE; initInternal = delegate { uiImage = ((Component)trans).GetComponent(); fromInternal.x = 0f; }; easeInternal = delegate { //IL_0006: 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) newVect = easeMethod(); val = newVect.x; int num = (int)Mathf.Round(val); uiImage.sprite = sprites[num]; }; return this; } public LTDescr setCanvasMove() { type = TweenAction.CANVAS_MOVE; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) fromInternal = rectTransform.anchoredPosition3D; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) rectTransform.anchoredPosition3D = easeMethod(); }; return this; } public LTDescr setCanvasScale() { type = TweenAction.CANVAS_SCALE; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) from = ((Transform)rectTransform).localScale; }; easeInternal = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ((Transform)rectTransform).localScale = easeMethod(); }; return this; } public LTDescr setCanvasSizeDelta() { type = TweenAction.CANVAS_SIZEDELTA; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) from = Vector2.op_Implicit(rectTransform.sizeDelta); }; easeInternal = delegate { //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) rectTransform.sizeDelta = Vector2.op_Implicit(easeMethod()); }; return this; } private void callback() { //IL_0006: 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) newVect = easeMethod(); val = newVect.x; } public LTDescr setCallback() { type = TweenAction.CALLBACK; initInternal = delegate { }; easeInternal = callback; return this; } public LTDescr setValue3() { type = TweenAction.VALUE3; initInternal = delegate { }; easeInternal = callback; return this; } public LTDescr setMove() { type = TweenAction.MOVE; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) from = trans.position; }; easeInternal = delegate { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); trans.position = newVect; }; return this; } public LTDescr setMoveLocal() { type = TweenAction.MOVE_LOCAL; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) from = trans.localPosition; }; easeInternal = delegate { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); trans.localPosition = newVect; }; return this; } public LTDescr setMoveToTransform() { type = TweenAction.MOVE_TO_TRANSFORM; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) from = trans.position; }; easeInternal = delegate { //IL_000c: 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_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0059: Unknown result type (might be due to invalid IL or missing references) to = _optional.toTrans.position; diff = to - from; diffDiv2 = diff * 0.5f; newVect = easeMethod(); trans.position = newVect; }; return this; } public LTDescr setRotate() { type = TweenAction.ROTATE; initInternal = delegate { //IL_0007: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) from = trans.eulerAngles; to = new Vector3(LeanTween.closestRot(fromInternal.x, toInternal.x), LeanTween.closestRot(from.y, to.y), LeanTween.closestRot(from.z, to.z)); }; easeInternal = delegate { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); trans.eulerAngles = newVect; }; return this; } public LTDescr setRotateLocal() { type = TweenAction.ROTATE_LOCAL; initInternal = delegate { //IL_0007: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) from = trans.localEulerAngles; to = new Vector3(LeanTween.closestRot(fromInternal.x, toInternal.x), LeanTween.closestRot(from.y, to.y), LeanTween.closestRot(from.z, to.z)); }; easeInternal = delegate { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); trans.localEulerAngles = newVect; }; return this; } public LTDescr setScale() { type = TweenAction.SCALE; initInternal = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) from = trans.localScale; }; easeInternal = delegate { //IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references) newVect = easeMethod(); trans.localScale = newVect; }; return this; } public LTDescr setGUIMove() { type = TweenAction.GUI_MOVE; initInternal = delegate { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Rect rect2 = _optional.ltRect.rect; float x2 = ((Rect)(ref rect2)).x; rect2 = _optional.ltRect.rect; from = new Vector3(x2, ((Rect)(ref rect2)).y, 0f); }; easeInternal = delegate { //IL_0006: 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_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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Vector3 val = easeMethod(); LTRect lTRect = _optional.ltRect; float x = val.x; float y = val.y; Rect rect = _optional.ltRect.rect; float width = ((Rect)(ref rect)).width; rect = _optional.ltRect.rect; lTRect.rect = new Rect(x, y, width, ((Rect)(ref rect)).height); }; return this; } public LTDescr setGUIMoveMargin() { type = TweenAction.GUI_MOVE_MARGIN; initInternal = delegate { //IL_002b: 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) from = Vector2.op_Implicit(new Vector2(_optional.ltRect.margin.x, _optional.ltRect.margin.y)); }; easeInternal = delegate { //IL_0006: 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_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_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) Vector3 val = easeMethod(); _optional.ltRect.margin = new Vector2(val.x, val.y); }; return this; } public LTDescr setGUIScale() { type = TweenAction.GUI_SCALE; initInternal = delegate { //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Rect rect2 = _optional.ltRect.rect; float width = ((Rect)(ref rect2)).width; rect2 = _optional.ltRect.rect; from = new Vector3(width, ((Rect)(ref rect2)).height, 0f); }; easeInternal = delegate { //IL_0006: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_0047: 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_0053: Unknown result type (might be due to invalid IL or missing references) Vector3 val = easeMethod(); LTRect lTRect = _optional.ltRect; Rect rect = _optional.ltRect.rect; float x = ((Rect)(ref rect)).x; rect = _optional.ltRect.rect; lTRect.rect = new Rect(x, ((Rect)(ref rect)).y, val.x, val.y); }; return this; } public LTDescr setGUIAlpha() { type = TweenAction.GUI_ALPHA; initInternal = delegate { fromInternal.x = _optional.ltRect.alpha; }; easeInternal = delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) _optional.ltRect.alpha = easeMethod().x; }; return this; } public LTDescr setGUIRotate() { type = TweenAction.GUI_ROTATE; initInternal = delegate { if (!_optional.ltRect.rotateEnabled) { _optional.ltRect.rotateEnabled = true; _optional.ltRect.resetForRotation(); } fromInternal.x = _optional.ltRect.rotation; }; easeInternal = delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) _optional.ltRect.rotation = easeMethod().x; }; return this; } public LTDescr setDelayedSound() { type = TweenAction.DELAYED_SOUND; initInternal = delegate { hasExtraOnCompletes = true; }; easeInternal = callback; return this; } private void init() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) hasInitiliazed = true; usesNormalDt = !useEstimatedTime && !useManualTime && !useFrames; if (useFrames) { optional.initFrameCount = Time.frameCount; } if (time <= 0f) { time = Mathf.Epsilon; } initInternal(); diff = to - from; diffDiv2 = diff * 0.5f; if (_optional.onStart != null) { _optional.onStart(); } if (onCompleteOnStart) { callOnCompletes(); } if (speed >= 0f) { initSpeed(); } } private void initSpeed() { //IL_0063: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (type == TweenAction.MOVE_CURVED || type == TweenAction.MOVE_CURVED_LOCAL) { time = _optional.path.distance / speed; return; } if (type == TweenAction.MOVE_SPLINE || type == TweenAction.MOVE_SPLINE_LOCAL) { time = _optional.spline.distance / speed; return; } Vector3 val = to - from; time = ((Vector3)(ref val)).magnitude / speed; } public LTDescr updateNow() { updateInternal(); return this; } public bool updateInternal() { float num = direction; if (usesNormalDt) { dt = LeanTween.dtActual; } else if (useEstimatedTime) { dt = LeanTween.dtEstimated; } else if (useFrames) { dt = ((optional.initFrameCount != 0) ? 1 : 0); optional.initFrameCount = Time.frameCount; } else if (useManualTime) { dt = LeanTween.dtManual; } if (delay <= 0f && num != 0f) { if ((Object)(object)trans == (Object)null) { return true; } if (!hasInitiliazed) { init(); } dt *= num; passed += dt; ratioPassed = Mathf.Clamp01(passed / time); easeInternal(); if (hasUpdateCallback) { _optional.callOnUpdate(val, ratioPassed); } if ((num > 0f) ? (passed >= time) : (passed <= 0f)) { loopCount--; if (loopType == LeanTweenType.pingPong) { direction = 0f - num; } else { passed = Mathf.Epsilon; } int num2; if (loopCount != 0) { num2 = ((loopType == LeanTweenType.once) ? 1 : 0); if (num2 == 0 && onCompleteOnRepeat && hasExtraOnCompletes) { callOnCompletes(); } } else { num2 = 1; } return (byte)num2 != 0; } } else { delay -= dt; } return false; } public void callOnCompletes() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if (type == TweenAction.GUI_ROTATE) { _optional.ltRect.rotateFinished = true; } if (type == TweenAction.DELAYED_SOUND) { AudioSource.PlayClipAtPoint((AudioClip)_optional.onCompleteParam, to, from.x); } if (_optional.onComplete != null) { _optional.onComplete(); } else if (_optional.onCompleteObject != null) { _optional.onCompleteObject(_optional.onCompleteParam); } } public LTDescr setFromColor(Color col) { //IL_0006: 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_002b: 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_0041: 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_004d: Unknown result type (might be due to invalid IL or missing references) from = new Vector3(0f, col.a, 0f); diff = new Vector3(1f, 0f, 0f); _optional.axis = new Vector3(col.r, col.g, col.b); return this; } private static void alphaRecursive(Transform transform, float val, bool useRecursion = true) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_005a: 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_007e: 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_008d: 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_009c: 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_00dc: Expected O, but got Unknown Renderer component = ((Component)transform).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Material[] materials = component.materials; foreach (Material val2 in materials) { if (val2.HasProperty("_Color")) { val2.color = new Color(val2.color.r, val2.color.g, val2.color.b, val); } else if (val2.HasProperty("_TintColor")) { Color color = val2.GetColor("_TintColor"); val2.SetColor("_TintColor", new Color(color.r, color.g, color.b, val)); } } } if (!useRecursion || transform.childCount <= 0) { return; } foreach (Transform item in transform) { alphaRecursive(item, val, useRecursion: true); } } private static void colorRecursive(Transform transform, Color toColor, bool useRecursion = true) { //IL_0023: 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_005a: Expected O, but got Unknown Renderer component = ((Component)transform).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Material[] materials = component.materials; for (int i = 0; i < materials.Length; i++) { materials[i].color = toColor; } } if (!useRecursion || transform.childCount <= 0) { return; } foreach (Transform item in transform) { colorRecursive(item, toColor, useRecursion: true); } } private static void alphaRecursive(RectTransform rectTransform, float val, int recursiveLevel = 0) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //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_0041: 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_006a: Unknown result type (might be due to invalid IL or missing references) if (((Transform)rectTransform).childCount <= 0) { return; } foreach (RectTransform item in (Transform)rectTransform) { RectTransform val2 = item; MaskableGraphic component = (MaskableGraphic)(object)((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { Color color = ((Graphic)component).color; color.a = val; ((Graphic)component).color = color; } else { component = (MaskableGraphic)(object)((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null) { Color color2 = ((Graphic)component).color; color2.a = val; ((Graphic)component).color = color2; } } alphaRecursive(val2, val, recursiveLevel + 1); } } private static void alphaRecursiveSprite(Transform transform, float val) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (transform.childCount <= 0) { return; } foreach (Transform item in transform) { SpriteRenderer component = ((Component)item).GetComponent(); if ((Object)(object)component != (Object)null) { component.color = new Color(component.color.r, component.color.g, component.color.b, val); } alphaRecursiveSprite(item, val); } } private static void colorRecursiveSprite(Transform transform, Color toColor) { //IL_0018: 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_003f: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (transform.childCount <= 0) { return; } foreach (Transform item in transform) { SpriteRenderer component = ((Component)transform).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.color = toColor; } colorRecursiveSprite(item, toColor); } } private static void colorRecursive(RectTransform rectTransform, Color toColor) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_002f: 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_0048: Unknown result type (might be due to invalid IL or missing references) if (((Transform)rectTransform).childCount <= 0) { return; } foreach (RectTransform item in (Transform)rectTransform) { RectTransform val = item; MaskableGraphic component = (MaskableGraphic)(object)((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = toColor; } else { component = (MaskableGraphic)(object)((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = toColor; } } colorRecursive(val, toColor); } } private static void textAlphaChildrenRecursive(Transform trans, float val, bool useRecursion = true) { //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_004d: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (!useRecursion || trans.childCount <= 0) { return; } foreach (Transform tran in trans) { Text component = ((Component)tran).GetComponent(); if ((Object)(object)component != (Object)null) { Color color = ((Graphic)component).color; color.a = val; ((Graphic)component).color = color; } textAlphaChildrenRecursive(tran, val); } } private static void textAlphaRecursive(Transform trans, float val, bool useRecursion = true) { //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown Text component = ((Component)trans).GetComponent(); if ((Object)(object)component != (Object)null) { Color color = ((Graphic)component).color; color.a = val; ((Graphic)component).color = color; } if (!useRecursion || trans.childCount <= 0) { return; } foreach (Transform tran in trans) { textAlphaRecursive(tran, val); } } private static void textColorRecursive(Transform trans, Color toColor) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (trans.childCount <= 0) { return; } foreach (Transform tran in trans) { Text component = ((Component)tran).GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = toColor; } textColorRecursive(tran, toColor); } } private static Color tweenColor(LTDescr tween, float val) { //IL_0006: 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_001b: 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_0028: 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_0044: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008e: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = tween._optional.point - tween._optional.axis; float num = tween.to.y - tween.from.y; return new Color(tween._optional.axis.x + val2.x * val, tween._optional.axis.y + val2.y * val, tween._optional.axis.z + val2.z * val, tween.from.y + num * val); } public LTDescr pause() { if (direction != 0f) { directionLast = direction; direction = 0f; } return this; } public LTDescr resume() { direction = directionLast; return this; } public LTDescr setAxis(Vector3 axis) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _optional.axis = axis; return this; } public LTDescr setDelay(float delay) { this.delay = delay; return this; } public LTDescr setEase(LeanTweenType easeType) { switch (easeType) { case LeanTweenType.linear: setEaseLinear(); break; case LeanTweenType.easeOutQuad: setEaseOutQuad(); break; case LeanTweenType.easeInQuad: setEaseInQuad(); break; case LeanTweenType.easeInOutQuad: setEaseInOutQuad(); break; case LeanTweenType.easeInCubic: setEaseInCubic(); break; case LeanTweenType.easeOutCubic: setEaseOutCubic(); break; case LeanTweenType.easeInOutCubic: setEaseInOutCubic(); break; case LeanTweenType.easeInQuart: setEaseInQuart(); break; case LeanTweenType.easeOutQuart: setEaseOutQuart(); break; case LeanTweenType.easeInOutQuart: setEaseInOutQuart(); break; case LeanTweenType.easeInQuint: setEaseInQuint(); break; case LeanTweenType.easeOutQuint: setEaseOutQuint(); break; case LeanTweenType.easeInOutQuint: setEaseInOutQuint(); break; case LeanTweenType.easeInSine: setEaseInSine(); break; case LeanTweenType.easeOutSine: setEaseOutSine(); break; case LeanTweenType.easeInOutSine: setEaseInOutSine(); break; case LeanTweenType.easeInExpo: setEaseInExpo(); break; case LeanTweenType.easeOutExpo: setEaseOutExpo(); break; case LeanTweenType.easeInOutExpo: setEaseInOutExpo(); break; case LeanTweenType.easeInCirc: setEaseInCirc(); break; case LeanTweenType.easeOutCirc: setEaseOutCirc(); break; case LeanTweenType.easeInOutCirc: setEaseInOutCirc(); break; case LeanTweenType.easeInBounce: setEaseInBounce(); break; case LeanTweenType.easeOutBounce: setEaseOutBounce(); break; case LeanTweenType.easeInOutBounce: setEaseInOutBounce(); break; case LeanTweenType.easeInBack: setEaseInBack(); break; case LeanTweenType.easeOutBack: setEaseOutBack(); break; case LeanTweenType.easeInOutBack: setEaseInOutBack(); break; case LeanTweenType.easeInElastic: setEaseInElastic(); break; case LeanTweenType.easeOutElastic: setEaseOutElastic(); break; case LeanTweenType.easeInOutElastic: setEaseInOutElastic(); break; case LeanTweenType.punch: setEasePunch(); break; case LeanTweenType.easeShake: setEaseShake(); break; case LeanTweenType.easeSpring: setEaseSpring(); break; default: setEaseLinear(); break; } return this; } public LTDescr setEaseLinear() { easeType = LeanTweenType.linear; easeMethod = easeLinear; return this; } public LTDescr setEaseSpring() { easeType = LeanTweenType.easeSpring; easeMethod = easeSpring; return this; } public LTDescr setEaseInQuad() { easeType = LeanTweenType.easeInQuad; easeMethod = easeInQuad; return this; } public LTDescr setEaseOutQuad() { easeType = LeanTweenType.easeOutQuad; easeMethod = easeOutQuad; return this; } public LTDescr setEaseInOutQuad() { easeType = LeanTweenType.easeInOutQuad; easeMethod = easeInOutQuad; return this; } public LTDescr setEaseInCubic() { easeType = LeanTweenType.easeInCubic; easeMethod = easeInCubic; return this; } public LTDescr setEaseOutCubic() { easeType = LeanTweenType.easeOutCubic; easeMethod = easeOutCubic; return this; } public LTDescr setEaseInOutCubic() { easeType = LeanTweenType.easeInOutCubic; easeMethod = easeInOutCubic; return this; } public LTDescr setEaseInQuart() { easeType = LeanTweenType.easeInQuart; easeMethod = easeInQuart; return this; } public LTDescr setEaseOutQuart() { easeType = LeanTweenType.easeOutQuart; easeMethod = easeOutQuart; return this; } public LTDescr setEaseInOutQuart() { easeType = LeanTweenType.easeInOutQuart; easeMethod = easeInOutQuart; return this; } public LTDescr setEaseInQuint() { easeType = LeanTweenType.easeInQuint; easeMethod = easeInQuint; return this; } public LTDescr setEaseOutQuint() { easeType = LeanTweenType.easeOutQuint; easeMethod = easeOutQuint; return this; } public LTDescr setEaseInOutQuint() { easeType = LeanTweenType.easeInOutQuint; easeMethod = easeInOutQuint; return this; } public LTDescr setEaseInSine() { easeType = LeanTweenType.easeInSine; easeMethod = easeInSine; return this; } public LTDescr setEaseOutSine() { easeType = LeanTweenType.easeOutSine; easeMethod = easeOutSine; return this; } public LTDescr setEaseInOutSine() { easeType = LeanTweenType.easeInOutSine; easeMethod = easeInOutSine; return this; } public LTDescr setEaseInExpo() { easeType = LeanTweenType.easeInExpo; easeMethod = easeInExpo; return this; } public LTDescr setEaseOutExpo() { easeType = LeanTweenType.easeOutExpo; easeMethod = easeOutExpo; return this; } public LTDescr setEaseInOutExpo() { easeType = LeanTweenType.easeInOutExpo; easeMethod = easeInOutExpo; return this; } public LTDescr setEaseInCirc() { easeType = LeanTweenType.easeInCirc; easeMethod = easeInCirc; return this; } public LTDescr setEaseOutCirc() { easeType = LeanTweenType.easeOutCirc; easeMethod = easeOutCirc; return this; } public LTDescr setEaseInOutCirc() { easeType = LeanTweenType.easeInOutCirc; easeMethod = easeInOutCirc; return this; } public LTDescr setEaseInBounce() { easeType = LeanTweenType.easeInBounce; easeMethod = easeInBounce; return this; } public LTDescr setEaseOutBounce() { easeType = LeanTweenType.easeOutBounce; easeMethod = easeOutBounce; return this; } public LTDescr setEaseInOutBounce() { easeType = LeanTweenType.easeInOutBounce; easeMethod = easeInOutBounce; return this; } public LTDescr setEaseInBack() { easeType = LeanTweenType.easeInBack; easeMethod = easeInBack; return this; } public LTDescr setEaseOutBack() { easeType = LeanTweenType.easeOutBack; easeMethod = easeOutBack; return this; } public LTDescr setEaseInOutBack() { easeType = LeanTweenType.easeInOutBack; easeMethod = easeInOutBack; return this; } public LTDescr setEaseInElastic() { easeType = LeanTweenType.easeInElastic; easeMethod = easeInElastic; return this; } public LTDescr setEaseOutElastic() { easeType = LeanTweenType.easeOutElastic; easeMethod = easeOutElastic; return this; } public LTDescr setEaseInOutElastic() { easeType = LeanTweenType.easeInOutElastic; easeMethod = easeInOutElastic; return this; } public LTDescr setEasePunch() { //IL_0017: 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) _optional.animationCurve = LeanTween.punch; toInternal.x = from.x + to.x; easeMethod = tweenOnCurve; return this; } public LTDescr setEaseShake() { //IL_0017: 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) _optional.animationCurve = LeanTween.shake; toInternal.x = from.x + to.x; easeMethod = tweenOnCurve; return this; } private Vector3 tweenOnCurve() { //IL_0001: 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_005d: 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) return new Vector3(from.x + diff.x * _optional.animationCurve.Evaluate(ratioPassed), from.y + diff.y * _optional.animationCurve.Evaluate(ratioPassed), from.z + diff.z * _optional.animationCurve.Evaluate(ratioPassed)); } private Vector3 easeInOutQuad() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_005c: 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_0084: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * 2f; if (val < 1f) { val *= val; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } val = (1f - val) * (val - 3f) + 1f; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } private Vector3 easeInQuad() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) val = ratioPassed * ratioPassed; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeOutQuad() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) val = ratioPassed; val = (0f - val) * (val - 2f); return diff * val + from; } private Vector3 easeLinear() { //IL_000c: 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_0046: 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) val = ratioPassed; return new Vector3(from.x + diff.x * val, from.y + diff.y * val, from.z + diff.z * val); } private Vector3 easeSpring() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) val = Mathf.Clamp01(ratioPassed); val = (Mathf.Sin(val * (float)Math.PI * (0.2f + 2.5f * val * val * val)) * Mathf.Pow(1f - val, 2.2f) + val) * (1f + 1.2f * (1f - val)); return from + diff * val; } private Vector3 easeInCubic() { //IL_002b: 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_0065: 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) val = ratioPassed * ratioPassed * ratioPassed; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeOutCubic() { //IL_003f: 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_0079: 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) val = ratioPassed - 1f; val = val * val * val + 1f; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutCubic() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_007f: 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) val = ratioPassed * 2f; if (val < 1f) { val = val * val * val; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } val -= 2f; val = val * val * val + 2f; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } private Vector3 easeInQuart() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * ratioPassed * ratioPassed * ratioPassed; return diff * val + from; } private Vector3 easeOutQuart() { //IL_0046: 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_0080: 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) val = ratioPassed - 1f; val = 0f - (val * val * val * val - 1f); return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutQuart() { //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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * 2f; if (val < 1f) { val = val * val * val * val; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } val -= 2f; return -diffDiv2 * (val * val * val * val - 2f) + from; } private Vector3 easeInQuint() { //IL_003f: 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_0079: 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) val = ratioPassed; val = val * val * val * val * val; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeOutQuint() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed - 1f; val = val * val * val * val * val + 1f; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutQuint() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * 2f; if (val < 1f) { val = val * val * val * val * val; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } val -= 2f; val = val * val * val * val * val + 2f; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } private Vector3 easeInSine() { //IL_0035: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) val = 0f - Mathf.Cos(ratioPassed * LeanTween.PI_DIV2); return new Vector3(diff.x * val + diff.x + from.x, diff.y * val + diff.y + from.y, diff.z * val + diff.z + from.z); } private Vector3 easeOutSine() { //IL_0028: 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_0062: 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) val = Mathf.Sin(ratioPassed * LeanTween.PI_DIV2); return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutSine() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) val = 0f - (Mathf.Cos((float)Math.PI * ratioPassed) - 1f); return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } private Vector3 easeInExpo() { //IL_0033: 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_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) val = Mathf.Pow(2f, 10f * (ratioPassed - 1f)); return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeOutExpo() { //IL_0034: 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_006e: 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) val = 0f - Mathf.Pow(2f, -10f * ratioPassed) + 1f; return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutExpo() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0044: 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) val = ratioPassed * 2f; if (val < 1f) { return diffDiv2 * Mathf.Pow(2f, 10f * (val - 1f)) + from; } val -= 1f; return diffDiv2 * (0f - Mathf.Pow(2f, -10f * val) + 2f) + from; } private Vector3 easeInCirc() { //IL_0036: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) val = 0f - (Mathf.Sqrt(1f - ratioPassed * ratioPassed) - 1f); return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeOutCirc() { //IL_003e: 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_0078: 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) val = ratioPassed - 1f; val = Mathf.Sqrt(1f - val * val); return new Vector3(diff.x * val + from.x, diff.y * val + from.y, diff.z * val + from.z); } private Vector3 easeInOutCirc() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * 2f; if (val < 1f) { val = 0f - (Mathf.Sqrt(1f - val * val) - 1f); return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } val -= 2f; val = Mathf.Sqrt(1f - val * val) + 1f; return new Vector3(diffDiv2.x * val + from.x, diffDiv2.y * val + from.y, diffDiv2.z * val + from.z); } private Vector3 easeInBounce() { //IL_0042: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed; val = 1f - val; return new Vector3(diff.x - LeanTween.easeOutBounce(0f, diff.x, val) + from.x, diff.y - LeanTween.easeOutBounce(0f, diff.y, val) + from.y, diff.z - LeanTween.easeOutBounce(0f, diff.z, val) + from.z); } private Vector3 easeOutBounce() { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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) val = ratioPassed; float num2; float num; if (val < (num = 1f - 1.75f * overshoot / 2.75f)) { val = 1f / num / num * val * val; } else if (val < (num2 = 1f - 0.75f * overshoot / 2.75f)) { val -= (num + num2) / 2f; val = 7.5625f * val * val + 1f - 0.25f * overshoot * overshoot; } else if (val < (num = 1f - 0.25f * overshoot / 2.75f)) { val -= (num + num2) / 2f; val = 7.5625f * val * val + 1f - 0.0625f * overshoot * overshoot; } else { val -= (num + 1f) / 2f; val = 7.5625f * val * val + 1f - 1f / 64f * overshoot * overshoot; } return diff * val + from; } private Vector3 easeInOutBounce() { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_0041: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) val = ratioPassed * 2f; if (val < 1f) { return new Vector3(LeanTween.easeInBounce(0f, diff.x, val) * 0.5f + from.x, LeanTween.easeInBounce(0f, diff.y, val) * 0.5f + from.y, LeanTween.easeInBounce(0f, diff.z, val) * 0.5f + from.z); } val -= 1f; return new Vector3(LeanTween.easeOutBounce(0f, diff.x, val) * 0.5f + diffDiv2.x + from.x, LeanTween.easeOutBounce(0f, diff.y, val) * 0.5f + diffDiv2.y + from.y, LeanTween.easeOutBounce(0f, diff.z, val) * 0.5f + diffDiv2.z + from.z); } private Vector3 easeInBack() { //IL_0029: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) val = ratioPassed; val /= 1f; float num = 1.70158f * overshoot; return diff * val * val * ((num + 1f) * val - num) + from; } private Vector3 easeOutBack() { //IL_004b: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) float num = 1.70158f * overshoot; val = ratioPassed / 1f - 1f; val = val * val * ((num + 1f) * val + num) + 1f; return diff * val + from; } private Vector3 easeInOutBack() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) float num = 1.70158f * overshoot; val = ratioPassed * 2f; if (val < 1f) { num *= 1.525f * overshoot; return diffDiv2 * (val * val * ((num + 1f) * val - num)) + from; } val -= 2f; num *= 1.525f * overshoot; val = val * val * ((num + 1f) * val + num) + 2f; return diffDiv2 * val + from; } private Vector3 easeInElastic() { //IL_0001: 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_002e: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) return new Vector3(LeanTween.easeInElastic(from.x, to.x, ratioPassed, overshoot, period), LeanTween.easeInElastic(from.y, to.y, ratioPassed, overshoot, period), LeanTween.easeInElastic(from.z, to.z, ratioPassed, overshoot, period)); } private Vector3 easeOutElastic() { //IL_0001: 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_002e: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) return new Vector3(LeanTween.easeOutElastic(from.x, to.x, ratioPassed, overshoot, period), LeanTween.easeOutElastic(from.y, to.y, ratioPassed, overshoot, period), LeanTween.easeOutElastic(from.z, to.z, ratioPassed, overshoot, period)); } private Vector3 easeInOutElastic() { //IL_0001: 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_002e: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) return new Vector3(LeanTween.easeInOutElastic(from.x, to.x, ratioPassed, overshoot, period), LeanTween.easeInOutElastic(from.y, to.y, ratioPassed, overshoot, period), LeanTween.easeInOutElastic(from.z, to.z, ratioPassed, overshoot, period)); } public LTDescr setOvershoot(float overshoot) { this.overshoot = overshoot; return this; } public LTDescr setPeriod(float period) { this.period = period; return this; } public LTDescr setScale(float scale) { this.scale = scale; return this; } public LTDescr setEase(AnimationCurve easeCurve) { _optional.animationCurve = easeCurve; easeMethod = tweenOnCurve; easeType = LeanTweenType.animationCurve; return this; } public LTDescr setTo(Vector3 to) { //IL_0024: 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_0010: 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_001c: Unknown result type (might be due to invalid IL or missing references) if (hasInitiliazed) { this.to = to; diff = to - from; } else { this.to = to; } return this; } public LTDescr setTo(Transform to) { _optional.toTrans = to; return this; } public LTDescr setFrom(Vector3 from) { //IL_0014: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_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) if (Object.op_Implicit((Object)(object)trans)) { init(); } this.from = from; diff = to - this.from; diffDiv2 = diff * 0.5f; return this; } public LTDescr setForceFromCurrentLocalPosition() { //IL_001a: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)trans)) { init(); } from = trans.localPosition; diff = to - from; diffDiv2 = diff * 0.5f; return this; } public LTDescr setFrom(float from) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return setFrom(new Vector3(from, 0f, 0f)); } public LTDescr setDiff(Vector3 diff) { //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) this.diff = diff; return this; } public LTDescr setHasInitialized(bool has) { hasInitiliazed = has; return this; } public LTDescr setId(uint id, uint global_counter) { _id = id; counter = global_counter; return this; } public LTDescr setPassed(float passed) { this.passed = passed; return this; } public LTDescr setTime(float time) { float num = passed / this.time; passed = time * num; this.time = time; return this; } public LTDescr setSpeed(float speed) { this.speed = speed; if (hasInitiliazed) { initSpeed(); } return this; } public LTDescr setRepeat(int repeat) { loopCount = repeat; if ((repeat > 1 && loopType == LeanTweenType.once) || (repeat < 0 && loopType == LeanTweenType.once)) { loopType = LeanTweenType.clamp; } if (type == TweenAction.CALLBACK || type == TweenAction.CALLBACK_COLOR) { setOnCompleteOnRepeat(isOn: true); } return this; } public LTDescr setLoopType(LeanTweenType loopType) { this.loopType = loopType; return this; } public LTDescr setUseEstimatedTime(bool useEstimatedTime) { this.useEstimatedTime = useEstimatedTime; usesNormalDt = false; return this; } public LTDescr setIgnoreTimeScale(bool useUnScaledTime) { useEstimatedTime = useUnScaledTime; usesNormalDt = false; return this; } public LTDescr setUseFrames(bool useFrames) { this.useFrames = useFrames; usesNormalDt = false; return this; } public LTDescr setUseManualTime(bool useManualTime) { this.useManualTime = useManualTime; usesNormalDt = false; return this; } public LTDescr setLoopCount(int loopCount) { loopType = LeanTweenType.clamp; this.loopCount = loopCount; return this; } public LTDescr setLoopOnce() { loopType = LeanTweenType.once; return this; } public LTDescr setLoopClamp() { loopType = LeanTweenType.clamp; if (loopCount == 0) { loopCount = -1; } return this; } public LTDescr setLoopClamp(int loops) { loopCount = loops; return this; } public LTDescr setLoopPingPong() { loopType = LeanTweenType.pingPong; if (loopCount == 0) { loopCount = -1; } return this; } public LTDescr setLoopPingPong(int loops) { loopType = LeanTweenType.pingPong; loopCount = ((loops == -1) ? loops : (loops * 2)); return this; } public LTDescr setOnComplete(Action onComplete) { _optional.onComplete = onComplete; hasExtraOnCompletes = true; return this; } public LTDescr setOnComplete(Action onComplete) { _optional.onCompleteObject = onComplete; hasExtraOnCompletes = true; return this; } public LTDescr setOnComplete(Action onComplete, object onCompleteParam) { _optional.onCompleteObject = onComplete; hasExtraOnCompletes = true; if (onCompleteParam != null) { _optional.onCompleteParam = onCompleteParam; } return this; } public LTDescr setOnCompleteParam(object onCompleteParam) { _optional.onCompleteParam = onCompleteParam; hasExtraOnCompletes = true; return this; } public LTDescr setOnUpdate(Action onUpdate) { _optional.onUpdateFloat = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateRatio(Action onUpdate) { _optional.onUpdateFloatRatio = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateObject(Action onUpdate) { _optional.onUpdateFloatObject = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateVector2(Action onUpdate) { _optional.onUpdateVector2 = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateVector3(Action onUpdate) { _optional.onUpdateVector3 = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateColor(Action onUpdate) { _optional.onUpdateColor = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdateColor(Action onUpdate) { _optional.onUpdateColorObject = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdate(Action onUpdate) { _optional.onUpdateColor = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdate(Action onUpdate) { _optional.onUpdateColorObject = onUpdate; hasUpdateCallback = true; return this; } public LTDescr setOnUpdate(Action onUpdate, object onUpdateParam = null) { _optional.onUpdateFloatObject = onUpdate; hasUpdateCallback = true; if (onUpdateParam != null) { _optional.onUpdateParam = onUpdateParam; } return this; } public LTDescr setOnUpdate(Action onUpdate, object onUpdateParam = null) { _optional.onUpdateVector3Object = onUpdate; hasUpdateCallback = true; if (onUpdateParam != null) { _optional.onUpdateParam = onUpdateParam; } return this; } public LTDescr setOnUpdate(Action onUpdate, object onUpdateParam = null) { _optional.onUpdateVector2 = onUpdate; hasUpdateCallback = true; if (onUpdateParam != null) { _optional.onUpdateParam = onUpdateParam; } return this; } public LTDescr setOnUpdate(Action onUpdate, object onUpdateParam = null) { _optional.onUpdateVector3 = onUpdate; hasUpdateCallback = true; if (onUpdateParam != null) { _optional.onUpdateParam = onUpdateParam; } return this; } public LTDescr setOnUpdateParam(object onUpdateParam) { _optional.onUpdateParam = onUpdateParam; return this; } public LTDescr setOrientToPath(bool doesOrient) { if (type == TweenAction.MOVE_CURVED || type == TweenAction.MOVE_CURVED_LOCAL) { if (_optional.path == null) { _optional.path = new LTBezierPath(); } _optional.path.orientToPath = doesOrient; } else { _optional.spline.orientToPath = doesOrient; } return this; } public LTDescr setOrientToPath2d(bool doesOrient2d) { setOrientToPath(doesOrient2d); if (type == TweenAction.MOVE_CURVED || type == TweenAction.MOVE_CURVED_LOCAL) { _optional.path.orientToPath2d = doesOrient2d; } else { _optional.spline.orientToPath2d = doesOrient2d; } return this; } public LTDescr setRect(LTRect rect) { _optional.ltRect = rect; return this; } public LTDescr setRect(Rect rect) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _optional.ltRect = new LTRect(rect); return this; } public LTDescr setPath(LTBezierPath path) { _optional.path = path; return this; } public LTDescr setPoint(Vector3 point) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _optional.point = point; return this; } public LTDescr setDestroyOnComplete(bool doesDestroy) { destroyOnComplete = doesDestroy; return this; } public LTDescr setAudio(object audio) { _optional.onCompleteParam = audio; return this; } public LTDescr setOnCompleteOnRepeat(bool isOn) { onCompleteOnRepeat = isOn; return this; } public LTDescr setOnCompleteOnStart(bool isOn) { onCompleteOnStart = isOn; return this; } public LTDescr setRect(RectTransform rect) { rectTransform = rect; return this; } public LTDescr setSprites(Sprite[] sprites) { this.sprites = sprites; return this; } public LTDescr setFrameRate(float frameRate) { time = (float)sprites.Length / frameRate; return this; } public LTDescr setOnStart(Action onStart) { _optional.onStart = onStart; return this; } public LTDescr setDirection(float direction) { if (this.direction != -1f && this.direction != 1f) { Debug.LogWarning((object)("You have passed an incorrect direction of '" + direction + "', direction must be -1f or 1f")); return this; } if (this.direction != direction) { if (hasInitiliazed) { this.direction = direction; } else if (_optional.path != null) { _optional.path = new LTBezierPath(LTUtility.reverse(_optional.path.pts)); } else if (_optional.spline != null) { _optional.spline = new LTSpline(LTUtility.reverse(_optional.spline.pts)); } } return this; } public LTDescr setRecursive(bool useRecursion) { this.useRecursion = useRecursion; return this; } } public class LTDescrOptional { public AnimationCurve animationCurve; public int initFrameCount; public Transform toTrans { get; set; } public Vector3 point { get; set; } public Vector3 axis { get; set; } public float lastVal { get; set; } public Quaternion origRotation { get; set; } public LTBezierPath path { get; set; } public LTSpline spline { get; set; } public LTRect ltRect { get; set; } public Action onUpdateFloat { get; set; } public Action onUpdateFloatRatio { get; set; } public Action onUpdateFloatObject { get; set; } public Action onUpdateVector2 { get; set; } public Action onUpdateVector3 { get; set; } public Action onUpdateVector3Object { get; set; } public Action onUpdateColor { get; set; } public Action onUpdateColorObject { get; set; } public Action onComplete { get; set; } public Action onCompleteObject { get; set; } public object onCompleteParam { get; set; } public object onUpdateParam { get; set; } public Action onStart { get; set; } public void reset() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) animationCurve = null; onUpdateFloat = null; onUpdateFloatRatio = null; onUpdateVector2 = null; onUpdateVector3 = null; onUpdateFloatObject = null; onUpdateVector3Object = null; onUpdateColor = null; onComplete = null; onCompleteObject = null; onCompleteParam = null; onStart = null; point = Vector3.zero; initFrameCount = 0; } public void callOnUpdate(float val, float ratioPassed) { //IL_0053: 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_009f: Unknown result type (might be due to invalid IL or missing references) if (onUpdateFloat != null) { onUpdateFloat(val); } if (onUpdateFloatRatio != null) { onUpdateFloatRatio(val, ratioPassed); } else if (onUpdateFloatObject != null) { onUpdateFloatObject(val, onUpdateParam); } else if (onUpdateVector3Object != null) { onUpdateVector3Object(LTDescr.newVect, onUpdateParam); } else if (onUpdateVector3 != null) { onUpdateVector3(LTDescr.newVect); } else if (onUpdateVector2 != null) { onUpdateVector2(new Vector2(LTDescr.newVect.x, LTDescr.newVect.y)); } } } public class LTSeq { public LTSeq previous; public LTSeq current; public LTDescr tween; public float totalDelay; public float timeScale; private int debugIter; public uint counter; public bool toggle; private uint _id; public int id => (int)(_id | (counter << 16)); public void reset() { previous = null; tween = null; totalDelay = 0f; } public void init(uint id, uint global_counter) { reset(); _id = id; counter = global_counter; current = this; } private LTSeq addOn() { current.toggle = true; LTSeq lTSeq = current; current = LeanTween.sequence(initSequence: false); current.previous = lTSeq; lTSeq.toggle = false; current.totalDelay = lTSeq.totalDelay; current.debugIter = lTSeq.debugIter + 1; return current; } private float addPreviousDelays() { LTSeq lTSeq = current.previous; if (lTSeq != null && lTSeq.tween != null) { return current.totalDelay + lTSeq.tween.time; } return current.totalDelay; } public LTSeq append(float delay) { current.totalDelay += delay; return current; } public LTSeq append(Action callback) { LTDescr lTDescr = LeanTween.delayedCall(0f, callback); append(lTDescr); return addOn(); } public LTSeq append(Action callback, object obj) { append(LeanTween.delayedCall(0f, callback).setOnCompleteParam(obj)); return addOn(); } public LTSeq append(GameObject gameObject, Action callback) { append(LeanTween.delayedCall(gameObject, 0f, callback)); return addOn(); } public LTSeq append(GameObject gameObject, Action callback, object obj) { append(LeanTween.delayedCall(gameObject, 0f, callback).setOnCompleteParam(obj)); return addOn(); } public LTSeq append(LTDescr tween) { current.tween = tween; current.totalDelay = addPreviousDelays(); tween.setDelay(current.totalDelay); return addOn(); } public LTSeq insert(LTDescr tween) { current.tween = tween; tween.setDelay(addPreviousDelays()); return addOn(); } public LTSeq setScale(float timeScale) { setScaleRecursive(current, timeScale, 500); return addOn(); } private void setScaleRecursive(LTSeq seq, float timeScale, int count) { if (count <= 0) { return; } this.timeScale = timeScale; seq.totalDelay *= timeScale; if (seq.tween != null) { if (seq.tween.time != 0f) { seq.tween.setTime(seq.tween.time * timeScale); } seq.tween.setDelay(seq.tween.delay * timeScale); } if (seq.previous != null) { setScaleRecursive(seq.previous, timeScale, count - 1); } } public LTSeq reverse() { return addOn(); } } public class GpuInstancingFrustumCulling : MonoBehaviour { [SerializeField] private Camera _camera; [SerializeField] private MeshRenderer[] _meshRenderers = (MeshRenderer[])(object)new MeshRenderer[0]; public bool meshesAreStill = true; private Dictionary<(Mesh mesh, Material material), (List transforms, Bounds aabb)> _sources = new Dictionary<(Mesh, Material), (List, Bounds)>(); private Dictionary<(Mesh mesh, Material material), (Matrix4x4[] matrices, Bounds aabb)> _batches = new Dictionary<(Mesh, Material), (Matrix4x4[], Bounds)>(); private Dictionary> _freeMatrices = new Dictionary>(); private Plane[] _frustum = (Plane[])(object)new Plane[6]; private void Start() { Initialize(); UpdateMatrices(); if ((Object)(object)_camera == (Object)null) { _camera = Camera.main; } if ((Object)(object)_camera == (Object)null) { Debug.LogError((object)"no camera, can't continue", (Object)(object)this); ((Behaviour)this).enabled = false; } } private void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!meshesAreStill) { UpdateMatrices(); } GeometryUtility.CalculateFrustumPlanes(_camera, _frustum); foreach (KeyValuePair<(Mesh, Material), (Matrix4x4[], Bounds)> batch in _batches) { (Mesh, Material) key = batch.Key; (Matrix4x4[], Bounds) value = batch.Value; Bounds item = value.Item2; if (GeometryUtility.TestPlanesAABB(_frustum, item)) { Graphics.DrawMeshInstanced(key.Item1, 0, key.Item2, value.Item1); } } } private void Initialize() { //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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0110: Unknown result type (might be due to invalid IL or missing references) _sources.Clear(); MeshRenderer[] meshRenderers = _meshRenderers; foreach (MeshRenderer val in meshRenderers) { if ((Object)(object)val == (Object)null) { continue; } MeshFilter component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { continue; } Mesh sharedMesh = component.sharedMesh; if ((Object)(object)sharedMesh == (Object)null) { continue; } Material[] sharedMaterials = ((Renderer)val).sharedMaterials; foreach (Material val2 in sharedMaterials) { if (!val2.enableInstancing && Application.isPlaying) { Debug.LogWarning((object)("\"" + ((Object)val2).name + "\" material won't be rendered as it's GPU Instancing is not enabled"), (Object)(object)val); } else if (!((Object)(object)val2 == (Object)null)) { Bounds bounds = ((Renderer)val).bounds; (Mesh, Material) key = (sharedMesh, val2); if (_sources.ContainsKey(key)) { List item = _sources[key].transforms; item.Add(((Component)val).transform); Bounds item2 = _sources[key].aabb; ((Bounds)(ref item2)).Encapsulate(bounds); _sources[key] = (item, item2); } else { _sources.Add(key, (new List { ((Component)val).transform }, bounds)); } } } if (Application.isPlaying) { ((Renderer)val).enabled = false; } } } private void UpdateMatrices() { //IL_011f: 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_0141: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<(Mesh, Material), (Matrix4x4[], Bounds)> batch in _batches) { Matrix4x4[] item = batch.Value.Item1; if (_freeMatrices.ContainsKey(item.Length)) { _freeMatrices[item.Length].Push(item); continue; } Stack stack = new Stack(); stack.Push(item); _freeMatrices.Add(item.Length, stack); } _batches.Clear(); foreach (KeyValuePair<(Mesh, Material), (List, Bounds)> source in _sources) { (Mesh, Material) key = source.Key; (List, Bounds) value = source.Value; List item2 = value.Item1; int count = item2.Count; Matrix4x4[] array = null; array = (Matrix4x4[])((!_freeMatrices.ContainsKey(count) || _freeMatrices[count].Count == 0) ? ((Array)new Matrix4x4[count]) : ((Array)_freeMatrices[count].Pop())); for (int i = 0; i < count; i++) { array[i] = item2[i].localToWorldMatrix; } _batches.Add(key, (array, value.Item2)); } } } namespace Rito.RadialMenu_v3 { [Serializable] public struct ClockwisePolarCoord { private float _angle; public float Radius { get; set; } public float Angle { get { return _angle; } set { _angle = ClampAngle(value); } } public static ClockwisePolarCoord Zero => new ClockwisePolarCoord(0f, 0f); public static ClockwisePolarCoord North => new ClockwisePolarCoord(1f, 0f); public static ClockwisePolarCoord East => new ClockwisePolarCoord(1f, 90f); public static ClockwisePolarCoord South => new ClockwisePolarCoord(1f, 180f); public static ClockwisePolarCoord West => new ClockwisePolarCoord(1f, 270f); public ClockwisePolarCoord Normalized => new ClockwisePolarCoord(1f, Angle); public ClockwisePolarCoord(float radius, float angle) { Radius = radius; _angle = ClampAngle(angle); } private static float ClampAngle(float angle) { angle %= 360f; if (angle < 0f) { angle += 360f; } return angle; } private static float CovertAngle(float angle) { return 90f - angle; } private static float Sin(float angle) { return Mathf.Sin(angle * ((float)Math.PI / 180f)); } private static float Cos(float angle) { return Mathf.Cos(angle * ((float)Math.PI / 180f)); } public static ClockwisePolarCoord FromVector2(in Vector2 vec) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_001e: Unknown result type (might be due to invalid IL or missing references) if (vec == Vector2.zero) { return Zero; } Vector2 val = vec; float magnitude = ((Vector2)(ref val)).magnitude; float angle = Mathf.Atan2(vec.y, vec.x) * 57.29578f; return new ClockwisePolarCoord(magnitude, CovertAngle(angle)); } public static bool operator ==(ClockwisePolarCoord a, ClockwisePolarCoord b) { if (Mathf.Approximately(a.Angle, b.Angle)) { return Mathf.Approximately(a.Radius, b.Radius); } return false; } public static bool operator !=(ClockwisePolarCoord a, ClockwisePolarCoord b) { if (Mathf.Approximately(a.Angle, b.Angle)) { return !Mathf.Approximately(a.Radius, b.Radius); } return true; } public Vector2 ToVector2() { //IL_0046: 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) if (Radius == 0f && Angle == 0f) { return Vector2.zero; } float angle = CovertAngle(Angle); return new Vector2(Radius * Cos(angle), Radius * Sin(angle)); } public override string ToString() { return $"({Radius}, {Angle})"; } public override bool Equals(object obj) { if (obj == null) { return false; } if (obj is ClockwisePolarCoord clockwisePolarCoord) { return this == clockwisePolarCoord; } return false; } public override int GetHashCode() { return base.GetHashCode(); } } public enum EasingType { None, InExpo, OutExpo, OutBack, InBounce, OutBounce, InOutBounce, OutElastic } public static class Easing { public static float Get(float x, EasingType type) { return type switch { EasingType.InExpo => EaseInExpo(x), EasingType.OutExpo => EaseOutExpo(x), EasingType.OutBack => EaseOutBack(x), EasingType.InBounce => EaseInBounce(x), EasingType.OutBounce => EaseOutBounce(x), EasingType.InOutBounce => EaseInOutBounce(x), EasingType.OutElastic => EaseOutElastic(x), _ => x, }; } public static float EaseInExpo(float x) { if (x != 0f) { return Mathf.Pow(2f, 10f * x - 10f); } return 0f; } public static float EaseOutExpo(float x) { if (x != 1f) { return 1f - Mathf.Pow(2f, -10f * x); } return 1f; } public static float EaseOutBack(float x) { return 1f + 2.70158f * Mathf.Pow(x - 1f, 3f) + 1.70158f * Mathf.Pow(x - 1f, 2f); } public static float EaseInBounce(float x) { return 1f - EaseOutBounce(1f - x); } public static float EaseOutBounce(float x) { if (x < 0.36363637f) { return 7.5625f * x * x; } if (x < 0.72727275f) { return 7.5625f * (x -= 0.54545456f) * x + 0.75f; } if (x < 0.90909094f) { return 7.5625f * (x -= 0.8181818f) * x + 0.9375f; } return 7.5625f * (x -= 21f / 22f) * x + 63f / 64f; } public static float EaseInOutBounce(float x) { if (!(x < 0.5f)) { return (1f + EaseOutBounce(2f * x - 1f)) * 0.5f; } return (1f - EaseOutBounce(1f - 2f * x)) * 0.5f; } public static float EaseOutElastic(float x) { if (x != 0f) { if (x != 1f) { return Mathf.Pow(2f, -10f * x) * Mathf.Sin((x * 10f - 0.75f) * ((float)Math.PI * 2f / 3f)) + 1f; } return 1f; } return 0f; } } [DisallowMultipleComponent] public class RadialMenu : MonoBehaviour { public enum AppearanceType { None, Fade, ScaleChange, FadeAndScaleChange, Spread, Progressive, ProgressiveFade, ProgressiveScaleChange, ProgressiveSpread } public enum MainType { AlphaChange, ScaleChange, AlphaAndScaleChange } private abstract class MenuState { protected readonly RadialMenu menu; public MenuState(RadialMenu menu) { this.menu = menu; } public abstract void OnEnter(); public abstract void Update(); public abstract void OnExit(); protected float GetMainStatePieceAlpha() { MainType mainType = menu._mainType; if (mainType == MainType.AlphaChange || mainType == MainType.AlphaAndScaleChange) { return 0.5f; } return 1f; } } private sealed class NullState : MenuState { public static NullState Instance => new NullState(); public NullState() : base(null) { } public override void OnEnter() { } public override void OnExit() { } public override void Update() { } } private abstract class AppearanceState : MenuState { private readonly float TimeToSelect = 0.1f; private float timeSelectLeft; public AppearanceState(RadialMenu menu) : base(menu) { } public override void OnEnter() { timeSelectLeft = TimeToSelect; menu._selectedIndex = -1; menu.ShowGameObject(); menu.SetArrow(show: false); menu.SetCenterX(show: true); if (menu._stateProgress == 0f) { OnEnterAtZeroProgress(); } } protected virtual void OnEnterAtZeroProgress() { } public override void Update() { Execute(menu._selectedIndex); menu._stateProgress += Time.deltaTime / menu._appearanceDuration; if (timeSelectLeft <= 0f) { menu.ChangeToNextState(); } else { timeSelectLeft -= Time.deltaTime; } } public abstract void Execute(int selectedIndex = -1); public override void OnExit() { } protected float GetEasedProgress(float progress) { return Easing.Get(progress, menu._appearanceEasing); } } private abstract class MainState : MenuState { protected int prevSelectedIndex = -1; private bool finishedAnimation; public MainState(RadialMenu menu) : base(menu) { } public override void OnEnter() { prevSelectedIndex = -1; finishedAnimation = false; if (menu._stateProgress >= 1f) { FinishAnimation(); } } private void FinishAnimation() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(1f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: true); if (menu._selectedIndex >= 0) { OnSelectedIndexChanged(prevSelectedIndex, menu._selectedIndex); } finishedAnimation = true; } public override void Update() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0091: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!finishedAnimation) { menu.AState.Execute(menu._selectedIndex); if (menu._stateProgress < 1f) { menu._stateProgress += Time.deltaTime / menu._appearanceDuration; } else { FinishAnimation(); } } bool flag = false; Vector3 val = Camera.main.ScreenToViewportPoint(Input.mousePosition); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(val.x - 0.5f, val.y - 0.5f); Vector2 val3 = new Vector2(val2.x * (float)Screen.width / (float)Screen.height, val2.y); if (((Vector2)(ref val3)).magnitude < menu._centerRange) { menu._selectedIndex = -1; } else { flag = true; float mouseAngleDegrees = GetMouseAngleDegrees(); menu._arrowRotationZ = 0f - mouseAngleDegrees; menu._selectedIndex = GetIndexFromMouseAngle(mouseAngleDegrees); } menu.SetArrow(flag); menu.SetCenterX(!flag); if (prevSelectedIndex != menu._selectedIndex) { OnSelectedIndexChanged(prevSelectedIndex, menu._selectedIndex); } prevSelectedIndex = menu._selectedIndex; } private float GetMouseAngleDegrees() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 mousePosition = Input.mousePosition; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((float)Screen.width / 2f, (float)Screen.height / 2f); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(mousePosition.x - val.x, mousePosition.y - val.y); float num = Mathf.Atan2(val2.x, val2.y) * 57.29578f; num %= 360f; if (num < 0f) { num += 360f; } return num; } private int GetIndexFromMouseAngle(float angleDegrees) { return Mathf.RoundToInt(angleDegrees / menu.angleRangePerPiece) % menu._pieceCount; } public abstract void OnSelectedIndexChanged(int prevIndex, int currentIndex); public override void OnExit() { } } private abstract class DisappearanceState : MenuState { public DisappearanceState(RadialMenu menu) : base(menu) { } public override void OnEnter() { } public override void Update() { Execute(); menu._stateProgress -= Time.deltaTime / menu._disppearanceDuration; if (menu._stateProgress <= 0f) { menu._stateProgress = 0f; menu.ChangeToNextState(); } } public abstract void Execute(); public override void OnExit() { menu.HideGameObject(); } protected float GetEasedProgress(float progress) { return Easing.Get(progress, menu._disappearanceEasing); } } private sealed class DefaultAppearance : AppearanceState { public DefaultAppearance(RadialMenu menu) : base(menu) { } public override void Execute(int selectedIndex = -1) { menu.ChangeToNextState(); } } private sealed class FadeIn : AppearanceState { private float alphaGoal; public FadeIn(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); alphaGoal = GetMainStatePieceAlpha(); } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(1f); menu.SetAllPieceAlpha(0f); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { menu.SetAllPieceAlpha(alphaGoal * GetEasedProgress(menu._stateProgress), selectedIndex); } } private sealed class ScaleUp : AppearanceState { public ScaleUp(RadialMenu menu) : base(menu) { } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(0.001f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { menu.SetAllPieceScale(GetEasedProgress(menu._stateProgress), selectedIndex); } } private sealed class FadeInAndScaleUp : AppearanceState { private float alphaGoal; public FadeInAndScaleUp(RadialMenu menu) : base(menu) { } protected override void OnEnterAtZeroProgress() { alphaGoal = GetMainStatePieceAlpha(); menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(0.001f); menu.SetAllPieceAlpha(alphaGoal); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { float easedProgress = GetEasedProgress(menu._stateProgress); menu.SetAllPieceScale(easedProgress, selectedIndex); menu.SetAllPieceAlpha(easedProgress * alphaGoal, selectedIndex); } } private sealed class Spread : AppearanceState { public Spread(RadialMenu menu) : base(menu) { } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(0f); menu.SetAllPieceScale(0.001f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { float easedProgress = GetEasedProgress(menu._stateProgress); float allPieceDistance = easedProgress * menu._pieceDist; menu.SetAllPieceDistance(allPieceDistance); menu.SetAllPieceScale(easedProgress, selectedIndex); } } private sealed class ProgressiveAppearance : AppearanceState { public ProgressiveAppearance(RadialMenu menu) : base(menu) { } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(1f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: false); } public override void Execute(int selectedIndex = -1) { int num = (int)(menu._stateProgress * (float)menu._pieceCount); for (int i = 0; i < menu._pieceCount; i++) { if (i != selectedIndex) { ((Behaviour)menu._pieceImages[i]).enabled = i <= num; } } } } private sealed class ProgressiveFadeIn : AppearanceState { private float alphaGoal; public ProgressiveFadeIn(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); alphaGoal = GetMainStatePieceAlpha(); } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(1f); menu.SetAllPieceAlpha(0f); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { if (i != selectedIndex) { float num2 = (float)i / num; float num3 = (stateProgress - num2) / (1f - num2); ((Graphic)menu._pieceImages[i]).color = new Color(1f, 1f, 1f, num3 * alphaGoal); } } } } private sealed class ProgressiveScaleUp : AppearanceState { public ProgressiveScaleUp(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(menu._pieceDist); menu.SetAllPieceScale(0f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { if (i != selectedIndex) { float num2 = (float)i / num; float num3 = (stateProgress - num2) / (1f - num2); if (num3 < 0f) { num3 = 0f; } ((Transform)menu._pieceRects[i]).localScale = new Vector3(num3, num3, 1f); } } } } private sealed class ProgressiveSpread : AppearanceState { public ProgressiveSpread(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); } protected override void OnEnterAtZeroProgress() { menu.SetAllPieceDistance(0f); menu.SetAllPieceScale(0f); menu.SetAllPieceAlpha(GetMainStatePieceAlpha()); menu.SetAllPieceImageEnabled(enabled: true); } public override void Execute(int selectedIndex = -1) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { if (i != selectedIndex) { float num2 = num * stateProgress - (float)i; num2 = Mathf.Clamp01(num2); ((Transform)menu._pieceRects[i]).localScale = new Vector3(num2, num2, 1f); menu._pieceRects[i].anchoredPosition = menu._pieceDirections[i] * num2 * menu._pieceDist; } } } } private sealed class MainAlphaChange : MainState { public MainAlphaChange(RadialMenu menu) : base(menu) { } public override void OnSelectedIndexChanged(int prevIndex, int currentIndex) { if (prevIndex >= 0) { menu.SetPieceAlpha(prevIndex, 0.5f); } if (currentIndex >= 0) { menu.SetPieceAlpha(currentIndex, 1f); } } public override void OnExit() { if (menu._selectedIndex >= 0) { menu.SetPieceAlpha(menu._selectedIndex, 0.5f); } } } private sealed class MainScaleChange : MainState { public MainScaleChange(RadialMenu menu) : base(menu) { } public override void OnSelectedIndexChanged(int prevIndex, int currentIndex) { if (prevIndex >= 0) { menu.SetPieceScale(prevIndex, 1f); } if (currentIndex >= 0) { menu.SetPieceScale(currentIndex, 1.2f); } } public override void OnExit() { if (menu._selectedIndex >= 0) { menu.SetPieceScale(menu._selectedIndex, 1f); } } } private sealed class MainAlphaAndScaleChange : MainState { public MainAlphaAndScaleChange(RadialMenu menu) : base(menu) { } public override void OnSelectedIndexChanged(int prevIndex, int currentIndex) { if (prevIndex >= 0) { menu.SetPieceAlpha(prevIndex, 0.5f); menu.SetPieceScale(prevIndex, 1f); } if (currentIndex >= 0) { menu.SetPieceAlpha(currentIndex, 1f); menu.SetPieceScale(currentIndex, 1.2f); } } public override void OnExit() { if (menu._selectedIndex >= 0) { menu.SetPieceAlpha(menu._selectedIndex, 0.5f); menu.SetPieceScale(menu._selectedIndex, 1f); } } } private sealed class DefaultDisappearance : DisappearanceState { public DefaultDisappearance(RadialMenu menu) : base(menu) { } public override void Execute() { menu._stateProgress = 0f; menu.ChangeToNextState(); } } private sealed class FadeOut : DisappearanceState { private float alphaGoal; public FadeOut(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); alphaGoal = GetMainStatePieceAlpha(); } public override void Execute() { menu.SetAllPieceAlpha(alphaGoal * GetEasedProgress(menu._stateProgress)); } } private sealed class ScaleDown : DisappearanceState { public ScaleDown(RadialMenu menu) : base(menu) { } public override void Execute() { menu.SetAllPieceScale(GetEasedProgress(menu._stateProgress)); } } private sealed class FadeOutAndScaleDown : DisappearanceState { private float alphaGoal; public FadeOutAndScaleDown(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); alphaGoal = GetMainStatePieceAlpha(); } public override void Execute() { float easedProgress = GetEasedProgress(menu._stateProgress); menu.SetAllPieceScale(easedProgress); menu.SetAllPieceAlpha(easedProgress * alphaGoal); } } private sealed class Gather : DisappearanceState { public Gather(RadialMenu menu) : base(menu) { } public override void Execute() { float easedProgress = GetEasedProgress(menu._stateProgress); float allPieceDistance = easedProgress * menu._pieceDist; menu.SetAllPieceDistance(allPieceDistance); menu.SetAllPieceScale(easedProgress); } } private sealed class ProgressiveDisappearance : DisappearanceState { public ProgressiveDisappearance(RadialMenu menu) : base(menu) { } public override void Execute() { int num = (int)(menu._stateProgress * (float)menu._pieceCount); for (int i = 0; i < menu._pieceCount; i++) { ((Behaviour)menu._pieceImages[i]).enabled = i <= num; } } } private sealed class ProgressiveFadeOut : DisappearanceState { private float alphaGoal; public ProgressiveFadeOut(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); alphaGoal = GetMainStatePieceAlpha(); } public override void Execute() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { float num2 = (float)i / num; float num3 = (stateProgress - num2) / (1f - num2); ((Graphic)menu._pieceImages[i]).color = new Color(1f, 1f, 1f, num3 * alphaGoal); } } } private sealed class ProgressiveScaleDown : DisappearanceState { public ProgressiveScaleDown(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); } public override void Execute() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { float num2 = (float)i / num; float num3 = (stateProgress - num2) / (1f - num2); if (num3 < 0f) { num3 = 0f; } ((Transform)menu._pieceRects[i]).localScale = new Vector3(num3, num3, 1f); } } } private sealed class ProgressiveGather : DisappearanceState { public ProgressiveGather(RadialMenu menu) : base(menu) { } public override void OnEnter() { base.OnEnter(); } public override void Execute() { //IL_003f: 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_0078: Unknown result type (might be due to invalid IL or missing references) float stateProgress = menu._stateProgress; float num = menu._pieceCount; for (int i = 0; (float)i < num; i++) { float num2 = num * stateProgress - (float)i; num2 = Mathf.Clamp01(num2); ((Transform)menu._pieceRects[i]).localScale = new Vector3(num2, num2, 1f); menu._pieceRects[i].anchoredPosition = menu._pieceDirections[i] * num2 * menu._pieceDist; } } } private const string HotkeyObjName = "HotkeyBackground"; private const float wheelScreenRatio = 1.7777778f; private static RadialMenu instance; private float lastResolutionWidth; private float lastResolutionHeight; private static int pieceCount = 8; private static float appearanceDuration = 0.3f; private static float disppearanceDuration = 0.3f; private static float pieceDist = 180f; private static float centerRange = 0.1f; private static GameObject pieceSample; private static RectTransform arrow; private static RectTransform centerX; private static AppearanceType appearanceType; private static EasingType appearanceEasing; private static bool quickKeysEnabled; private static TextSettings textSettings; private static MainType mainType; private static AppearanceType disappearanceType; private static EasingType disappearanceEasing; [SerializeField] private int _pieceCount = 8; [SerializeField] private float _appearanceDuration = 0.3f; [SerializeField] private float _disppearanceDuration = 0.3f; [SerializeField] private float _pieceDist = 180f; [SerializeField] private float _centerRange = 0.1f; private float _defaultRatioCenterRange; private bool _quickKeysEnabled; private static Dictionary _quickKeysData; private TextSettings _textSettings; [SerializeField] private GameObject _pieceSample; [SerializeField] private RectTransform _arrow; private RectTransform _centerX; private float angleRangePerPiece; private Image[] _pieceImages; private RectTransform[] _pieceRects; private Vector2[] _pieceDirections; private float _arrowRotationZ; [SerializeField] private int _selectedIndex = -1; private const float NotSelectedPieceAlpha = 0.5f; private static readonly Color SelectedPieceColor = new Color(1f, 1f, 1f, 1f); private static readonly Color NotSelectedPieceColor = new Color(1f, 1f, 1f, 0.5f); private static Texture2D hotkeyBackgroundTexture; [SerializeField] private AppearanceType _appearanceType; [SerializeField] private EasingType _appearanceEasing; [SerializeField] private MainType _mainType; [SerializeField] private AppearanceType _disappearanceType; [SerializeField] private EasingType _disappearanceEasing; private Dictionary _appStateDict = new Dictionary(); private Dictionary _mainStateDict = new Dictionary(); private Dictionary _disStateDict = new Dictionary(); private MenuState _currentState; private float _stateProgress; private AppearanceState AState => _appStateDict[_appearanceType]; private MainState MState => _mainStateDict[_mainType]; private DisappearanceState DState => _disStateDict[_disappearanceType]; public event Action OnDestroyEvent; private void OnDestroy() { this.OnDestroyEvent?.Invoke(); } public static void InitializeProperties(int pieceCount, GameObject pieceSample, RectTransform arrow, RectTransform centerX, bool quickKeysEnabled, KeyCode[] modifiers, TextSettings textSettings, out Dictionary quickKeysData, float pieceDist = 180f, float centerRange = 0.1f, MainType mainType = MainType.AlphaAndScaleChange, float appearanceDuration = 0.3f, AppearanceType appearanceType = AppearanceType.None, EasingType appearanceEasing = EasingType.None, float disppearanceDuration = 0.3f, AppearanceType disappearanceType = AppearanceType.None, EasingType disappearanceEasing = EasingType.None) { if (appearanceDuration < 0.1f || disppearanceDuration < 0.1f) { throw new ArgumentException("appearanceDuration/disppearanceDuration must be at least 0.1f seconds."); } if (centerRange < 0.01f || centerRange > 0.5f) { throw new ArgumentException("centerRange must be between 0.01f and 0.5f."); } RadialMenu.pieceCount = pieceCount; RadialMenu.pieceSample = pieceSample; RadialMenu.arrow = arrow; RadialMenu.centerX = centerX; RadialMenu.quickKeysEnabled = quickKeysEnabled; RadialMenu.textSettings = textSettings; RadialMenu.pieceDist = pieceDist; RadialMenu.centerRange = centerRange; RadialMenu.mainType = mainType; RadialMenu.appearanceType = appearanceType; RadialMenu.appearanceDuration = appearanceDuration; RadialMenu.appearanceEasing = appearanceEasing; RadialMenu.disppearanceDuration = disppearanceDuration; RadialMenu.disappearanceType = disappearanceType; RadialMenu.disappearanceEasing = disappearanceEasing; quickKeysData = UpdateQuickKeyData(quickKeysEnabled, pieceCount, modifiers); } private void InitializeEditorValues() { angleRangePerPiece = 360f / (float)pieceCount; _pieceCount = pieceCount; _pieceSample = pieceSample; _arrow = arrow; _centerX = centerX; _quickKeysEnabled = quickKeysEnabled; _textSettings = textSettings; _pieceDist = pieceDist; _centerRange = centerRange; _defaultRatioCenterRange = centerRange; _mainType = mainType; _appearanceType = appearanceType; _appearanceDuration = appearanceDuration; _appearanceEasing = appearanceEasing; _disppearanceDuration = disppearanceDuration; _disappearanceType = disappearanceType; _disappearanceEasing = disappearanceEasing; } public bool IsPieceSelected() { return _selectedIndex >= 0; } private void Awake() { try { instance = this; InitializeEditorValues(); InitPieceImages(); InitPieceDirections(); InitStateDicts(); UpdateQuickKeys(); } finally { HideGameObject(); } } private void InitPieceImages() { _pieceSample.SetActive(true); _pieceImages = (Image[])(object)new Image[_pieceCount]; _pieceRects = (RectTransform[])(object)new RectTransform[_pieceCount]; for (int i = 0; i < _pieceCount; i++) { GameObject val = Object.Instantiate(_pieceSample, ((Component)this).transform); ((Object)val).name = $"Piece {i}"; _pieceImages[i] = val.GetComponent(); _pieceRects[i] = ((Graphic)_pieceImages[i]).rectTransform; } _pieceSample.SetActive(false); } private void GenerateKeyBindObject(WheelKeyBind keyBind, Transform parentT) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("HotkeyBackground", new Type[1] { typeof(RectTransform) }); RectTransform component = val.GetComponent(); component.SetAnchor(textSettings.Anchor, textSettings.AnchorOffsets.x, textSettings.AnchorOffsets.y); component.sizeDelta = textSettings.BackgroundSize; val.AddComponent().sprite = AssetLoading.GetSpriteFromTexture(GetHotkeyBackgroundTexture(), Vector2.zero); val.transform.SetParent(parentT, false); GameObject val2 = new GameObject("HotkeyText", new Type[1] { typeof(RectTransform) }); val2.GetComponent().SetAnchor(AnchorPresets.MiddleCenter); Text obj = val2.AddComponent(); obj.fontStyle = textSettings.FontStyle; obj.fontSize = textSettings.FontSize; obj.font = textSettings.Font; ((Graphic)obj).color = textSettings.FontColor; obj.alignment = (TextAnchor)4; obj.horizontalOverflow = (HorizontalWrapMode)1; obj.verticalOverflow = (VerticalWrapMode)1; obj.text = KeyCodeUtils.KeyCombinationToString(useLiterals: false, keyBind.KeyCode, "+", keyBind.Modifiers); val2.transform.SetParent(val.transform, false); } private Texture2D GetHotkeyBackgroundTexture() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)hotkeyBackgroundTexture)) { hotkeyBackgroundTexture = TextureUtils.GenerateRectRoundCorners(256, 42, 14f, 1.75f, textSettings.BackgroundColor); } return hotkeyBackgroundTexture; } private void InitPieceDirections() { //IL_003b: 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) _pieceDirections = (Vector2[])(object)new Vector2[_pieceCount]; float num = 360f / (float)_pieceCount; for (int i = 0; i < _pieceCount; i++) { _pieceDirections[i] = new ClockwisePolarCoord(1f, num * (float)i).ToVector2(); } } public void UpdateResolutionRatio(float width, float height) { if (width != lastResolutionWidth || height != lastResolutionHeight) { lastResolutionWidth = width; lastResolutionHeight = height; float num = width / height; float num2 = 1.7777778f / num; _centerRange = _defaultRatioCenterRange / num2; } } private void ShowGameObject() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Resolution currentResolution = Screen.currentResolution; float width = ((Resolution)(ref currentResolution)).width; currentResolution = Screen.currentResolution; UpdateResolutionRatio(width, ((Resolution)(ref currentResolution)).height); ((Component)this).gameObject.SetActive(true); } private void HideGameObject() { ((Component)this).gameObject.SetActive(false); } public static void UpdateQuickTools(bool enable, KeyCode[] modifiers, out Dictionary quickKeysData) { quickKeysData = UpdateQuickKeyData(enable, pieceCount, modifiers); if (Object.op_Implicit((Object)(object)instance)) { instance._quickKeysEnabled = enable; instance.UpdateQuickKeys(); } else { quickKeysEnabled = enable; } } private void UpdateQuickKeys() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown int num = 0; foreach (Transform item in ((Component)this).transform) { Transform val = item; if (((Object)val).name.StartsWith("Piece")) { Transform val2 = val.Find("HotkeyBackground"); if (Object.op_Implicit((Object)(object)val2)) { Object.DestroyImmediate((Object)(object)((Component)val2).gameObject); } if (_quickKeysEnabled && _quickKeysData.TryGetValue(num++, out var value)) { GenerateKeyBindObject(value, val); } } } } private static Dictionary UpdateQuickKeyData(bool enabled, int toolWheelCount, KeyCode[] modifiers) { if (quickKeysEnabled) { _quickKeysData = GenerateQuickKeyData(pieceCount, modifiers); } else { _quickKeysData = null; } return _quickKeysData; } private static Dictionary GenerateQuickKeyData(int toolWheelCount, KeyCode[] modifiers) { //IL_0021: 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) Dictionary dictionary = new Dictionary(); int num = Math.Min(toolWheelCount, 10); for (int i = 1; i <= num; i++) { int num2 = ((i != 10) ? i : 0); KeyCode keyCode = (KeyCode)(48 + num2); dictionary.Add(i - 1, new WheelKeyBind(keyCode, modifiers)); } return dictionary; } public bool IsRadialShowing() { return ((Component)this).gameObject.activeSelf; } private void SetPieceAlpha(int index, float alpha) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) ((Graphic)_pieceImages[index]).color = new Color(1f, 1f, 1f, alpha); } private void SetPieceDistance(int index, float distance) { //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) _pieceRects[index].anchoredPosition = _pieceDirections[index] * distance; } private void SetPieceScale(int index, float scale) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((Transform)_pieceRects[index]).localScale = new Vector3(scale, scale, 1f); } private void SetAllPieceDistance(float distance) { //IL_0013: 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) for (int i = 0; i < _pieceCount; i++) { _pieceRects[i].anchoredPosition = _pieceDirections[i] * distance; } } private void SetAllPieceAlpha(float alpha, int selectedIndex = -1) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _pieceCount; i++) { if (i != selectedIndex) { ((Graphic)_pieceImages[i]).color = new Color(1f, 1f, 1f, alpha); } } } private void SetAllPieceScale(float scale, int selectedIndex = -1) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _pieceCount; i++) { if (i != selectedIndex) { ((Transform)_pieceRects[i]).localScale = new Vector3(scale, scale, 1f); } } } private void SetAllPieceImageEnabled(bool enabled) { for (int i = 0; i < _pieceCount; i++) { ((Behaviour)_pieceImages[i]).enabled = enabled; } } private void SetArrow(bool show) { //IL_001a: 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) ((Component)_arrow).gameObject.SetActive(show); if (show) { ((Transform)_arrow).eulerAngles = Vector3.forward * _arrowRotationZ; } } private void SetCenterX(bool show) { ((Component)_centerX).gameObject.SetActive(show); } public bool Show() { return ForceToEnterAppearanceState(); } public int Hide() { ForceToEnterDisappearanceState(); SetArrow(show: false); SetCenterX(show: false); return _selectedIndex; } public void SetPieceImageSprites(Sprite[] sprites) { int i = 0; for (int num = sprites.Length; i < _pieceCount && i < num; i++) { if ((Object)(object)sprites[i] != (Object)null) { _pieceImages[i].sprite = sprites[i]; } } } private void Update() { _currentState.Update(); } private void InitStateDicts() { _currentState = NullState.Instance; _appStateDict.Add(AppearanceType.None, new DefaultAppearance(this)); _appStateDict.Add(AppearanceType.Fade, new FadeIn(this)); _appStateDict.Add(AppearanceType.ScaleChange, new ScaleUp(this)); _appStateDict.Add(AppearanceType.FadeAndScaleChange, new FadeInAndScaleUp(this)); _appStateDict.Add(AppearanceType.Spread, new Spread(this)); _appStateDict.Add(AppearanceType.Progressive, new ProgressiveAppearance(this)); _appStateDict.Add(AppearanceType.ProgressiveFade, new ProgressiveFadeIn(this)); _appStateDict.Add(AppearanceType.ProgressiveScaleChange, new ProgressiveScaleUp(this)); _appStateDict.Add(AppearanceType.ProgressiveSpread, new ProgressiveSpread(this)); _mainStateDict.Add(MainType.AlphaChange, new MainAlphaChange(this)); _mainStateDict.Add(MainType.ScaleChange, new MainScaleChange(this)); _mainStateDict.Add(MainType.AlphaAndScaleChange, new MainAlphaAndScaleChange(this)); _disStateDict.Add(AppearanceType.None, new DefaultDisappearance(this)); _disStateDict.Add(AppearanceType.Fade, new FadeOut(this)); _disStateDict.Add(AppearanceType.ScaleChange, new ScaleDown(this)); _disStateDict.Add(AppearanceType.FadeAndScaleChange, new FadeOutAndScaleDown(this)); _disStateDict.Add(AppearanceType.Spread, new Gather(this)); _disStateDict.Add(AppearanceType.Progressive, new ProgressiveDisappearance(this)); _disStateDict.Add(AppearanceType.ProgressiveFade, new ProgressiveFadeOut(this)); _disStateDict.Add(AppearanceType.ProgressiveScaleChange, new ProgressiveScaleDown(this)); _disStateDict.Add(AppearanceType.ProgressiveSpread, new ProgressiveGather(this)); } private void ChangeToNextState() { _currentState.OnExit(); if (_currentState == NullState.Instance) { _currentState = AState; } else if (_currentState == AState) { _currentState = MState; } else if (_currentState == MState) { _currentState = DState; } else { _currentState = NullState.Instance; } _currentState.OnEnter(); } private bool ForceToEnterAppearanceState() { if (_stateProgress > 0f) { return false; } _currentState = AState; _currentState.OnEnter(); return true; } private void ForceToEnterDisappearanceState() { if (_stateProgress < 1f) { _currentState = _disStateDict[AppearanceType.None]; _currentState.OnEnter(); } else { _currentState.OnExit(); _currentState = DState; _currentState.OnEnter(); } } } public record struct TextSettings(Font Font, int FontSize, FontStyle FontStyle, Color FontColor, Color BackgroundColor, AnchorPresets Anchor, Vector2 AnchorOffsets, Vector2 BackgroundSize) { [CompilerGenerated] private readonly bool PrintMembers(StringBuilder builder) { //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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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) builder.Append("Font = "); builder.Append(Font); builder.Append(", FontSize = "); builder.Append(FontSize.ToString()); builder.Append(", FontStyle = "); FontStyle fontStyle = FontStyle; builder.Append(((object)(FontStyle)(ref fontStyle)).ToString()); builder.Append(", FontColor = "); Color val = FontColor; builder.Append(((object)(Color)(ref val)).ToString()); builder.Append(", BackgroundColor = "); val = BackgroundColor; builder.Append(((object)(Color)(ref val)).ToString()); builder.Append(", Anchor = "); builder.Append(Anchor.ToString()); builder.Append(", AnchorOffsets = "); Vector2 val2 = AnchorOffsets; builder.Append(((object)(Vector2)(ref val2)).ToString()); builder.Append(", BackgroundSize = "); val2 = BackgroundSize; builder.Append(((object)(Vector2)(ref val2)).ToString()); return true; } [CompilerGenerated] public readonly void Deconstruct(out Font Font, out int FontSize, out FontStyle FontStyle, out Color FontColor, out Color BackgroundColor, out AnchorPresets Anchor, out Vector2 AnchorOffsets, out Vector2 BackgroundSize) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected I4, but got Unknown //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) Font = this.Font; FontSize = this.FontSize; FontStyle = (FontStyle)(int)this.FontStyle; FontColor = this.FontColor; BackgroundColor = this.BackgroundColor; Anchor = this.Anchor; AnchorOffsets = this.AnchorOffsets; BackgroundSize = this.BackgroundSize; } } public record struct WheelKeyBind(KeyCode KeyCode, KeyCode[] Modifiers) { [CompilerGenerated] private readonly bool PrintMembers(StringBuilder builder) { //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) builder.Append("KeyCode = "); KeyCode keyCode = KeyCode; builder.Append(((object)(KeyCode)(ref keyCode)).ToString()); builder.Append(", Modifiers = "); builder.Append(Modifiers); return true; } [CompilerGenerated] public readonly void Deconstruct(out KeyCode KeyCode, out KeyCode[] Modifiers) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected I4, but got Unknown KeyCode = (KeyCode)(int)this.KeyCode; Modifiers = this.Modifiers; } } } namespace Rito.RadialMenu_v3.Test { public class Test_RadialMenu : MonoBehaviour { public RadialMenu radialMenu; public KeyCode key = (KeyCode)103; [Space] public Sprite[] sprites; private void Start() { radialMenu.SetPieceImageSprites(sprites); } private void Update() { //IL_0001: 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 (Input.GetKeyDown(key)) { radialMenu.Show(); } else if (Input.GetKeyUp(key)) { int num = radialMenu.Hide(); Debug.Log((object)$"Selected : {num}"); } } } } namespace DentedPixel { public class LeanDummy { } } namespace Damntry.UtilsUnity { public class KeyCodeUtils { private static StringBuilder stringBuilder; public static string KeyCombinationToString(bool useLiterals, KeyCode key, string separator = "+", params KeyCode[] modifiers) { //IL_0080: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) if (stringBuilder == null) { stringBuilder = new StringBuilder(); } stringBuilder.Clear(); if (modifiers != null && modifiers.Length != 0) { foreach (KeyCode val in modifiers) { if ((int)val != 0) { stringBuilder.Append(useLiterals ? ((object)val) : KeyCode2UserString(val)).Append(" ").Append(separator) .Append(" "); } } } stringBuilder.Append(useLiterals ? ((object)key) : KeyCode2UserString(key)); return stringBuilder.ToString(); } private static string[] KeyCode2UserString(KeyCode[] keyList) { return keyList.Select((KeyCode k) => KeyCode2UserString(k)).ToArray(); } public static string KeyCode2UserString(KeyCode keyCode) { //IL_0000: 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_0065: Expected I4, but got Unknown //IL_0065: 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_009d: Expected I4, but got Unknown switch (keyCode - 35) { default: switch (keyCode - 303) { case 3: return "Left Ctrl"; case 2: return "Right Ctrl"; case 1: return "Left Shift"; case 0: return "Right Shift"; case 5: return "Left Alt"; case 4: return "Right Alt"; case 10: return "Alt Gr"; case 8: return "Left Win"; case 9: return "Right Win"; } break; case 13: return "0"; case 14: return "1"; case 15: return "2"; case 16: return "3"; case 17: return "4"; case 18: return "5"; case 19: return "6"; case 20: return "7"; case 21: return "8"; case 22: return "9"; case 3: return "&"; case 7: return "*"; case 1: return "$"; case 0: return "#"; case 2: case 4: case 5: case 6: case 8: case 9: case 10: case 11: case 12: break; } return ((object)(KeyCode)(ref keyCode)).ToString(); } } } namespace Damntry.UtilsUnity.Vectors { public class Vector3Curves { private readonly AnimationCurve m_CurveX; private readonly AnimationCurve m_CurveY; private readonly AnimationCurve m_CurveZ; public bool HasGeneratedCurves { get; private set; } public AnimationCurve CurveX => m_CurveX; public AnimationCurve CurveY => m_CurveY; public AnimationCurve CurveZ => m_CurveZ; public Vector3Curves() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown m_CurveX = new AnimationCurve(); m_CurveY = new AnimationCurve(); m_CurveZ = new AnimationCurve(); } public Vector3Curves(Vector3 startPoint, Vector3 endPoint) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0028: 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) m_CurveX = new AnimationCurve(); m_CurveY = new AnimationCurve(); m_CurveZ = new AnimationCurve(); SetLinearVector3(startPoint, endPoint); } public void SetValue(Vector3 value) { //IL_0006: 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_0028: Unknown result type (might be due to invalid IL or missing references) m_CurveX.SetValue(value.x); m_CurveY.SetValue(value.y); m_CurveZ.SetValue(value.z); } public void SetLinearVector3(Vector3 startPoint, Vector3 endPoint) { //IL_000b: 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_0044: 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_007d: 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) m_CurveX.AddKey(0f, startPoint.x); m_CurveX.AddKey(1f, endPoint.x); m_CurveX.SetLinear(); m_CurveY.AddKey(0f, startPoint.y); m_CurveY.AddKey(1f, endPoint.y); m_CurveY.SetLinear(); m_CurveZ.AddKey(0f, startPoint.z); m_CurveZ.AddKey(1f, endPoint.z); m_CurveZ.SetLinear(); HasGeneratedCurves = true; } public Vector3 GetValue(float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) return new Vector3(m_CurveX.Evaluate(time), m_CurveY.Evaluate(time), m_CurveZ.Evaluate(time)); } public void SetWrapMode(WrapMode inMode, WrapMode outMode) { //IL_0006: 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_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_0020: 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) m_CurveX.SetWrapMode(inMode, outMode); m_CurveY.SetWrapMode(inMode, outMode); m_CurveZ.SetWrapMode(inMode, outMode); } } public class Vector3CurvesDistanceWidth : Vector3Curves { public AnimationCurve DistanceWidth { get; set; } public Vector3CurvesDistanceWidth(Vector3 startPoint, Vector3 endPoint, float startWidth, float endWidth, float totalProjectileDistance, float maxTracerWidthDistance) : base(startPoint, endPoint) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown float num = Mathf.Clamp01(totalProjectileDistance / maxTracerWidthDistance); DistanceWidth = new AnimationCurve(); DistanceWidth.AddKey(0f, startWidth); DistanceWidth.AddKey(1f, endWidth * num); DistanceWidth.SetLinear(); } public Vector3 GetValue(float time, out float tracerWidth) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) tracerWidth = DistanceWidth.Evaluate(time); return GetValue(time); } } public static class AnimationCurveExtensions { public static void Clear(this AnimationCurve extends) { for (int i = 0; i < extends.length; i++) { extends.RemoveKey(i); } } public static void SetValue(this AnimationCurve extends, float value) { extends.Clear(); extends.AddKey(0f, value); extends.AddKey(1f, value); } public static void SetWrapMode(this AnimationCurve extends, WrapMode inMode, WrapMode outMode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) extends.preWrapMode = inMode; extends.postWrapMode = outMode; } public static void SetLinear(this AnimationCurve extends) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_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_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) Vector2 val3 = default(Vector2); Vector2 val4 = default(Vector2); for (int i = 0; i < extends.length; i++) { Keyframe val = extends[i]; Keyframe val2; if (i != 0) { val2 = extends[i - 1]; val3.x = ((Keyframe)(ref val2)).time; val2 = extends[i - 1]; val3.y = ((Keyframe)(ref val2)).value; val2 = extends[i]; val4.x = ((Keyframe)(ref val2)).time; val2 = extends[i]; val4.y = ((Keyframe)(ref val2)).value; Vector2 val5 = val4 - val3; ((Keyframe)(ref val)).inTangent = val5.y / val5.x; } if (i != extends.length - 1) { val2 = extends[i]; val3.x = ((Keyframe)(ref val2)).time; val2 = extends[i]; val3.y = ((Keyframe)(ref val2)).value; val2 = extends[i + 1]; val4.x = ((Keyframe)(ref val2)).time; val2 = extends[i + 1]; val4.y = ((Keyframe)(ref val2)).value; Vector2 val5 = val4 - val3; ((Keyframe)(ref val)).outTangent = val5.y / val5.x; } extends.MoveKey(i, val); } } } public enum SpreadAxis { Horizontal, Vertical, Both } public static class VectorUtils { public static Vector3 GetRandomSpreadOffset(SpreadAxis spreadAxis, Vector3 direction, Vector3 initialVelocity, float spread) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_000b: Unknown result type (might be due to invalid IL or missing references) Quaternion direction2 = Quaternion.LookRotation(direction); return GetRandomXY_Offset(spreadAxis, direction2, initialVelocity, spread); } public static Vector3 GetRandomXY_Offset(SpreadAxis spreadAxis, Quaternion direction, Vector3 initialVelocity, float spread) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_001d: 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_0015: 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_0040: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) Vector2 val = Random.insideUnitCircle * spread; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((spreadAxis == SpreadAxis.Horizontal || spreadAxis == SpreadAxis.Both) ? (initialVelocity.x + val.x) : initialVelocity.x, (spreadAxis == SpreadAxis.Vertical || spreadAxis == SpreadAxis.Both) ? (initialVelocity.y + val.y) : initialVelocity.y, initialVelocity.z); return direction * val2; } public static Vector3 GetRandomSpreadDirection(this Camera camera, SpreadAxis spreadAxis, Vector3 direction, float spreadAngle) { //IL_0027: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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) if (!Object.op_Implicit((Object)(object)camera)) { TimeLogger.Logger.LogError($"The camera object is null (Spread angle {spreadAngle}).", (LogCategories)int.MinValue); return Vector3.zero; } Transform transform = ((Component)camera).transform; if (!Object.op_Implicit((Object)(object)transform)) { TimeLogger.Logger.LogError($"The camera transform is null (Spread angle {spreadAngle}).", (LogCategories)int.MinValue); return Vector3.zero; } return GetRandomSpreadDirection(spreadAxis, transform.up, transform.right, spreadAngle) * direction; } public static Quaternion GetRandomSpreadDirection(SpreadAxis spreadAxis, Vector3 relativeUp, Vector3 relativeRight, float spreadAngle) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_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_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_0020: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Random.insideUnitCircle * spreadAngle; Quaternion val2 = Quaternion.identity; if (spreadAxis == SpreadAxis.Horizontal || spreadAxis == SpreadAxis.Both) { val2 *= Quaternion.AngleAxis(val.x, relativeRight); } if (spreadAxis == SpreadAxis.Vertical || spreadAxis == SpreadAxis.Both) { val2 *= Quaternion.AngleAxis(val.y, relativeUp); } return val2; } public static Vector3 GetRandomWorldPosOffset(this Camera camera, SpreadAxis spreadAxis, Vector3 position, float spread) { //IL_0027: 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_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_0069: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)camera)) { TimeLogger.Logger.LogError($"The camera object is null (Spread {spread}).", (LogCategories)int.MinValue); return Vector3.zero; } if (!Object.op_Implicit((Object)(object)((Component)camera).transform)) { TimeLogger.Logger.LogError("The transform object is null.", (LogCategories)int.MinValue); return Vector3.zero; } if (spread == 0f) { return position; } Vector2 val = Random.insideUnitCircle * spread; if (spreadAxis == SpreadAxis.Horizontal) { val.y = 0f; } if (spreadAxis == SpreadAxis.Vertical) { val.x = 0f; } return position + OffsetTransformPos(((Component)camera).transform, Vector2.op_Implicit(val)); } public static Vector3 OffsetTransformPos(Transform transform, Vector3 offset) { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0044: 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_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_001c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)transform)) { TimeLogger.Logger.LogError("The transform object is null.", (LogCategories)int.MinValue); return Vector3.zero; } return transform.right * offset.x + transform.up * offset.y + transform.forward * offset.z; } } } namespace Damntry.UtilsUnity.UI { public static class CanvasMethods { public static void AttachPanelToCanvas(GameObject mainPanel, Transform canvasTransformParent) { CheckAttachArgs(mainPanel, canvasTransformParent); mainPanel.transform.SetParent(canvasTransformParent); } public static void AttachPanelToCanvasWithAnchor(GameObject mainPanel, Transform canvasTransformParent) { //IL_002b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) CheckAttachArgs(mainPanel, canvasTransformParent); mainPanel.transform.SetParent(canvasTransformParent); RectTransform component = mainPanel.GetComponent(); component.SetAnchor(AnchorPresets.TopCenter); component.sizeDelta = Vector2.zero; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; component.anchoredPosition = Vector2.zero; } private static void CheckAttachArgs(GameObject mainPanel, Transform canvasTransformParent) { if ((Object)(object)mainPanel == (Object)null) { throw new ArgumentNullException("mainPanel"); } if ((Object)(object)canvasTransformParent == (Object)null) { throw new ArgumentNullException("canvasTransformParent"); } } } } namespace Damntry.UtilsUnity.UI.Extensions { public enum AnchorPresets { TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottonCenter, BottomRight, BottomStretch, VertStretchLeft, VertStretchRight, VertStretchCenter, HorStretchTop, HorStretchMiddle, HorStretchBottom, StretchAll } public enum PivotPresets { TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight } public static class RectTransformExtensions { public static void SetAnchor(this RectTransform source, AnchorPresets alignment, float offsetX = 0f, float offsetY = 0f) { //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_0103: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) source.anchoredPosition = Vector2.op_Implicit(new Vector3(offsetX, offsetY, 0f)); switch (alignment) { case AnchorPresets.TopLeft: source.anchorMin = new Vector2(0f, 1f); source.anchorMax = new Vector2(0f, 1f); break; case AnchorPresets.TopCenter: source.anchorMin = new Vector2(0.5f, 1f); source.anchorMax = new Vector2(0.5f, 1f); break; case AnchorPresets.TopRight: source.anchorMin = new Vector2(1f, 1f); source.anchorMax = new Vector2(1f, 1f); break; case AnchorPresets.MiddleLeft: source.anchorMin = new Vector2(0f, 0.5f); source.anchorMax = new Vector2(0f, 0.5f); break; case AnchorPresets.MiddleCenter: source.anchorMin = new Vector2(0.5f, 0.5f); source.anchorMax = new Vector2(0.5f, 0.5f); break; case AnchorPresets.MiddleRight: source.anchorMin = new Vector2(1f, 0.5f); source.anchorMax = new Vector2(1f, 0.5f); break; case AnchorPresets.BottomLeft: source.anchorMin = new Vector2(0f, 0f); source.anchorMax = new Vector2(0f, 0f); break; case AnchorPresets.BottonCenter: source.anchorMin = new Vector2(0.5f, 0f); source.anchorMax = new Vector2(0.5f, 0f); break; case AnchorPresets.BottomRight: source.anchorMin = new Vector2(1f, 0f); source.anchorMax = new Vector2(1f, 0f); break; case AnchorPresets.HorStretchTop: source.anchorMin = new Vector2(0f, 1f); source.anchorMax = new Vector2(1f, 1f); break; case AnchorPresets.HorStretchMiddle: source.anchorMin = new Vector2(0f, 0.5f); source.anchorMax = new Vector2(1f, 0.5f); break; case AnchorPresets.HorStretchBottom: source.anchorMin = new Vector2(0f, 0f); source.anchorMax = new Vector2(1f, 0f); break; case AnchorPresets.VertStretchLeft: source.anchorMin = new Vector2(0f, 0f); source.anchorMax = new Vector2(0f, 1f); break; case AnchorPresets.VertStretchCenter: source.anchorMin = new Vector2(0.5f, 0f); source.anchorMax = new Vector2(0.5f, 1f); break; case AnchorPresets.VertStretchRight: source.anchorMin = new Vector2(1f, 0f); source.anchorMax = new Vector2(1f, 1f); break; case AnchorPresets.StretchAll: source.anchorMin = new Vector2(0f, 0f); source.anchorMax = new Vector2(1f, 1f); break; case AnchorPresets.BottomStretch: break; } } public static void SetPivot(this RectTransform source, PivotPresets pivotPreset) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) //IL_00d0: 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) switch (pivotPreset) { case PivotPresets.TopLeft: source.pivot = new Vector2(0f, 1f); break; case PivotPresets.TopCenter: source.pivot = new Vector2(0.5f, 1f); break; case PivotPresets.TopRight: source.pivot = new Vector2(1f, 1f); break; case PivotPresets.MiddleLeft: source.pivot = new Vector2(0f, 0.5f); break; case PivotPresets.MiddleCenter: source.pivot = new Vector2(0.5f, 0.5f); break; case PivotPresets.MiddleRight: source.pivot = new Vector2(1f, 0.5f); break; case PivotPresets.BottomLeft: source.pivot = new Vector2(0f, 0f); break; case PivotPresets.BottomCenter: source.pivot = new Vector2(0.5f, 0f); break; case PivotPresets.BottomRight: source.pivot = new Vector2(1f, 0f); break; } } public static void SetAnchorAndPivot(this RectTransform source, AnchorPresets alignment, PivotPresets pivotPreset, int offsetX = 0, int offsetY = 0) { source.SetAnchor(alignment, offsetX, offsetY); source.SetPivot(pivotPreset); } } } namespace Damntry.UtilsUnity.Timers { public class CachedTimeValues { private static UnityTimeStopwatch unitySW; private static float fixedDeltaTime; private static int fixedUpdateCycleMax; public static FixedTimes GetFixedTimeCachedValues() { if (unitySW == null || unitySW.ElapsedSecondsPrecise > 1.0) { if (unitySW == null) { unitySW = UnityTimeStopwatch.StartNew(UnityTimeStopwatch.TimeType.FixedTime); } fixedDeltaTime = Time.fixedDeltaTime; fixedUpdateCycleMax = (int)Math.Round(1f / fixedDeltaTime); } return new FixedTimes(fixedDeltaTime, fixedUpdateCycleMax); } } public record struct FixedTimes(float fixedDeltaTime, int fixedUpdateCycleMax); public class UnityTimeStopwatch : IStopwatch { public enum TimeType { Time, FixedTime, UnscaledTime, UnscaledFixedTime } private double elapsed; private double startTimeStamp; private bool isRunning; private TimeType timeType; public bool IsRunning => isRunning; public long ElapsedMilliseconds => (long)GetElapsedSeconds(highPrecision: false) * 1000; public long ElapsedSeconds => (long)GetElapsedSeconds(highPrecision: false); public double ElapsedMillisecondsPrecise => GetElapsedSeconds(highPrecision: true) * 1000.0; public double ElapsedSecondsPrecise => GetElapsedSeconds(highPrecision: true); static UnityTimeStopwatch() { } public UnityTimeStopwatch() { timeType = TimeType.Time; Reset(); } public UnityTimeStopwatch(TimeType timeType) { this.timeType = timeType; Reset(); } public void Start() { if (!isRunning) { startTimeStamp = GetTimestampDouble(); isRunning = true; } } public static UnityTimeStopwatch StartNew() { UnityTimeStopwatch unityTimeStopwatch = new UnityTimeStopwatch(); unityTimeStopwatch.Start(); return unityTimeStopwatch; } public static UnityTimeStopwatch StartNew(TimeType timeType) { UnityTimeStopwatch unityTimeStopwatch = new UnityTimeStopwatch(timeType); unityTimeStopwatch.Start(); return unityTimeStopwatch; } public void Stop() { if (isRunning) { double num = GetTimestampDouble() - startTimeStamp; elapsed += num; isRunning = false; if (elapsed < 0.0) { elapsed = 0.0; } } } public void Reset() { elapsed = 0.0; isRunning = false; startTimeStamp = 0.0; } public void Restart() { elapsed = 0.0; startTimeStamp = GetTimestampDouble(); isRunning = true; } private float GetTimestamp() { return timeType switch { TimeType.Time => Time.time, TimeType.FixedTime => Time.fixedTime, TimeType.UnscaledTime => Time.unscaledTime, TimeType.UnscaledFixedTime => Time.fixedUnscaledTime, _ => throw new NotImplementedException(), }; } private double GetTimestampDouble() { return timeType switch { TimeType.Time => Time.timeAsDouble, TimeType.FixedTime => Time.fixedTimeAsDouble, TimeType.UnscaledTime => Time.unscaledTimeAsDouble, TimeType.UnscaledFixedTime => Time.fixedUnscaledTimeAsDouble, _ => throw new NotImplementedException(), }; } private double GetElapsedSeconds(bool highPrecision) { double num = elapsed; if (isRunning) { num += (highPrecision ? GetTimestampDouble() : ((double)GetTimestamp())) - startTimeStamp; } return num; } } } namespace Damntry.UtilsUnity.Tasks.AsyncDelay { public class UniTaskDelay : AsyncDelayBase { public override Task Delay(int millisecondsDelay) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) return UniTaskExtensions.AsTask(UniTask.Delay(AdaptToUnitask(millisecondsDelay), false, (PlayerLoopTiming)8, default(CancellationToken), false)); } public override Task Delay(int millisecondsDelay, CancellationToken cancellationToken) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return UniTaskExtensions.AsTask(UniTask.Delay(AdaptToUnitask(millisecondsDelay), false, (PlayerLoopTiming)8, cancellationToken, false)); } private int AdaptToUnitask(int millisecondsDelay) { if (millisecondsDelay < 0) { return int.MaxValue; } return millisecondsDelay; } } } namespace Damntry.UtilsUnity.Resources { public class AssetBundleElement { private static Dictionary bundleCacheStorage = new Dictionary(); private readonly string assetBundlePath; private AssetBundle loadedBundle; public AssetBundleElement(Type assemblyType, string assetRelativeFilePath) { if (assemblyType == null) { throw new ArgumentNullException("assemblyType"); } if (string.IsNullOrEmpty(assetRelativeFilePath)) { throw new ArgumentNullException("The parameter assetRelativeFilePath cant be null or empty."); } assetBundlePath = AssemblyUtils.GetCombinedPathFromAssemblyFolder(assemblyType, assetRelativeFilePath); if (!File.Exists(assetBundlePath)) { throw new FileNotFoundException(null, assetBundlePath); } } public AssetBundleElement(string assetFullPath) { if (string.IsNullOrEmpty(assetFullPath)) { throw new ArgumentNullException("The parameter assetFullPath cant be null or empty."); } if (!File.Exists(assetFullPath)) { throw new FileNotFoundException(null, assetFullPath); } assetBundlePath = assetFullPath; } public bool PreloadBundle() { if ((Object)(object)loadedBundle == (Object)null) { if (!bundleCacheStorage.TryGetValue(assetBundlePath, out loadedBundle) || (Object)(object)loadedBundle == (Object)null) { loadedBundle = AssetBundle.LoadFromFile(assetBundlePath); if ((Object)(object)loadedBundle == (Object)null) { throw new LoadBundleFileException(assetBundlePath); } TimeLogger.Logger.LogDebug("Bundle loaded successfully from " + assetBundlePath, (LogCategories)8); bundleCacheStorage.Add(assetBundlePath, loadedBundle); } else { TimeLogger.Logger.LogDebug("Bundle loaded successfully from storage cache.", (LogCategories)8); } } return true; } public string[] GetAllAssetNames() { if (!PreloadBundle()) { return null; } return loadedBundle.GetAllAssetNames(); } public string GetAllAssetNamesString(string separator = "\n") { string[] allAssetNames = GetAllAssetNames(); if (allAssetNames == null) { return null; } return string.Join(separator, allAssetNames); } public async Task LoadAllAssetsAsync() where T : Object { if (!PreloadBundle()) { return null; } AssetBundleRequest assetRequest = loadedBundle.LoadAllAssetsAsync(typeof(T)); ResourceRequestAwaiter val = UnityAsyncExtensions.GetAwaiter((ResourceRequest)(object)assetRequest); if (!((ResourceRequestAwaiter)(ref val)).IsCompleted) { await val; ResourceRequestAwaiter val2 = default(ResourceRequestAwaiter); val = val2; } ((ResourceRequestAwaiter)(ref val)).GetResult(); return assetRequest.allAssets.Cast().ToArray(); } public T[] LoadAllAssets() where T : Object { if (!PreloadBundle()) { return null; } return loadedBundle.LoadAllAssets().ToArray(); } public bool TryLoadNewPrefabInstance(string prefabName, out GameObject prefabInstance) { prefabInstance = null; string bundleInternalUnityPath = "assets/" + prefabName + ".prefab"; if (!this.TryLoadObject(bundleInternalUnityPath, out GameObject objectInstance)) { return false; } prefabInstance = Object.Instantiate(objectInstance); return true; } public bool TryLoadObject(string bundleInternalUnityPath, out T objectInstance) where T : Object { objectInstance = default(T); if (!TryLoadPrefabObject(bundleInternalUnityPath, out Object loadedObject)) { return false; } if (!(loadedObject is T)) { TimeLogger.Logger.LogError("The object at " + bundleInternalUnityPath + " is not a " + typeof(T).Name + " type.", (LogCategories)8); return false; } objectInstance = (T)(object)loadedObject; return true; } private bool TryLoadPrefabObject(string bundleInternalUnityPath, out T loadedObject) where T : Object { loadedObject = default(T); if (!PreloadBundle()) { return false; } loadedObject = loadedBundle.LoadAsset(bundleInternalUnityPath); if ((Object)(object)loadedObject == (Object)null) { TimeLogger.Logger.LogDebug("Asset loaded with path \"" + bundleInternalUnityPath + "\" not found.", (LogCategories)8); return false; } return true; } public void UnloadBundle() { if ((Object)(object)loadedBundle == (Object)null) { TimeLogger.Logger.LogDebug("No loaded bundle was found while trying to unload.", (LogCategories)8); return; } loadedBundle.Unload(true); loadedBundle = null; bundleCacheStorage.Remove(assetBundlePath); TimeLogger.Logger.LogDebug("Asset bundle at " + assetBundlePath + " unloaded successfully.", (LogCategories)8); } } public class LoadBundleFileException : Exception { public LoadBundleFileException(string assetPath) : base("Failed to load asset bundle from path: " + assetPath + ".") { } } } namespace Damntry.UtilsUnity.Rendering { public static class AssetLoading { public static Sprite GetSpriteFromFile(string imagePath, Vector2 pivot, GraphicsFormat graphicFormat = 4, bool nonReadable = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return GetSpriteFromTexture(GetTextureFromFile(imagePath, graphicFormat, nonReadable), pivot); } public static Sprite GetSpriteFromTexture(Texture2D texture, Vector2 pivot) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)texture)) { TimeLogger.Logger.LogError("Texture object is not initialized", (LogCategories)268435456); return null; } return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), pivot, 100f, 0u, (SpriteMeshType)1); } private static Texture2D GetTextureFromFile(string imagePath, GraphicsFormat graphicFormat = 4, bool nonReadable = true) { //IL_0005: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0041: Expected O, but got Unknown TextureCreationFlags val = (TextureCreationFlags)1029; Texture2D val2 = new Texture2D(4, 4, graphicFormat, val) { name = Path.GetFileName(imagePath), anisoLevel = 1, filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; byte[] array = File.ReadAllBytes(imagePath); ImageConversion.LoadImage(val2, array, nonReadable); return val2; } } public class MeshUtils { public static GameObject CreateQuadPrimitive(string name, float width, float height, bool shadowsOff = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0031: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().mesh = CreateQuadMesh(width, height); Renderer val2 = (Renderer)(object)val.AddComponent(); if (shadowsOff) { val2.shadowCastingMode = (ShadowCastingMode)0; val2.receiveShadows = false; } return val; } public static GameObject CreatePlanePrimitive(string name, float width, float height, bool shadowsOff = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0031: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().mesh = CreatePlaneMesh(width, height); Renderer val2 = (Renderer)(object)val.AddComponent(); if (shadowsOff) { val2.shadowCastingMode = (ShadowCastingMode)0; val2.receiveShadows = false; } return val; } public static GameObject CreateCubePrimitive(string name, float width, float height, float depth, bool shadowsOff = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0033: Expected O, but got Unknown GameObject val = new GameObject(name); val.AddComponent().mesh = CreateCubeMesh(width, height, depth); Renderer val2 = (Renderer)(object)val.AddComponent(); if (shadowsOff) { val2.shadowCastingMode = (ShadowCastingMode)0; val2.receiveShadows = false; } return val; } public static Mesh CreateQuadMesh(float width, float height) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_001d: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); Vector3[] vertices = (Vector3[])(object)new Vector3[4] { new Vector3(0f, 0f, 0f), new Vector3(width, 0f, 0f), new Vector3(0f, height, 0f), new Vector3(width, height, 0f) }; val.vertices = vertices; int[] triangles = new int[6] { 0, 2, 1, 2, 3, 1 }; val.triangles = triangles; Vector3[] normals = (Vector3[])(object)new Vector3[4] { -Vector3.forward, -Vector3.forward, -Vector3.forward, -Vector3.forward }; val.normals = normals; Vector2[] uv = (Vector2[])(object)new Vector2[4] { new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0f, 1f), new Vector2(1f, 1f) }; val.uv = uv; return val; } public static Mesh CreatePlaneMesh(float width, float height) { int widthSegments = Mathf.Max(1, Mathf.RoundToInt(width)); int heightSegments = Mathf.Max(1, Mathf.RoundToInt(height)); return CreatePlaneMesh(width, height, widthSegments, heightSegments); } public static Mesh CreatePlaneMesh(float width, float height, int widthSegments = 10, int heightSegments = 10) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown widthSegments = Mathf.Max(1, widthSegments); heightSegments = Mathf.Max(1, heightSegments); float num = width * 0.5f; float num2 = height * 0.5f; int num3 = (widthSegments + 1) * (heightSegments + 1); int num4 = widthSegments * heightSegments * 6; Vector3[] array = (Vector3[])(object)new Vector3[num3]; Vector3[] array2 = (Vector3[])(object)new Vector3[num3]; Vector4[] array3 = (Vector4[])(object)new Vector4[num3]; Vector2[] array4 = (Vector2[])(object)new Vector2[num3]; int[] array5 = new int[num4]; int num5 = 0; for (int i = 0; i <= heightSegments; i++) { float num6 = (float)i / (float)heightSegments; float num7 = num6 * height - num2; for (int j = 0; j <= widthSegments; j++) { float num8 = (float)j / (float)widthSegments; float num9 = num8 * width - num; array[num5] = new Vector3(num9, 0f, num7); array2[num5] = Vector3.up; array3[num5] = new Vector4(1f, 0f, 0f, -1f); array4[num5] = new Vector2(num8, num6); num5++; } } int num10 = 0; int num11 = 0; for (int k = 0; k < heightSegments; k++) { for (int l = 0; l < widthSegments; l++) { array5[num10++] = num11; array5[num10++] = num11 + widthSegments + 1; array5[num10++] = num11 + 1; array5[num10++] = num11 + 1; array5[num10++] = num11 + widthSegments + 1; array5[num10++] = num11 + widthSegments + 2; num11++; } num11++; } Mesh val = new Mesh { name = "Plane", vertices = array, normals = array2, tangents = array3, uv = array4, triangles = array5 }; val.RecalculateBounds(); return val; } public static Mesh CreateCubeMesh(float width, float height, float depth) { //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_0036: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0066: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0099: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Expected O, but got Unknown float num = width * 0.5f; float num2 = height * 0.5f; float num3 = depth * 0.5f; Vector3[] vertices = (Vector3[])(object)new Vector3[24] { new Vector3(0f - num, 0f - num2, num3), new Vector3(num, 0f - num2, num3), new Vector3(num, num2, num3), new Vector3(0f - num, num2, num3), new Vector3(num, 0f - num2, 0f - num3), new Vector3(0f - num, 0f - num2, 0f - num3), new Vector3(0f - num, num2, 0f - num3), new Vector3(num, num2, 0f - num3), new Vector3(0f - num, 0f - num2, 0f - num3), new Vector3(0f - num, 0f - num2, num3), new Vector3(0f - num, num2, num3), new Vector3(0f - num, num2, 0f - num3), new Vector3(num, 0f - num2, num3), new Vector3(num, 0f - num2, 0f - num3), new Vector3(num, num2, 0f - num3), new Vector3(num, num2, num3), new Vector3(0f - num, num2, num3), new Vector3(num, num2, num3), new Vector3(num, num2, 0f - num3), new Vector3(0f - num, num2, 0f - num3), new Vector3(0f - num, 0f - num2, 0f - num3), new Vector3(num, 0f - num2, 0f - num3), new Vector3(num, 0f - num2, num3), new Vector3(0f - num, 0f - num2, num3) }; Vector3[] normals = (Vector3[])(object)new Vector3[24] { Vector3.forward, Vector3.forward, Vector3.forward, Vector3.forward, Vector3.back, Vector3.back, Vector3.back, Vector3.back, Vector3.left, Vector3.left, Vector3.left, Vector3.left, Vector3.right, Vector3.right, Vector3.right, Vector3.right, Vector3.up, Vector3.up, Vector3.up, Vector3.up, Vector3.down, Vector3.down, Vector3.down, Vector3.down }; Vector4 val = default(Vector4); ((Vector4)(ref val))..ctor(1f, 0f, 0f, -1f); Vector4[] array = (Vector4[])(object)new Vector4[24]; for (int i = 0; i < array.Length; i++) { array[i] = val; } Vector2[] uv = (Vector2[])(object)new Vector2[24] { new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(1f, 1f), new Vector2(0f, 1f) }; int[] triangles = new int[36] { 0, 2, 1, 0, 3, 2, 4, 6, 5, 4, 7, 6, 8, 10, 9, 8, 11, 10, 12, 14, 13, 12, 15, 14, 16, 18, 17, 16, 19, 18, 20, 22, 21, 20, 23, 22 }; Mesh val2 = new Mesh { name = "Cube", vertices = vertices, normals = normals, tangents = array, uv = uv, triangles = triangles }; val2.RecalculateBounds(); return val2; } } public class TextureUtils { public static Texture2D GenerateRectangle(Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_001b: 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) int num = 1; Texture2D val = new Texture2D(1, num, (TextureFormat)4, false); Color32[] array = (Color32[])(object)new Color32[1 * num]; for (int i = 0; i < array.Length; i++) { array[i] = Color32.op_Implicit(color); } val.SetPixels32(array); val.Apply(); return val; } public static Texture2D GenerateCircle(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); ((Texture)val).filterMode = (FilterMode)1; float num = (float)size / 2f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = (float)j - num; float num3 = (float)i - num; float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3) / num; float num5 = Mathf.Clamp01(1f - num4); val.SetPixel(j, i, new Color(1f, 1f, 1f, num5)); } } val.Apply(); return val; } public static Texture2D GenerateRectRoundCorners(int width, int height, float radius, float edgeSoftness, Color fillColor) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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) Texture2D val = new Texture2D(width, height, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; Vector2 val2 = new Vector2((float)width, (float)height) * 0.5f; Vector2 rect = val2 - new Vector2(radius, radius); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { float num = SignedDistanceRoundedRect(new Vector2((float)j + 0.5f, (float)i + 0.5f) - val2, rect, radius); float num2 = 1f - Mathf.SmoothStep(0f - edgeSoftness, edgeSoftness, num); Color val3 = fillColor; val3.a *= num2; val.SetPixel(j, i, val3); } } val.Apply(); return val; } private static float SignedDistanceRoundedRect(Vector2 p, Vector2 rect, float radius) { //IL_0000: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) Vector2 val = new Vector2(Mathf.Abs(p.x), Mathf.Abs(p.y)) - rect; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(Mathf.Max(val.x, 0f), Mathf.Max(val.y, 0f)); float magnitude = ((Vector2)(ref val2)).magnitude; float num = Mathf.Min(Mathf.Max(val.x, val.y), 0f); return magnitude + num - radius; } } } namespace Damntry.UtilsUnity.ExtensionMethods { public static class UnityObjectExtensions { public static GameObject GameObject(this Component comp) { if (!Object.op_Implicit((Object)(object)comp)) { return null; } return comp.gameObject; } public static T NullableObject(this T obj) where T : Object { if (!Object.op_Implicit((Object)(object)obj)) { return default(T); } return obj; } public static T AssignIfDeadReference(ref T obj, T instance) where T : Object { if (!Object.op_Implicit((Object)(object)obj)) { obj = instance; } return obj; } public static void RemoveDeadKeyReferences(this Dictionary dict) where T1 : Component { KeyValuePair[] array = dict.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (!Object.op_Implicit((Object)(object)keyValuePair.Key)) { dict.Remove(keyValuePair.Key); } } } public static void RemoveDeadValueReferences(this Dictionary dict) where T2 : Component { KeyValuePair[] array = dict.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; if (!Object.op_Implicit((Object)(object)keyValuePair.Value)) { dict.Remove(keyValuePair.Key); } } } } } namespace Damntry.UtilsUnity.Components.InputManagement { public enum InputState { KeyDown, KeyUp, KeyHeld } [Flags] public enum ModifierMask { None = 0, LeftControl = 1, RightControl = 2, LeftShift = 4, RightShift = 8, LeftAlt = 0x10, RightAlt = 0x20, AltGr = 0x40, LeftWindows = 0x80, RightWindows = 0x100 } public enum OnValidationError { Rollback, ClearKeycodes } public enum HotkeyAddResult { Sucess, AddedWithFailure, Failure } public class InputDetection { public delegate void HotkeyValidationErrorDel(string hotkeyName, string errorMessage); private class InputMonobehaviour : MonoBehaviour { private static InputDetection InputInstance; public static InputMonobehaviour Instance { get; private set; } public static void Initialize(InputDetection keyPressDetectionInstance) { InputInstance = keyPressDetectionInstance; } private bool IsKeyPrecheckPassed() { if (InputInstance.PreKeyCheckFunc != null) { return InputInstance.PreKeyCheckFunc(); } return true; } private void Awake() { Instance = this; } private void Start() { BehaviourEnabledCheck(); } private void Update() { if (!IsKeyPrecheckPassed() || InputInstance.groupedKeysCache == null || InputInstance.groupedKeysCache.Count() == 0) { return; } ModifierMask pressedModifMask = KeyCodeModifiersToMask(GetPressedModifiers()); foreach (IGrouping item in InputInstance.groupedKeysCache) { InputData[] array = (from i in item where i.IsModifierCompatible(pressedModifMask) select i into k orderby CountFlags(k.KeyContext.ModifiersMask) descending, k.KeyContext.HotkeyContext.Priority descending select k).ToArray(); foreach (InputData inputData in array) { if (inputData.KeyContext.IsTriggeredWithContext(pressedModifMask, ignoreModifiers: true)) { if (inputData.IsNotInCooldown()) { inputData.PerformHotkeyAction(); } break; } } } } private static int CountFlags(ModifierMask modifierMask) { return new BitArray(new int[1] { (int)modifierMask }).OfType().Count((bool x) => x); } private void OnDestroy() { TaskExtensionMethods.FireAndForget(InputInstance.BeginGetBehaviour(), (LogCategories)33554432); } internal void BehaviourEnabledCheck() { if (Object.op_Implicit((Object)(object)this)) { ((Behaviour)this).enabled = InputInstance.HasTriggerableKeys(); } } } private sealed class IgnoreModifierComparer : IEqualityComparer { public bool Equals(KeyBindState o1, KeyBindState o2) { //IL_0001: 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) if (o1.KeyCode == o2.KeyCode) { return o1.TriggerInputState == o2.TriggerInputState; } return false; } public int GetHashCode(KeyBindState o) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return HashCode.Combine(o.KeyCode, o.TriggerInputState); } } private readonly struct ValidationResult { public static ValidationResult Valid = new ValidationResult(isValid: true, ""); public bool IsValid { get; } public string ErrorMessage { get; } public ValidationResult(bool isValid, string errorMessage) { IsValid = isValid; ErrorMessage = errorMessage; } } private static InputDetection _instance; private static Type typeBinding; private static readonly KeyCode[] SupportedModifiersList; protected const int DefaultKeyPressCooldown = 65; private static IgnoreModifierComparer comparer; private IEnumerable> groupedKeysCache; private List _restrictedKeyBinds; private bool restrictModifiers; protected Func GetBehaviourAttachFunc; public static InputDetection Instance => _instance ?? (_instance = new InputDetection(typeof(InputDetection), OnValidationError.Rollback, restrictModifiers: false, new List())); protected Dictionary KeyPressActions { get; private set; } public Dictionary> NamedGroupsCache { get; private set; } public List RestrictedKeyBinds { get { return _restrictedKeyBinds; } set { _restrictedKeyBinds = value ?? new List(); } } protected Func PreKeyCheckFunc { get; private set; } public OnValidationError OnValidationError { get; set; } public event Action OnHotkeyValidationError; protected virtual void HotkeyValidationError(string hotkeyName, string message, KeyBind keyBind) { this.OnHotkeyValidationError?.Invoke(hotkeyName, message, keyBind); } protected InputDetection(Type callingKeypressClass, OnValidationError onValidationError, bool restrictModifiers, [ParamCollection] List restrictedKeyBinds) { InitializeInputSingleton(callingKeypressClass); KeyPressActions = new Dictionary(); NamedGroupsCache = new Dictionary>(); comparer = new IgnoreModifierComparer(); OnValidationError = onValidationError; RestrictedKeyBinds = restrictedKeyBinds; if (RestrictedKeyBinds.RemoveAll((KeyBind k) => (int)k.KeyCode == 0) > 0) { TimeLogger.Logger.LogWarning("The restrictedKeyBinds parameter contained keybinds with a 'None' KeyCode and they were removed. Restricting modifiers from being used in any combination is not supported, you can ony restrict specific Key + Modifier combinations, or using the modifier by itself. If you only wanted to remove the modifier as a whole keybind, set it in the KeyBind.KeyCode.", (LogCategories)33554432); } this.restrictModifiers = restrictModifiers; } protected bool HasTriggerableKeys() { return KeyPressActions.Where((KeyValuePair k) => !k.Value.KeyContext.IsSuppressedKeyCode).Any(); } private bool IsRestrictedKeyBind(KeyBind keyBind) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!RestrictedKeyBinds.Any((KeyBind k) => k == keyBind)) { if (restrictModifiers) { return SupportedModifiersList.Contains(keyBind.KeyCode); } return false; } return true; } private void InitializeInputSingleton(Type callingKeypressClass) { if (callingKeypressClass == null) { throw new ArgumentNullException("The type parameter cannot be null."); } if (callingKeypressClass != typeof(InputDetection) && !callingKeypressClass.IsSubclassOf(typeof(InputDetection))) { throw new InvalidOperationException("The type parameter must be a 'InputDetection' or a type deriving from it."); } if (typeBinding != null) { if (!(typeBinding == callingKeypressClass)) { throw new InvalidOperationException("'" + callingKeypressClass.Name + "' is currently trying to get initialized, but " + typeBinding.Name + " has already done so before.Only a single 'InputDetection' or derived class can be initialized."); } TimeLogger.Logger.LogError("The class has already been initialized before.", (LogCategories)33554432); } else { InputMonobehaviour.Initialize(this); typeBinding = callingKeypressClass; } } private void GenerateKeyGroupCache() { groupedKeysCache = KeyPressActions.Select((KeyValuePair k) => k.Value).GroupBy((InputData i) => i.KeyContext, comparer); } public async Task InitializeAsync(Func getBehaviourAttachFunc, Func preKeyCheckFunc = null) { GetBehaviourAttachFunc = getBehaviourAttachFunc; PreKeyCheckFunc = preKeyCheckFunc; await BeginGetBehaviour(); } protected async Task BeginGetBehaviour() { MonoBehaviour val; while ((Object)(object)(val = GetBehaviourAttachFunc()) == (Object)null || !((Component)val).gameObject.activeInHierarchy) { await Task.Delay(500); } AddDetectionComponent(val); } private void AddDetectionComponent(MonoBehaviour unityObject) { if ((Object)(object)unityObject == (Object)null) { throw new ArgumentNullException("unityObject"); } AddDetectionComponent(((Component)unityObject).gameObject); } private void AddDetectionComponent(GameObject unityGameObject) { if ((Object)(object)unityGameObject == (Object)null) { throw new ArgumentNullException("unityGameObject"); } unityGameObject.AddComponent(); } public virtual bool TryAddHotkey(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers, InputState inputState, HotkeyContext hotkeyContext, Action action) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return AddHotkeyInternal(hotkeyName, keyCode, modifiers, inputState, hotkeyContext, 65, action, null) == HotkeyAddResult.Sucess; } public virtual bool TryAddHotkey(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers, InputState inputState, HotkeyContext hotkeyContext, int cooldownMillis, Action action) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return AddHotkeyInternal(hotkeyName, keyCode, modifiers, inputState, hotkeyContext, cooldownMillis, action, null) == HotkeyAddResult.Sucess; } protected HotkeyAddResult AddHotkeyInternal(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers, InputState inputState, HotkeyContext hotkeyContext, int cooldownMillis, Action action, string groupName) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (action == null) { throw new ArgumentNullException("action"); } if (!KeyPressActions.TryGetValue(hotkeyName, out var _)) { KeyBindContext keyBindContext; ValidationResult validationResult = IsHotkeyCombinationValid(hotkeyName, keyCode, modifiers, inputState, hotkeyContext, out keyBindContext); if (!validationResult.IsValid) { keyBindContext = new KeyBindContext((KeyCode)0, Array.Empty(), inputState, hotkeyContext); } InputData inputData = new InputData(hotkeyName, keyBindContext, action, cooldownMillis, groupName); KeyPressActions.Add(hotkeyName, inputData); GenerateKeyGroupCache(); if (inputData.IsFromGroup) { if (NamedGroupsCache.ContainsKey(groupName)) { NamedGroupsCache[groupName].Add(hotkeyName); } else { NamedGroupsCache.Add(groupName, new List(1) { hotkeyName }); } } if (!validationResult.IsValid) { HotkeyValidationError(hotkeyName, validationResult.ErrorMessage, keyBindContext); return HotkeyAddResult.AddedWithFailure; } InputMonobehaviour.Instance?.BehaviourEnabledCheck(); return HotkeyAddResult.Sucess; } TimeLogger.Logger.LogError("Hotkey '" + hotkeyName + "' already exists.", (LogCategories)33554432); HotkeyValidationError(hotkeyName, "I fucked up something and hotkey '" + hotkeyName + "' couldnt be added.", new KeyBind(keyCode, modifiers)); return HotkeyAddResult.Failure; } public virtual bool ChangeHotkey(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ChangeHotkeyInternal(hotkeyName, keyCode, modifiers); } protected bool ChangeHotkeyInternal(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers) { //IL_00c8: 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_0070: 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_0063: Unknown result type (might be due to invalid IL or missing references) if (KeyPressActions.TryGetValue(hotkeyName, out var value)) { KeyBindContext keyContext = value.KeyContext; KeyBindContext keyBindContext; ValidationResult validationResult = IsHotkeyCombinationValid(hotkeyName, keyCode, modifiers, keyContext.TriggerInputState, keyContext.HotkeyContext, out keyBindContext); bool flag = true; if (!validationResult.IsValid) { if (OnValidationError == OnValidationError.Rollback) { flag = false; keyCode = keyContext.KeyCode; modifiers = keyContext.Modifiers; } else if (OnValidationError == OnValidationError.ClearKeycodes) { keyCode = (KeyCode)0; modifiers = Array.Empty(); } } if (flag) { value.ChangeValidatedKeyCodes(keyCode, modifiers); GenerateKeyGroupCache(); } if (!validationResult.IsValid) { HotkeyValidationError(hotkeyName, validationResult.ErrorMessage, keyContext); return false; } return true; } TimeLogger.Logger.LogError("Hotkey '" + hotkeyName + "' cant be changed because it doesnt exist.", (LogCategories)33554432); HotkeyValidationError(hotkeyName, "Something went wrong and hotkey '" + hotkeyName + "' cant be changed.", new KeyBind(keyCode, modifiers)); return false; } public virtual bool RemoveHotkey(string hotkeyName) { return RemoveHotkeysInternal(hotkeyName, null); } public virtual bool RemoveHotkeyGroup(string groupName) { return RemoveHotkeysInternal(null, groupName); } protected bool RemoveHotkeysInternal(string hotkeyName, string groupName) { bool flag = false; if (!string.IsNullOrEmpty(hotkeyName)) { if (KeyPressActions.TryGetValue(hotkeyName, out var value)) { NamedGroupsCache[value.GroupName].Remove(hotkeyName); if (NamedGroupsCache.Count == 0) { NamedGroupsCache.Remove(value.GroupName); } KeyPressActions.Remove(hotkeyName); flag = true; } } else { if (string.IsNullOrEmpty(groupName)) { throw new ArgumentException("Both hotkeyName and groupName cant be empty."); } if (NamedGroupsCache.TryGetValue(groupName, out var value2)) { NamedGroupsCache.Remove(groupName); foreach (string item in value2) { KeyPressActions.Remove(item); } flag = true; } } if (flag) { GenerateKeyGroupCache(); InputMonobehaviour.Instance?.BehaviourEnabledCheck(); return true; } return false; } private ValidationResult IsHotkeyCombinationValid(string hotkeyName, KeyCode keyCode, KeyCode[] modifiers, InputState inputState, HotkeyContext hotkeyContext, out KeyBindContext keyBindContext) { //IL_0010: 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) keyBindContext = new KeyBindContext(keyCode, modifiers, inputState, hotkeyContext); if ((int)keyCode == 0) { return ValidationResult.Valid; } if (IsRestrictedKeyBind(keyBindContext)) { string text = "Hotkey '" + keyBindContext.ToStringKeyCodes() + "' is restricted and cant be used."; TimeLogger.Logger.LogWarning(text, (LogCategories)33554432); return new ValidationResult(isValid: false, text); } KeyBindContext localKeyBindContext = keyBindContext; List<(string, InputState)> list = (from k in KeyPressActions where k.Value.KeyContext.EqualKeycodesAndContext(localKeyBindContext) select (k.Key, k.Value.KeyContext.TriggerInputState)).ToList(); if (list.Count > 0) { IEnumerable<(string, InputState)> source = list.Where<(string, InputState)>(((string Key, InputState TriggerInputState) k) => k.TriggerInputState == inputState); if (source.Any()) { TimeLogger.Logger.LogWarning("The key '" + keyBindContext.ToStringKeyCodesAndContext() + "' is " + $"already being used for the same key state: '{inputState}' with the hotkey name " + "'" + source.First().Item1 + "'", (LogCategories)33554432); string errorMessage = "Hotkey '" + keyBindContext.ToStringKeyCodes() + "' already in use."; return new ValidationResult(isValid: false, errorMessage); } IEnumerable<(string, InputState)> source2 = list.Where<(string, InputState)>(((string Key, InputState TriggerInputState) k) => k.TriggerInputState != InputState.KeyUp); if (inputState != InputState.KeyUp && !source2.Any()) { TimeLogger.Logger.LogError("KeyDown and KeyHeld cant be registered for hotkey ('" + keyBindContext.ToStringKeyCodesAndContext() + "') at the same time.", (LogCategories)33554432); string errorMessage2 = "Hotkey '" + keyBindContext.ToStringKeyCodes() + "' already in use."; return new ValidationResult(isValid: false, errorMessage2); } } return ValidationResult.Valid; } public string GetRegisteredHotkeys() { return string.Join(", ", KeyPressActions.Values.Select((InputData d) => d.KeyContext.ToString())); } private static KeyCode[] GetPressedModifiers() { return ((IEnumerable)SupportedModifiersList).Where((Func)Input.GetKey).ToArray(); } public static ModifierMask KeyCodeModifiersToMask(KeyCode[] modifiers) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected I4, but got Unknown ModifierMask modifierMask = ModifierMask.None; foreach (KeyCode val in modifiers) { ModifierMask modifierMask2 = modifierMask; modifierMask = modifierMask2 | ((val - 303) switch { 3 => ModifierMask.LeftControl, 2 => ModifierMask.RightControl, 1 => ModifierMask.LeftShift, 0 => ModifierMask.RightShift, 5 => ModifierMask.LeftAlt, 4 => ModifierMask.RightAlt, 10 => ModifierMask.AltGr, 8 => ModifierMask.LeftWindows, 9 => ModifierMask.RightWindows, _ => ModifierMask.None, }); } return modifierMask; } static InputDetection() { KeyCode[] array = new KeyCode[9]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); SupportedModifiersList = (KeyCode[])(object)array; } } } namespace Damntry.UtilsUnity.Components.InputManagement.Model { public class InputData { private readonly double cooldownSeconds; private double lastKeyPressTime; public string HotkeyName { get; private set; } public string GroupName { get; private set; } public Action Action { get; private set; } public KeyBindContext KeyContext { get; private set; } public bool IsFromGroup => !string.IsNullOrEmpty(GroupName); public InputData(string hotkeyName, KeyBindContext keyContext, Action action, int cooldownMillis, string groupName) { HotkeyName = hotkeyName; KeyContext = keyContext; Action = action ?? throw new ArgumentNullException("The action call cant be null."); cooldownSeconds = ((cooldownSeconds > 0.0) ? ((double)cooldownMillis / 1000.0) : (-1.0)); GroupName = groupName; lastKeyPressTime = double.MinValue; } internal void ChangeValidatedKeyCodes(KeyCode newKeyCode, KeyCode[] modifiers) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) KeyContext = new KeyBindContext(newKeyCode, modifiers, KeyContext.TriggerInputState, KeyContext.HotkeyContext); } internal bool IsModifierCompatible(ModifierMask modifierMask) { return (KeyContext.ModifiersMask & ~modifierMask) == 0; } internal bool IsNotInCooldown() { if (!(cooldownSeconds <= 0.0)) { return lastKeyPressTime + cooldownSeconds < Time.timeAsDouble; } return true; } internal bool IsContextActive() { return KeyContext.HotkeyContext.ActivationCondition?.Invoke() ?? false; } internal void PerformHotkeyAction() { lastKeyPressTime = Time.timeAsDouble; try { Action(); } catch (Exception ex) { TimeLogger.Logger.LogExceptionWithMessage("Exception while trying to execute Action for " + $"hotkey '{HotkeyName}' and input combination: {KeyContext}", ex, (LogCategories)33554432); } } } public class KeyBind : IEquatable { private enum KeyCodeType { KeyStroke, MouseButton, MouseScroll } private KeyCodeType keyCodeType; public KeyCode KeyCode { get; init; } public KeyCode[] Modifiers { get; init; } internal ModifierMask ModifiersMask { get; init; } public bool IsSuppressedKeyCode => (int)KeyCode == 0; public bool IsMouseButtonKeyCode { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if ((int)KeyCode >= 323) { return (int)KeyCode <= 329; } return false; } } public bool IsMouseScrollKeyCode { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if ((int)KeyCode != 322) { return (int)KeyCode == 321; } return true; } } public KeyBind(KeyCode keyCode, KeyCode[] modifiers) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) KeyCode = keyCode; SetKeyCodeType(); Modifiers = modifiers ?? Array.Empty(); ModifiersMask = InputDetection.KeyCodeModifiersToMask(Modifiers); } public void SetKeyCodeType() { if (IsMouseButtonKeyCode) { keyCodeType = KeyCodeType.MouseButton; } else if (IsMouseScrollKeyCode) { keyCodeType = KeyCodeType.MouseScroll; } else { keyCodeType = KeyCodeType.KeyStroke; } } public virtual bool IsTriggered(InputState triggerState, ModifierMask pressedModifMask, bool ignoreModifiers) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected I4, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if (IsSuppressedKeyCode) { return false; } bool flag = ignoreModifiers || IsModifierEqual(pressedModifMask); if (keyCodeType == KeyCodeType.KeyStroke) { if (flag) { return IsKeyStrokeTriggered(triggerState); } return false; } if (keyCodeType == KeyCodeType.MouseButton) { int mouseIndex = KeyCode - 323; if (flag) { return IsMouseButtonTriggered(triggerState, mouseIndex); } return false; } if (keyCodeType == KeyCodeType.MouseScroll) { float num = (((int)KeyCode == 322) ? (-1f) : 1f); if (flag) { return Input.GetAxisRaw("Mouse ScrollWheel") == num; } return false; } throw new InvalidOperationException($"Invalid type {keyCodeType}"); } public bool IsModifierEqual(ModifierMask pressedModifMask) { return ModifiersMask == pressedModifMask; } private bool IsKeyStrokeTriggered(InputState triggerState) { //IL_002d: 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_0042: Unknown result type (might be due to invalid IL or missing references) return triggerState switch { InputState.KeyDown => Input.anyKeyDown && Input.GetKeyDown(KeyCode), InputState.KeyUp => Input.GetKeyUp(KeyCode), InputState.KeyHeld => Input.anyKey && Input.GetKey(KeyCode), _ => throw new NotImplementedException(EnumExtension.GetDescription((Enum)triggerState)), }; } protected bool IsMouseButtonTriggered(InputState triggerState, int mouseIndex) { return triggerState switch { InputState.KeyDown => Input.GetMouseButtonDown(mouseIndex), InputState.KeyUp => Input.GetMouseButtonUp(mouseIndex), InputState.KeyHeld => Input.GetMouseButton(mouseIndex), _ => throw new NotImplementedException(EnumExtension.GetDescription((Enum)triggerState)), }; } public override bool Equals(object other) { return this == (KeyBind)other; } public bool Equals(KeyBind other) { return this == other; } public static bool operator !=(KeyBind key1, KeyBind key2) { return !(key1 == key2); } public static bool operator ==(KeyBind key1, KeyBind key2) { //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) if ((object)key1 == null) { return false; } if ((object)key2 == null) { return false; } if ((object)key1 != key2) { if (key1.KeyCode == key2.KeyCode) { return key1.ModifiersMask == key2.ModifiersMask; } return false; } return true; } public override int GetHashCode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return HashCode.Combine(KeyCode, ModifiersMask); } public override string ToString() { return ToStringKeyCodes(); } public string ToStringKeyCodes() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return KeyCodeUtils.KeyCombinationToString(useLiterals: false, KeyCode, "+", Modifiers); } } public class KeyBindContext : KeyBindState, IEquatable { public HotkeyContext HotkeyContext { get; private set; } public KeyBindContext(KeyCode keyCode, KeyCode[] modifiers, InputState inputState, HotkeyContext hotkeyCtx) : base(keyCode, modifiers, inputState) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) HotkeyContext = hotkeyCtx; } public bool IsTriggeredWithContext(ModifierMask pressedModifMask, bool ignoreModifiers) { if (base.IsSuppressedKeyCode) { return false; } if (HotkeyContext.ActivationCondition != null && !HotkeyContext.ActivationCondition()) { return false; } return IsTriggered(pressedModifMask, ignoreModifiers); } public override bool Equals(object other) { return this == (KeyBindContext)other; } public bool Equals(KeyBindContext other) { return this == other; } public static bool operator !=(KeyBindContext key1, KeyBindContext key2) { return !(key1 == key2); } public static bool operator ==(KeyBindContext key1, KeyBindContext key2) { if ((object)key1 == null) { return false; } if ((object)key2 == null) { return false; } if ((object)key1 != key2) { if ((KeyBindState)key1 == (KeyBindState)key2) { return key1.HotkeyContext == key2.HotkeyContext; } return false; } return true; } public bool EqualKeycodesAndContext(KeyBindContext otherKeyBindContext) { if ((KeyBind)this == (KeyBind)otherKeyBindContext) { return HotkeyContext == otherKeyBindContext.HotkeyContext; } return false; } public override int GetHashCode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return HashCode.Combine(base.KeyCode, base.ModifiersMask, base.TriggerInputState, HotkeyContext); } public override string ToString() { return base.ToString() + $" - Context: {HotkeyContext}"; } public string ToStringKeyCodesAndContext() { return ToString() + $" - Context: {HotkeyContext}"; } } public class HotkeyContext : IEquatable { public string Name { get; private set; } public Func ActivationCondition { get; private set; } public int Priority { get; private set; } public HotkeyContext(string Name, Func activationCondition, int priority) { this.Name = Name; ActivationCondition = activationCondition; Priority = priority; base..ctor(); } public override bool Equals(object other) { return this == (HotkeyContext)other; } public bool Equals(HotkeyContext other) { return this == other; } public static bool operator !=(HotkeyContext key1, HotkeyContext key2) { return !(key1 == key2); } public static bool operator ==(HotkeyContext key1, HotkeyContext key2) { if ((object)key1 == null) { return false; } if ((object)key2 == null) { return false; } if ((object)key1 != key2) { return key1.Name == key2.Name; } return true; } public override int GetHashCode() { return 83 * 3623 + Name.GetHashCode(); } public override string ToString() { return $"{Name} ({Priority})"; } } public class KeyBindState : KeyBind, IEquatable { public InputState TriggerInputState { get; private set; } public KeyBindState(KeyCode keyCode, KeyCode[] modifiers, InputState inputState) : base(keyCode, modifiers) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) TriggerInputState = inputState; } public bool IsTriggered(ModifierMask pressedModifMask, bool ignoreModifiers) { return base.IsTriggered(TriggerInputState, pressedModifMask, ignoreModifiers); } public override bool Equals(object other) { return this == (KeyBindState)other; } public bool Equals(KeyBindState other) { return this == other; } public static bool operator !=(KeyBindState key1, KeyBindState key2) { return !(key1 == key2); } public static bool operator ==(KeyBindState key1, KeyBindState key2) { if ((object)key1 == null) { return false; } if ((object)key2 == null) { return false; } if ((object)key1 != key2) { if ((KeyBind)key1 == (KeyBind)key2) { return key1.TriggerInputState == key2.TriggerInputState; } return false; } return true; } public override int GetHashCode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return HashCode.Combine(base.KeyCode, base.ModifiersMask, TriggerInputState); } public override string ToString() { return base.ToString() + $" ({TriggerInputState})"; } } }