Decompiled source of WeatherInfo v1.0.1
plugins/CoddingCat.WeatherInfo/CoddingCat.WeatherInfo.dll
Decompiled 2 months agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using CoddingCat.WeatherInfo.NetcodePatcher; using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Options; using Microsoft.CodeAnalysis; using On; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CoddingCat.WeatherInfo")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("WeatherInfo")] [assembly: AssemblyTitle("CoddingCat.WeatherInfo")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace WeatherInfo { [BepInPlugin("CoddingCat.WeatherInfo", "WeatherInfo", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; public GameObject prefab; public GameObject WeatherObject; private void Awake() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown string path = "mainbundle"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } prefab = ModAssets.LoadAsset<GameObject>("AnotherCanvas"); StartOfRound.Start += new hook_Start(myHook); StartOfRound.ChangePlanet += new hook_ChangePlanet(PlanetChangeHook); } private void PlanetChangeHook(orig_ChangePlanet orig, StartOfRound self) { //IL_0011: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00ba: 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_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_00d1: 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_00d4: 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_00f8: Expected I4, but got Unknown //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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)RoundManager.Instance.currentLevel.currentWeather); GameObject gameObject = ((Component)WeatherObject.transform.Find("MainContainer/WeatherInfo/HeaderText (3)")).gameObject; TMP_Text weatherText = gameObject.GetComponent<TMP_Text>(); Image weatherIcon = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/test/MainContainer/WeatherInfo/BG (3)").GetComponent<Image>(); TweenSettingsExtensions.OnComplete<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOScale(((Component)weatherIcon).transform, Vector3.zero, 0.7f), (Ease)2), (TweenCallback)delegate { //IL_0050: Unknown result type (might be due to invalid IL or missing references) weatherIcon.sprite = ModAssets.LoadAsset<Sprite>(((object)(LevelWeatherType)(ref RoundManager.Instance.currentLevel.currentWeather)).ToString().ToUpper()); TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOScale(((Component)weatherIcon).transform, new Vector3(0.5383086f, 0.5383086f, 0.5383086f), 0.7f), (Ease)3); }); gameObject.GetComponent<TMP_Text>().text = ((object)(LevelWeatherType)(ref RoundManager.Instance.currentLevel.currentWeather)).ToString().ToUpper(); Color val = Color.white; LevelWeatherType currentWeather = RoundManager.Instance.currentLevel.currentWeather; LevelWeatherType val2 = currentWeather; switch (val2 - -1) { case 6: val = Color.red; break; case 4: val = Color.yellow; break; case 0: val = Color.green; break; case 2: val = Color.yellow; break; case 3: val = Color.red; break; case 5: ((Color)(ref val))..ctor(1f, 0.64f, 0f); break; case 1: val = Color.green; break; } TweenSettingsExtensions.SetEase<TweenerCore<Color, Color, ColorOptions>>(DOTween.To((DOGetter<Color>)(() => ((Graphic)weatherText).color), (DOSetter<Color>)delegate(Color x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Graphic)weatherText).color = x; }, val, 1f), (Ease)7); orig.Invoke(self); } private void myHook(orig_Start orig, StartOfRound self) { //IL_0078: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall"); if ((Object)(object)val != (Object)null) { Debug.Log((object)"MonitorWall found!"); WeatherObject = Object.Instantiate<GameObject>(prefab); WeatherObject.transform.SetParent(GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube").transform); GameObject gameObject = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube/Canvas (1)").gameObject; WeatherObject.transform.position = gameObject.transform.position; WeatherObject.transform.rotation = gameObject.transform.rotation; WeatherObject.transform.localScale = gameObject.transform.localScale; WeatherObject.transform.localPosition = gameObject.transform.localPosition; ((Object)WeatherObject).name = "test"; } else { Debug.Log((object)"MonitorWall not found!"); } orig.Invoke(self); } } public static class PluginInfo { public const string PLUGIN_GUID = "CoddingCat.WeatherInfo"; public const string PLUGIN_NAME = "WeatherInfo"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace CoddingCat.WeatherInfo.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }
plugins/CoddingCat.WeatherInfo/DOTween.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using DG.Tweening.Core; using DG.Tweening.Core.Easing; using DG.Tweening.Core.Enums; using DG.Tweening.CustomPlugins; using DG.Tweening.Plugins; using DG.Tweening.Plugins.Core; using DG.Tweening.Plugins.Core.PathCore; using DG.Tweening.Plugins.Options; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("DOTweenEditor")] [assembly: InternalsVisibleTo("DOTween43")] [assembly: InternalsVisibleTo("DOTween46")] [assembly: InternalsVisibleTo("DOTween50")] [assembly: InternalsVisibleTo("DOTweenPro")] [assembly: InternalsVisibleTo("DOTweenProEditor")] [assembly: AssemblyTitle("DOTween")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Demigiant")] [assembly: AssemblyProduct("DOTween")] [assembly: AssemblyCopyright("Copyright © Daniele Giardini, 2014")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("807e068c-2a0e-4c81-a303-4b4fd3924511")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")] namespace DG.Tweening { public enum AutoPlay { None, AutoPlaySequences, AutoPlayTweeners, All } [Flags] public enum AxisConstraint { None = 0, X = 2, Y = 4, Z = 8, W = 0x10 } public struct Color2 { public Color ca; public Color cb; public Color2(Color ca, Color cb) { //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_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.ca = ca; this.cb = cb; } public static Color2 operator +(Color2 c1, Color2 c2) { //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_000c: 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_001d: Unknown result type (might be due to invalid IL or missing references) return new Color2(c1.ca + c2.ca, c1.cb + c2.cb); } public static Color2 operator -(Color2 c1, Color2 c2) { //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_000c: 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_001d: Unknown result type (might be due to invalid IL or missing references) return new Color2(c1.ca - c2.ca, c1.cb - c2.cb); } public static Color2 operator *(Color2 c1, float f) { //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_0013: Unknown result type (might be due to invalid IL or missing references) return new Color2(c1.ca * f, c1.cb * f); } } public delegate void TweenCallback(); public delegate void TweenCallback<in T>(T value); public delegate float EaseFunction(float time, float duration, float overshootOrAmplitude, float period); public static class DOCurve { public static class CubicBezier { public static Vector3 GetPointOnSegment(Vector3 startPoint, Vector3 startControlPoint, Vector3 endPoint, Vector3 endControlPoint, float factor) { //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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0051: Unknown result type (might be due to invalid IL or missing references) float num = 1f - factor; float num2 = factor * factor; float num3 = num * num; float num4 = num3 * num; float num5 = num2 * factor; return num4 * startPoint + 3f * num3 * factor * startControlPoint + 3f * num * num2 * endControlPoint + num5 * endPoint; } public static Vector3[] GetSegmentPointCloud(Vector3 startPoint, Vector3 startControlPoint, Vector3 endPoint, Vector3 endControlPoint, int resolution = 10) { //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_0024: 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_002f: Unknown result type (might be due to invalid IL or missing references) if (resolution < 2) { resolution = 2; } Vector3[] array = (Vector3[])(object)new Vector3[resolution]; float num = 1f / (float)(resolution - 1); for (int i = 0; i < resolution; i++) { array[i] = GetPointOnSegment(startPoint, startControlPoint, endPoint, endControlPoint, num * (float)i); } return array; } public static void GetSegmentPointCloud(List<Vector3> addToList, Vector3 startPoint, Vector3 startControlPoint, Vector3 endPoint, Vector3 endControlPoint, int resolution = 10) { //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_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) if (resolution < 2) { resolution = 2; } float num = 1f / (float)(resolution - 1); for (int i = 0; i < resolution; i++) { addToList.Add(GetPointOnSegment(startPoint, startControlPoint, endPoint, endControlPoint, num * (float)i)); } } } } public class DOTween { public static readonly string Version = "1.2.765"; public static bool useSafeMode = true; public static SafeModeLogBehaviour safeModeLogBehaviour = SafeModeLogBehaviour.Warning; public static NestedTweenFailureBehaviour nestedTweenFailureBehaviour = NestedTweenFailureBehaviour.TryToPreserveSequence; public static bool showUnityEditorReport = false; public static float timeScale = 1f; public static float unscaledTimeScale = 1f; public static bool useSmoothDeltaTime; public static float maxSmoothUnscaledTime = 0.15f; internal static RewindCallbackMode rewindCallbackMode = RewindCallbackMode.FireIfPositionChanged; private static LogBehaviour _logBehaviour = LogBehaviour.ErrorsOnly; public static Func<LogType, object, bool> onWillLog; public static bool drawGizmos = true; public static bool debugMode = false; private static bool _fooDebugStoreTargetId = true; public static UpdateType defaultUpdateType = UpdateType.Normal; public static bool defaultTimeScaleIndependent = false; public static AutoPlay defaultAutoPlay = AutoPlay.All; public static bool defaultAutoKill = true; public static LoopType defaultLoopType = LoopType.Restart; public static bool defaultRecyclable; public static Ease defaultEaseType = Ease.OutQuad; public static float defaultEaseOvershootOrAmplitude = 1.70158f; public static float defaultEasePeriod = 0f; public static DOTweenComponent instance; private static bool _foo_isQuitting; internal static int maxActiveTweenersReached; internal static int maxActiveSequencesReached; internal static SafeModeReport safeModeReport; internal static readonly List<TweenCallback> GizmosDelegates = new List<TweenCallback>(); internal static bool initialized; private static int _isQuittingFrame = -1; public static LogBehaviour logBehaviour { get { return _logBehaviour; } set { _logBehaviour = value; DG.Tweening.Core.Debugger.SetLogPriority(_logBehaviour); } } public static bool debugStoreTargetId { get { if (debugMode && useSafeMode) { return _fooDebugStoreTargetId; } return false; } set { _fooDebugStoreTargetId = value; } } internal static bool isQuitting { get { if (!_foo_isQuitting) { return false; } if (Time.frameCount >= 0 && _isQuittingFrame != Time.frameCount) { _foo_isQuitting = false; return false; } return true; } set { _foo_isQuitting = value; if (value) { _isQuittingFrame = Time.frameCount; } } } public static IDOTweenInit Init(bool? recycleAllByDefault = null, bool? useSafeMode = null, LogBehaviour? logBehaviour = null) { if (initialized) { return instance; } if (!Application.isPlaying || isQuitting) { return null; } return Init(Resources.Load("DOTweenSettings") as DOTweenSettings, recycleAllByDefault, useSafeMode, logBehaviour); } private static void AutoInit() { if (Application.isPlaying && !isQuitting) { Init(Resources.Load("DOTweenSettings") as DOTweenSettings, null, null, null); } } private static IDOTweenInit Init(DOTweenSettings settings, bool? recycleAllByDefault, bool? useSafeMode, LogBehaviour? logBehaviour) { initialized = true; if (recycleAllByDefault.HasValue) { defaultRecyclable = recycleAllByDefault.Value; } if (useSafeMode.HasValue) { DOTween.useSafeMode = useSafeMode.Value; } if (logBehaviour.HasValue) { DOTween.logBehaviour = logBehaviour.Value; } DOTweenComponent.Create(); if ((Object)(object)settings != (Object)null) { if (!useSafeMode.HasValue) { DOTween.useSafeMode = settings.useSafeMode; } if (!logBehaviour.HasValue) { DOTween.logBehaviour = settings.logBehaviour; } if (!recycleAllByDefault.HasValue) { defaultRecyclable = settings.defaultRecyclable; } safeModeLogBehaviour = settings.safeModeOptions.logBehaviour; nestedTweenFailureBehaviour = settings.safeModeOptions.nestedTweenFailureBehaviour; timeScale = settings.timeScale; unscaledTimeScale = settings.unscaledTimeScale; useSmoothDeltaTime = settings.useSmoothDeltaTime; maxSmoothUnscaledTime = settings.maxSmoothUnscaledTime; rewindCallbackMode = settings.rewindCallbackMode; defaultRecyclable = ((!recycleAllByDefault.HasValue) ? settings.defaultRecyclable : recycleAllByDefault.Value); showUnityEditorReport = settings.showUnityEditorReport; drawGizmos = settings.drawGizmos; defaultAutoPlay = settings.defaultAutoPlay; defaultUpdateType = settings.defaultUpdateType; defaultTimeScaleIndependent = settings.defaultTimeScaleIndependent; defaultEaseType = settings.defaultEaseType; defaultEaseOvershootOrAmplitude = settings.defaultEaseOvershootOrAmplitude; defaultEasePeriod = settings.defaultEasePeriod; defaultAutoKill = settings.defaultAutoKill; defaultLoopType = settings.defaultLoopType; debugMode = settings.debugMode; debugStoreTargetId = settings.debugStoreTargetId; } if (DG.Tweening.Core.Debugger.logPriority >= 2) { DG.Tweening.Core.Debugger.Log("DOTween initialization (useSafeMode: " + DOTween.useSafeMode + ", recycling: " + (defaultRecyclable ? "ON" : "OFF") + ", logBehaviour: " + DOTween.logBehaviour.ToString() + ")"); } return instance; } public static void SetTweensCapacity(int tweenersCapacity, int sequencesCapacity) { TweenManager.SetCapacities(tweenersCapacity, sequencesCapacity); } public static void Clear(bool destroy = false) { Clear(destroy, isApplicationQuitting: false); } internal static void Clear(bool destroy, bool isApplicationQuitting) { TweenManager.PurgeAll(isApplicationQuitting); PluginsManager.PurgeAll(); if (destroy) { initialized = false; useSafeMode = false; safeModeLogBehaviour = SafeModeLogBehaviour.Warning; nestedTweenFailureBehaviour = NestedTweenFailureBehaviour.TryToPreserveSequence; showUnityEditorReport = false; drawGizmos = true; timeScale = 1f; unscaledTimeScale = 1f; useSmoothDeltaTime = false; maxSmoothUnscaledTime = 0.15f; rewindCallbackMode = RewindCallbackMode.FireIfPositionChanged; logBehaviour = LogBehaviour.ErrorsOnly; onWillLog = null; defaultEaseType = Ease.OutQuad; defaultEaseOvershootOrAmplitude = 1.70158f; defaultEasePeriod = 0f; defaultUpdateType = UpdateType.Normal; defaultTimeScaleIndependent = false; defaultAutoPlay = AutoPlay.All; defaultLoopType = LoopType.Restart; defaultAutoKill = true; defaultRecyclable = false; maxActiveTweenersReached = (maxActiveSequencesReached = 0); GizmosDelegates.Clear(); DOTweenComponent.DestroyInstance(); } } public static void ClearCachedTweens() { TweenManager.PurgePools(); } public static int Validate() { return TweenManager.Validate(); } public static void ManualUpdate(float deltaTime, float unscaledDeltaTime) { InitCheck(); if (TweenManager.hasActiveManualTweens) { TweenManager.Update(UpdateType.Manual, deltaTime * timeScale, unscaledDeltaTime * unscaledTimeScale * timeScale); } } public static TweenerCore<float, float, FloatOptions> To(DOGetter<float> getter, DOSetter<float> setter, float endValue, float duration) { return ApplyTo<float, float, FloatOptions>(getter, setter, endValue, duration); } public static TweenerCore<double, double, NoOptions> To(DOGetter<double> getter, DOSetter<double> setter, double endValue, float duration) { return ApplyTo<double, double, NoOptions>(getter, setter, endValue, duration); } public static TweenerCore<int, int, NoOptions> To(DOGetter<int> getter, DOSetter<int> setter, int endValue, float duration) { return ApplyTo<int, int, NoOptions>(getter, setter, endValue, duration); } public static TweenerCore<uint, uint, UintOptions> To(DOGetter<uint> getter, DOSetter<uint> setter, uint endValue, float duration) { return ApplyTo<uint, uint, UintOptions>(getter, setter, endValue, duration); } public static TweenerCore<long, long, NoOptions> To(DOGetter<long> getter, DOSetter<long> setter, long endValue, float duration) { return ApplyTo<long, long, NoOptions>(getter, setter, endValue, duration); } public static TweenerCore<ulong, ulong, NoOptions> To(DOGetter<ulong> getter, DOSetter<ulong> setter, ulong endValue, float duration) { return ApplyTo<ulong, ulong, NoOptions>(getter, setter, endValue, duration); } public static TweenerCore<string, string, StringOptions> To(DOGetter<string> getter, DOSetter<string> setter, string endValue, float duration) { return ApplyTo<string, string, StringOptions>(getter, setter, endValue, duration); } public static TweenerCore<Vector2, Vector2, VectorOptions> To(DOGetter<Vector2> getter, DOSetter<Vector2> setter, Vector2 endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Vector2, Vector2, VectorOptions>(getter, setter, endValue, duration); } public static TweenerCore<Vector3, Vector3, VectorOptions> To(DOGetter<Vector3> getter, DOSetter<Vector3> setter, Vector3 endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Vector3, Vector3, VectorOptions>(getter, setter, endValue, duration); } public static TweenerCore<Vector4, Vector4, VectorOptions> To(DOGetter<Vector4> getter, DOSetter<Vector4> setter, Vector4 endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Vector4, Vector4, VectorOptions>(getter, setter, endValue, duration); } public static TweenerCore<Quaternion, Vector3, QuaternionOptions> To(DOGetter<Quaternion> getter, DOSetter<Quaternion> setter, Vector3 endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Quaternion, Vector3, QuaternionOptions>(getter, setter, endValue, duration); } public static TweenerCore<Color, Color, ColorOptions> To(DOGetter<Color> getter, DOSetter<Color> setter, Color endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Color, Color, ColorOptions>(getter, setter, endValue, duration); } public static TweenerCore<Rect, Rect, RectOptions> To(DOGetter<Rect> getter, DOSetter<Rect> setter, Rect endValue, float duration) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return ApplyTo<Rect, Rect, RectOptions>(getter, setter, endValue, duration); } public static Tweener To(DOGetter<RectOffset> getter, DOSetter<RectOffset> setter, RectOffset endValue, float duration) { return ApplyTo<RectOffset, RectOffset, NoOptions>(getter, setter, endValue, duration); } public static TweenerCore<T1, T2, TPlugOptions> To<T1, T2, TPlugOptions>(ABSTweenPlugin<T1, T2, TPlugOptions> plugin, DOGetter<T1> getter, DOSetter<T1> setter, T2 endValue, float duration) where TPlugOptions : struct, IPlugOptions { return ApplyTo(getter, setter, endValue, duration, plugin); } public static TweenerCore<Vector3, Vector3, VectorOptions> ToAxis(DOGetter<Vector3> getter, DOSetter<Vector3> setter, float endValue, float duration, AxisConstraint axisConstraint = AxisConstraint.X) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Vector3, Vector3, VectorOptions> tweenerCore = ApplyTo<Vector3, Vector3, VectorOptions>(getter, setter, new Vector3(endValue, endValue, endValue), duration); tweenerCore.plugOptions.axisConstraint = axisConstraint; return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> ToAlpha(DOGetter<Color> getter, DOSetter<Color> setter, float endValue, float duration) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Color, Color, ColorOptions> tweenerCore = ApplyTo<Color, Color, ColorOptions>(getter, setter, new Color(0f, 0f, 0f, endValue), duration); tweenerCore.SetOptions(alphaOnly: true); return tweenerCore; } public static Tweener To(DOSetter<float> setter, float startValue, float endValue, float duration) { return To(() => startValue, delegate(float x) { startValue = x; setter(startValue); }, endValue, duration).NoFrom(); } public static TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> Punch(DOGetter<Vector3> getter, DOSetter<Vector3> setter, Vector3 direction, float duration, int vibrato = 10, float elasticity = 1f) { //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_00b4: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (elasticity > 1f) { elasticity = 1f; } else if (elasticity < 0f) { elasticity = 0f; } float num = ((Vector3)(ref direction)).magnitude; int num2 = (int)((float)vibrato * duration); if (num2 < 2) { num2 = 2; } float num3 = num / (float)num2; float[] array = new float[num2]; float num4 = 0f; for (int i = 0; i < num2; i++) { float num5 = (float)(i + 1) / (float)num2; float num6 = duration * num5; num4 += num6; array[i] = num6; } float num7 = duration / num4; for (int j = 0; j < num2; j++) { array[j] *= num7; } Vector3[] array2 = (Vector3[])(object)new Vector3[num2]; for (int k = 0; k < num2; k++) { if (k < num2 - 1) { if (k == 0) { array2[k] = direction; } else if (k % 2 != 0) { array2[k] = -Vector3.ClampMagnitude(direction, num * elasticity); } else { array2[k] = Vector3.ClampMagnitude(direction, num); } num -= num3; } else { array2[k] = Vector3.zero; } } return ToArray(getter, setter, array2, array).NoFrom().SetSpecialStartupMode(SpecialStartupMode.SetPunch); } public static TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> Shake(DOGetter<Vector3> getter, DOSetter<Vector3> setter, float duration, float strength = 3f, int vibrato = 10, float randomness = 90f, bool ignoreZAxis = true, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Shake(getter, setter, duration, new Vector3(strength, strength, strength), vibrato, randomness, ignoreZAxis, vectorBased: false, fadeOut, randomnessMode); } public static TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> Shake(DOGetter<Vector3> getter, DOSetter<Vector3> setter, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return Shake(getter, setter, duration, strength, vibrato, randomness, ignoreZAxis: false, vectorBased: true, fadeOut, randomnessMode); } private static TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> Shake(DOGetter<Vector3> getter, DOSetter<Vector3> setter, float duration, Vector3 strength, int vibrato, float randomness, bool ignoreZAxis, bool vectorBased, bool fadeOut, ShakeRandomnessMode randomnessMode) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0137: 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_0140: 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_014f: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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) float num = (vectorBased ? ((Vector3)(ref strength)).magnitude : strength.x); int num2 = (int)((float)vibrato * duration); if (num2 < 2) { num2 = 2; } float num3 = num / (float)num2; float[] array = new float[num2]; float num4 = 0f; for (int i = 0; i < num2; i++) { float num5 = (float)(i + 1) / (float)num2; float num6 = (fadeOut ? (duration * num5) : (duration / (float)num2)); num4 += num6; array[i] = num6; } float num7 = duration / num4; for (int j = 0; j < num2; j++) { array[j] *= num7; } float num8 = Random.Range(0f, 360f); Vector3[] array2 = (Vector3[])(object)new Vector3[num2]; for (int k = 0; k < num2; k++) { if (k < num2 - 1) { Quaternion val = Quaternion.identity; if (randomnessMode == ShakeRandomnessMode.Harmonic) { if (k > 0) { num8 = num8 - 180f + Random.Range(0f, randomness); } if (vectorBased || !ignoreZAxis) { val = Quaternion.AngleAxis(Random.Range(0f, randomness), Vector3.up); } } else { if (k > 0) { num8 = num8 - 180f + Random.Range(0f - randomness, randomness); } if (vectorBased || !ignoreZAxis) { val = Quaternion.AngleAxis(Random.Range(0f - randomness, randomness), Vector3.up); } } if (vectorBased) { Vector3 val2 = val * DOTweenUtils.Vector3FromAngle(num8, num); val2.x = Vector3.ClampMagnitude(val2, strength.x).x; val2.y = Vector3.ClampMagnitude(val2, strength.y).y; val2.z = Vector3.ClampMagnitude(val2, strength.z).z; val2 = (array2[k] = ((Vector3)(ref val2)).normalized * num); if (fadeOut) { num -= num3; } strength = Vector3.ClampMagnitude(strength, num); } else { if (ignoreZAxis) { array2[k] = DOTweenUtils.Vector3FromAngle(num8, num); } else { array2[k] = val * DOTweenUtils.Vector3FromAngle(num8, num); } if (fadeOut) { num -= num3; } } } else { array2[k] = Vector3.zero; } } return ToArray(getter, setter, array2, array).NoFrom().SetSpecialStartupMode(SpecialStartupMode.SetShake); } public static TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> ToArray(DOGetter<Vector3> getter, DOSetter<Vector3> setter, Vector3[] endValues, float[] durations) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) int num = durations.Length; if (num != endValues.Length) { DG.Tweening.Core.Debugger.LogError("To Vector3 array tween: endValues and durations arrays must have the same length"); return null; } Vector3[] array = (Vector3[])(object)new Vector3[num]; float[] array2 = new float[num]; for (int i = 0; i < num; i++) { array[i] = endValues[i]; array2[i] = durations[i]; } float num2 = 0f; for (int j = 0; j < num; j++) { num2 += array2[j]; } TweenerCore<Vector3, Vector3[], Vector3ArrayOptions> tweenerCore = ApplyTo<Vector3, Vector3[], Vector3ArrayOptions>(getter, setter, array, num2).NoFrom(); tweenerCore.plugOptions.durations = array2; return tweenerCore; } internal static TweenerCore<Color2, Color2, ColorOptions> To(DOGetter<Color2> getter, DOSetter<Color2> setter, Color2 endValue, float duration) { return ApplyTo<Color2, Color2, ColorOptions>(getter, setter, endValue, duration); } public static Sequence Sequence() { InitCheck(); Sequence sequence = TweenManager.GetSequence(); DG.Tweening.Sequence.Setup(sequence); return sequence; } public static Sequence Sequence(object target) { return Sequence().SetTarget(target); } public static int CompleteAll(bool withCallbacks = false) { return TweenManager.FilteredOperation(OperationType.Complete, FilterType.All, null, optionalBool: false, withCallbacks ? 1 : 0); } public static int Complete(object targetOrId, bool withCallbacks = false) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Complete, FilterType.TargetOrId, targetOrId, optionalBool: false, withCallbacks ? 1 : 0); } internal static int CompleteAndReturnKilledTot() { return TweenManager.FilteredOperation(OperationType.Complete, FilterType.All, null, optionalBool: true, 0f); } internal static int CompleteAndReturnKilledTot(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Complete, FilterType.TargetOrId, targetOrId, optionalBool: true, 0f); } internal static int CompleteAndReturnKilledTot(object target, object id) { if (target == null || id == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Complete, FilterType.TargetAndId, id, optionalBool: true, 0f, target); } internal static int CompleteAndReturnKilledTotExceptFor(params object[] excludeTargetsOrIds) { return TweenManager.FilteredOperation(OperationType.Complete, FilterType.AllExceptTargetsOrIds, null, optionalBool: true, 0f, null, excludeTargetsOrIds); } public static int FlipAll() { return TweenManager.FilteredOperation(OperationType.Flip, FilterType.All, null, optionalBool: false, 0f); } public static int Flip(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Flip, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int GotoAll(float to, bool andPlay = false) { return TweenManager.FilteredOperation(OperationType.Goto, FilterType.All, null, andPlay, to); } public static int Goto(object targetOrId, float to, bool andPlay = false) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Goto, FilterType.TargetOrId, targetOrId, andPlay, to); } public static int KillAll(bool complete = false) { return (complete ? CompleteAndReturnKilledTot() : 0) + TweenManager.DespawnAll(); } public static int KillAll(bool complete, params object[] idsOrTargetsToExclude) { if (idsOrTargetsToExclude == null) { return (complete ? CompleteAndReturnKilledTot() : 0) + TweenManager.DespawnAll(); } return (complete ? CompleteAndReturnKilledTotExceptFor(idsOrTargetsToExclude) : 0) + TweenManager.FilteredOperation(OperationType.Despawn, FilterType.AllExceptTargetsOrIds, null, optionalBool: false, 0f, null, idsOrTargetsToExclude); } public static int Kill(object targetOrId, bool complete = false) { if (targetOrId == null) { return 0; } return (complete ? CompleteAndReturnKilledTot(targetOrId) : 0) + TweenManager.FilteredOperation(OperationType.Despawn, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int Kill(object target, object id, bool complete = false) { if (target == null || id == null) { return 0; } return (complete ? CompleteAndReturnKilledTot(target, id) : 0) + TweenManager.FilteredOperation(OperationType.Despawn, FilterType.TargetAndId, id, optionalBool: false, 0f, target); } public static int PauseAll() { return TweenManager.FilteredOperation(OperationType.Pause, FilterType.All, null, optionalBool: false, 0f); } public static int Pause(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Pause, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int PlayAll() { return TweenManager.FilteredOperation(OperationType.Play, FilterType.All, null, optionalBool: false, 0f); } public static int Play(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Play, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int Play(object target, object id) { if (target == null || id == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Play, FilterType.TargetAndId, id, optionalBool: false, 0f, target); } public static int PlayBackwardsAll() { return TweenManager.FilteredOperation(OperationType.PlayBackwards, FilterType.All, null, optionalBool: false, 0f); } public static int PlayBackwards(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.PlayBackwards, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int PlayBackwards(object target, object id) { if (target == null || id == null) { return 0; } return TweenManager.FilteredOperation(OperationType.PlayBackwards, FilterType.TargetAndId, id, optionalBool: false, 0f, target); } public static int PlayForwardAll() { return TweenManager.FilteredOperation(OperationType.PlayForward, FilterType.All, null, optionalBool: false, 0f); } public static int PlayForward(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.PlayForward, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int PlayForward(object target, object id) { if (target == null || id == null) { return 0; } return TweenManager.FilteredOperation(OperationType.PlayForward, FilterType.TargetAndId, id, optionalBool: false, 0f, target); } public static int RestartAll(bool includeDelay = true) { return TweenManager.FilteredOperation(OperationType.Restart, FilterType.All, null, includeDelay, 0f); } public static int Restart(object targetOrId, bool includeDelay = true, float changeDelayTo = -1f) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetOrId, targetOrId, includeDelay, changeDelayTo); } public static int Restart(object target, object id, bool includeDelay = true, float changeDelayTo = -1f) { if (target == null || id == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Restart, FilterType.TargetAndId, id, includeDelay, changeDelayTo, target); } public static int RewindAll(bool includeDelay = true) { return TweenManager.FilteredOperation(OperationType.Rewind, FilterType.All, null, includeDelay, 0f); } public static int Rewind(object targetOrId, bool includeDelay = true) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.Rewind, FilterType.TargetOrId, targetOrId, includeDelay, 0f); } public static int SmoothRewindAll() { return TweenManager.FilteredOperation(OperationType.SmoothRewind, FilterType.All, null, optionalBool: false, 0f); } public static int SmoothRewind(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.SmoothRewind, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static int TogglePauseAll() { return TweenManager.FilteredOperation(OperationType.TogglePause, FilterType.All, null, optionalBool: false, 0f); } public static int TogglePause(object targetOrId) { if (targetOrId == null) { return 0; } return TweenManager.FilteredOperation(OperationType.TogglePause, FilterType.TargetOrId, targetOrId, optionalBool: false, 0f); } public static bool IsTweening(object targetOrId, bool alsoCheckIfIsPlaying = false) { return TweenManager.FilteredOperation(OperationType.IsTweening, FilterType.TargetOrId, targetOrId, alsoCheckIfIsPlaying, 0f) > 0; } public static int TotalActiveTweens() { return TweenManager.totActiveTweens; } public static int TotalActiveTweeners() { return TweenManager.totActiveTweeners; } public static int TotalActiveSequences() { return TweenManager.totActiveSequences; } public static int TotalPlayingTweens() { return TweenManager.TotalPlayingTweens(); } public static int TotalTweensById(object id, bool playingOnly = false) { if (id == null) { return 0; } return TweenManager.TotalTweensById(id, playingOnly); } public static List<Tween> PlayingTweens(List<Tween> fillableList = null) { fillableList?.Clear(); return TweenManager.GetActiveTweens(playing: true, fillableList); } public static List<Tween> PausedTweens(List<Tween> fillableList = null) { fillableList?.Clear(); return TweenManager.GetActiveTweens(playing: false, fillableList); } public static List<Tween> TweensById(object id, bool playingOnly = false, List<Tween> fillableList = null) { if (id == null) { return null; } fillableList?.Clear(); return TweenManager.GetTweensById(id, playingOnly, fillableList); } public static List<Tween> TweensByTarget(object target, bool playingOnly = false, List<Tween> fillableList = null) { fillableList?.Clear(); return TweenManager.GetTweensByTarget(target, playingOnly, fillableList); } private static void InitCheck() { if (!initialized && Application.isPlaying && !isQuitting) { AutoInit(); } } private static TweenerCore<T1, T2, TPlugOptions> ApplyTo<T1, T2, TPlugOptions>(DOGetter<T1> getter, DOSetter<T1> setter, T2 endValue, float duration, ABSTweenPlugin<T1, T2, TPlugOptions> plugin = null) where TPlugOptions : struct, IPlugOptions { InitCheck(); TweenerCore<T1, T2, TPlugOptions> tweener = TweenManager.GetTweener<T1, T2, TPlugOptions>(); if (!Tweener.Setup(tweener, getter, setter, endValue, duration, plugin)) { TweenManager.Despawn(tweener); return null; } return tweener; } } public static class DOVirtual { public static Tweener Float(float from, float to, float duration, TweenCallback<float> onVirtualUpdate) { return DOTween.To(() => from, delegate(float x) { from = x; }, to, duration).OnUpdate(delegate { onVirtualUpdate(from); }); } public static Tweener Int(int from, int to, float duration, TweenCallback<int> onVirtualUpdate) { return DOTween.To(() => from, delegate(int x) { from = x; }, to, duration).OnUpdate(delegate { onVirtualUpdate(from); }); } public static Tweener Vector2(Vector2 from, Vector2 to, float duration, TweenCallback<Vector2> onVirtualUpdate) { //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_002c: Unknown result type (might be due to invalid IL or missing references) return DOTween.To(() => from, delegate(Vector2 x) { //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) from = x; }, to, duration).OnUpdate(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) onVirtualUpdate(from); }); } public static Tweener Vector3(Vector3 from, Vector3 to, float duration, TweenCallback<Vector3> onVirtualUpdate) { //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_002c: Unknown result type (might be due to invalid IL or missing references) return DOTween.To(() => from, delegate(Vector3 x) { //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) from = x; }, to, duration).OnUpdate(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) onVirtualUpdate(from); }); } public static Tweener Color(Color from, Color to, float duration, TweenCallback<Color> onVirtualUpdate) { //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_002c: Unknown result type (might be due to invalid IL or missing references) return DOTween.To(() => from, delegate(Color x) { //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) from = x; }, to, duration).OnUpdate(delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) onVirtualUpdate(from); }); } public static float EasedValue(float from, float to, float lifetimePercentage, Ease easeType) { return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, DOTween.defaultEaseOvershootOrAmplitude, DOTween.defaultEasePeriod); } public static float EasedValue(float from, float to, float lifetimePercentage, Ease easeType, float overshoot) { return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, overshoot, DOTween.defaultEasePeriod); } public static float EasedValue(float from, float to, float lifetimePercentage, Ease easeType, float amplitude, float period) { return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, amplitude, period); } public static float EasedValue(float from, float to, float lifetimePercentage, AnimationCurve easeCurve) { return from + (to - from) * EaseManager.Evaluate(Ease.INTERNAL_Custom, new EaseCurve(easeCurve).Evaluate, lifetimePercentage, 1f, DOTween.defaultEaseOvershootOrAmplitude, DOTween.defaultEasePeriod); } public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, Ease easeType) { //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_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) return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, DOTween.defaultEaseOvershootOrAmplitude, DOTween.defaultEasePeriod); } public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, Ease easeType, float overshoot) { //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_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) return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, overshoot, DOTween.defaultEasePeriod); } public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, Ease easeType, float amplitude, float period) { //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_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) return from + (to - from) * EaseManager.Evaluate(easeType, null, lifetimePercentage, 1f, amplitude, period); } public static Vector3 EasedValue(Vector3 from, Vector3 to, float lifetimePercentage, AnimationCurve easeCurve) { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) return from + (to - from) * EaseManager.Evaluate(Ease.INTERNAL_Custom, new EaseCurve(easeCurve).Evaluate, lifetimePercentage, 1f, DOTween.defaultEaseOvershootOrAmplitude, DOTween.defaultEasePeriod); } public static Tween DelayedCall(float delay, TweenCallback callback, bool ignoreTimeScale = true) { return DOTween.Sequence().AppendInterval(delay).OnStepComplete(callback) .SetUpdate(UpdateType.Normal, ignoreTimeScale) .SetAutoKill(autoKillOnCompletion: true); } } public enum Ease { Unset, Linear, InSine, OutSine, InOutSine, InQuad, OutQuad, InOutQuad, InCubic, OutCubic, InOutCubic, InQuart, OutQuart, InOutQuart, InQuint, OutQuint, InOutQuint, InExpo, OutExpo, InOutExpo, InCirc, OutCirc, InOutCirc, InElastic, OutElastic, InOutElastic, InBack, OutBack, InOutBack, InBounce, OutBounce, InOutBounce, Flash, InFlash, OutFlash, InOutFlash, INTERNAL_Zero, INTERNAL_Custom } public class EaseFactory { public static EaseFunction StopMotion(int motionFps, Ease? ease = null) { EaseFunction customEase = EaseManager.ToEaseFunction((!ease.HasValue) ? DOTween.defaultEaseType : ease.Value); return StopMotion(motionFps, customEase); } public static EaseFunction StopMotion(int motionFps, AnimationCurve animCurve) { return StopMotion(motionFps, (EaseFunction)new EaseCurve(animCurve).Evaluate); } public static EaseFunction StopMotion(int motionFps, EaseFunction customEase) { float motionDelay = 1f / (float)motionFps; return delegate(float time, float duration, float overshootOrAmplitude, float period) { float time2 = ((time < duration) ? (time - time % motionDelay) : time); return customEase(time2, duration, overshootOrAmplitude, period); }; } } public interface IDOTweenInit { IDOTweenInit SetCapacity(int tweenersCapacity, int sequencesCapacity); } public enum LinkBehaviour { PauseOnDisable, PauseOnDisablePlayOnEnable, PauseOnDisableRestartOnEnable, PlayOnEnable, RestartOnEnable, KillOnDisable, KillOnDestroy, CompleteOnDisable, CompleteAndKillOnDisable, RewindOnDisable, RewindAndKillOnDisable } public enum PathMode { Ignore, Full3D, TopDown2D, Sidescroller2D } public enum PathType { Linear, CatmullRom, CubicBezier } public enum RotateMode { Fast, FastBeyond360, WorldAxisAdd, LocalAxisAdd } public enum ScrambleMode { None, All, Uppercase, Lowercase, Numerals, Custom } public enum ShakeRandomnessMode { Full, Harmonic } public static class TweenExtensions { public static void Complete(this Tween t) { t.Complete(withCallbacks: false); } public static void Complete(this Tween t, bool withCallbacks) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.Complete(t, modifyActiveLists: true, (!withCallbacks) ? UpdateMode.Goto : UpdateMode.Update); } } public static T Done<T>(this T t) where T : Tween { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return t; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return t; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return t; } if (t.duration <= 0f) { TweenManager.Complete(t); } return t; } public static void Flip(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.Flip(t); } } public static void ForceInit(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.ForceInit(t); } } public static void Goto(this Tween t, float to, bool andPlay = false) { DoGoto(t, to, andPlay, withCallbacks: false); } public static void GotoWithCallbacks(this Tween t, float to, bool andPlay = false) { DoGoto(t, to, andPlay, withCallbacks: true); } private static void DoGoto(Tween t, float to, bool andPlay, bool withCallbacks) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return; } if (to < 0f) { to = 0f; } if (!t.startupDone) { TweenManager.ForceInit(t); } TweenManager.Goto(t, to, andPlay, (!withCallbacks) ? UpdateMode.Goto : UpdateMode.Update); } public static void Kill(this Tween t, bool complete = false) { if (!DOTween.initialized || t == null || !t.active) { return; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return; } if (complete) { TweenManager.Complete(t); if (t.autoKill && t.loops >= 0) { return; } } if (TweenManager.isUpdateLoop) { t.active = false; } else { TweenManager.Despawn(t); } } public static void ManualUpdate(this Tween t, float deltaTime, float unscaledDeltaTime) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.Update(t, deltaTime, unscaledDeltaTime, isSingleTweenManualUpdate: true); } } public static T Pause<T>(this T t) where T : Tween { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return t; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return t; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return t; } TweenManager.Pause(t); return t; } public static T Play<T>(this T t) where T : Tween { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return t; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return t; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return t; } TweenManager.Play(t); return t; } public static void PlayBackwards(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.PlayBackwards(t); } } public static void PlayForward(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.PlayForward(t); } } public static void Restart(this Tween t, bool includeDelay = true, float changeDelayTo = -1f) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.Restart(t, includeDelay, changeDelayTo); } } public static void Rewind(this Tween t, bool includeDelay = true) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.Rewind(t, includeDelay); } } public static void SmoothRewind(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.SmoothRewind(t); } } public static void TogglePause(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } } else if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } } else if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } } else { TweenManager.TogglePause(t); } } public static void GotoWaypoint(this Tween t, int waypointIndex, bool andPlay = false) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return; } if (!(t is TweenerCore<Vector3, Path, PathOptions> tweenerCore)) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNonPathTween(t); } return; } if (!t.startupDone) { TweenManager.ForceInit(t); } if (waypointIndex < 0) { waypointIndex = 0; } else if (waypointIndex > tweenerCore.changeValue.wps.Length - 1) { waypointIndex = tweenerCore.changeValue.wps.Length - 1; } float num = 0f; for (int i = 0; i < waypointIndex + 1; i++) { num += tweenerCore.changeValue.wpLengths[i]; } float num2 = num / tweenerCore.changeValue.length; if (t.hasLoops && t.loopType == LoopType.Yoyo && ((t.position < t.duration) ? ((byte)(t.completedLoops % 2) != 0) : (t.completedLoops % 2 == 0))) { num2 = 1f - num2; } float to = (float)(t.isComplete ? (t.completedLoops - 1) : t.completedLoops) * t.duration + num2 * t.duration; TweenManager.Goto(t, to, andPlay); } public static YieldInstruction WaitForCompletion(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return (YieldInstruction)(object)((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForCompletion(t)); } public static YieldInstruction WaitForRewind(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return (YieldInstruction)(object)((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForRewind(t)); } public static YieldInstruction WaitForKill(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return (YieldInstruction)(object)((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForKill(t)); } public static YieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return (YieldInstruction)(object)((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForElapsedLoops(t, elapsedLoops)); } public static YieldInstruction WaitForPosition(this Tween t, float position) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return (YieldInstruction)(object)((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForPosition(t, position)); } public static Coroutine WaitForStart(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } return ((MonoBehaviour)DOTween.instance).StartCoroutine(DOTween.instance.WaitForStart(t)); } public static int CompletedLoops(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0; } return t.completedLoops; } public static float Delay(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } return t.delay; } public static float ElapsedDelay(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } return t.elapsedDelay; } public static float Duration(this Tween t, bool includeLoops = true) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } if (includeLoops) { if (t.loops != -1) { return t.duration * (float)t.loops; } return float.PositiveInfinity; } return t.duration; } public static float Elapsed(this Tween t, bool includeLoops = true) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } if (includeLoops) { return (float)((t.position >= t.duration) ? (t.completedLoops - 1) : t.completedLoops) * t.duration + t.position; } return t.position; } public static float ElapsedPercentage(this Tween t, bool includeLoops = true) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } if (includeLoops) { if (t.fullDuration <= 0f) { return 0f; } return ((float)((t.position >= t.duration) ? (t.completedLoops - 1) : t.completedLoops) * t.duration + t.position) / t.fullDuration; } return t.position / t.duration; } public static float ElapsedDirectionalPercentage(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0f; } float num = t.position / t.duration; if (t.completedLoops <= 0 || !t.hasLoops || t.loopType != LoopType.Yoyo || ((t.isComplete || t.completedLoops % 2 == 0) && (!t.isComplete || t.completedLoops % 2 != 0))) { return num; } return 1f - num; } public static bool IsActive(this Tween t) { return t?.active ?? false; } public static bool IsBackwards(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return false; } return t.isBackwards; } public static bool IsLoopingOrExecutingBackwards(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return false; } if (t.isBackwards) { if (t.completedLoops >= 1 && t.loopType == LoopType.Yoyo) { return t.completedLoops % 2 == 0; } return true; } if (t.completedLoops >= 1 && t.loopType == LoopType.Yoyo) { return t.completedLoops % 2 != 0; } return false; } public static bool IsComplete(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return false; } return t.isComplete; } public static bool IsInitialized(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return false; } return t.startupDone; } public static bool IsPlaying(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return false; } return t.isPlaying; } public static int Loops(this Tween t) { if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return 0; } return t.loops; } public static Vector3 PathGetPoint(this Tween t, float pathPercentage) { //IL_0031: 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_0069: 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_0087: 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) if (pathPercentage > 1f) { pathPercentage = 1f; } else if (pathPercentage < 0f) { pathPercentage = 0f; } if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return Vector3.zero; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return Vector3.zero; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return Vector3.zero; } if (!(t is TweenerCore<Vector3, Path, PathOptions> tweenerCore)) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNonPathTween(t); } return Vector3.zero; } if (!tweenerCore.endValue.isFinalized) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogWarning("The path is not finalized yet", t); } return Vector3.zero; } return tweenerCore.endValue.GetPoint(pathPercentage, convertToConstantPerc: true); } public static Vector3[] PathGetDrawPoints(this Tween t, int subdivisionsXSegment = 10) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return null; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return null; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return null; } if (!(t is TweenerCore<Vector3, Path, PathOptions> tweenerCore)) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNonPathTween(t); } return null; } if (!tweenerCore.endValue.isFinalized) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogWarning("The path is not finalized yet", t); } return null; } return Path.GetDrawPoints(tweenerCore.endValue, subdivisionsXSegment); } public static float PathLength(this Tween t) { if (t == null) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNullTween(t); } return -1f; } if (!t.active) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogInvalidTween(t); } return -1f; } if (t.isSequenced) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNestedTween(t); } return -1f; } if (!(t is TweenerCore<Vector3, Path, PathOptions> tweenerCore)) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogNonPathTween(t); } return -1f; } if (!tweenerCore.endValue.isFinalized) { if (DG.Tweening.Core.Debugger.logPriority > 1) { DG.Tweening.Core.Debugger.LogWarning("The path is not finalized yet", t); } return -1f; } return tweenerCore.endValue.length; } } public enum LoopType { Restart, Yoyo, Incremental } public sealed class Sequence : Tween { internal readonly List<Tween> sequencedTweens = new List<Tween>(); private readonly List<ABSSequentiable> _sequencedObjs = new List<ABSSequentiable>(); internal float lastTweenInsertTime; internal Sequence() { tweenType = TweenType.Sequence; Reset(); } internal static Sequence DoPrepend(Sequence inSequence, Tween t) { if (t.loops == -1) { t.loops = int.MaxValue; DG.Tweening.Core.Debugger.LogWarning("Infinite loops aren't allowed inside a Sequence (only on the Sequence itself) and will be changed to int.MaxValue", t); } float num = t.delay + t.duration * (float)t.loops; inSequence.duration += num; int count = inSequence._sequencedObjs.Count; for (int i = 0; i < count; i++) { ABSSequentiable aBSSequentiable = inSequence._sequencedObjs[i]; aBSSequentiable.sequencedPosition += num; aBSSequentiable.sequencedEndPosition += num; } return DoInsert(inSequence, t, 0f); } internal static Sequence DoInsert(Sequence inSequence, Tween t, float atPosition) { TweenManager.AddActiveTweenToSequence(t); atPosition += t.delay; inSequence.lastTweenInsertTime = atPosition; t.isSequenced = (t.creationLocked = true); t.sequenceParent = inSequence; if (t.loops == -1) { t.loops = int.MaxValue; DG.Tweening.Core.Debugger.LogWarning("Infinite loops aren't allowed inside a Sequence (only on the Sequence itself) and will be changed to int.MaxValue", t); } float num = t.duration * (float)t.loops; t.autoKill = false; t.delay = (t.elapsedDelay = 0f); t.delayComplete = true; if (t.isSpeedBased) { t.isSpeedBased = false; DG.Tweening.Core.Debugger.LogWarning("SpeedBased tweens are not allowed inside a Sequence: interpreting speed as duration", t); } t.sequencedPosition = atPosition; t.sequencedEndPosition = atPosition + num; if (t.sequencedEndPosition > inSequence.duration) { inSequence.duration = t.sequencedEndPosition; } inSequence._sequencedObjs.Add(t); inSequence.sequencedTweens.Add(t); return inSequence; } internal static Sequence DoAppendInterval(Sequence inSequence, float interval) { inSequence.lastTweenInsertTime = inSequence.duration; inSequence.duration += interval; return inSequence; } internal static Sequence DoPrependInterval(Sequence inSequence, float interval) { inSequence.lastTweenInsertTime = 0f; inSequence.duration += interval; int count = inSequence._sequencedObjs.Count; for (int i = 0; i < count; i++) { ABSSequentiable aBSSequentiable = inSequence._sequencedObjs[i]; aBSSequentiable.sequencedPosition += interval; aBSSequentiable.sequencedEndPosition += interval; } return inSequence; } internal static Sequence DoInsertCallback(Sequence inSequence, TweenCallback callback, float atPosition) { inSequence.lastTweenInsertTime = atPosition; SequenceCallback sequenceCallback = new SequenceCallback(atPosition, callback); sequenceCallback.sequencedPosition = (sequenceCallback.sequencedEndPosition = atPosition); inSequence._sequencedObjs.Add(sequenceCallback); if (inSequence.duration < atPosition) { inSequence.duration = atPosition; } return inSequence; } internal override float UpdateDelay(float elapsed) { float num = delay; if (elapsed > num) { elapsedDelay = num; delayComplete = true; return elapsed - num; } elapsedDelay = elapsed; return 0f; } internal override void Reset() { base.Reset(); sequencedTweens.Clear(); _sequencedObjs.Clear(); lastTweenInsertTime = 0f; } internal override bool Validate() { int count = sequencedTweens.Count; for (int i = 0; i < count; i++) { if (!sequencedTweens[i].Validate()) { return false; } } return true; } internal override bool Startup() { return DoStartup(this); } internal override bool ApplyTween(float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode, UpdateNotice updateNotice) { return DoApplyTween(this, prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode); } internal static void Setup(Sequence s) { s.autoKill = DOTween.defaultAutoKill; s.isRecyclable = DOTween.defaultRecyclable; s.isPlaying = DOTween.defaultAutoPlay == AutoPlay.All || DOTween.defaultAutoPlay == AutoPlay.AutoPlaySequences; s.loopType = DOTween.defaultLoopType; s.easeType = Ease.Linear; s.easeOvershootOrAmplitude = DOTween.defaultEaseOvershootOrAmplitude; s.easePeriod = DOTween.defaultEasePeriod; } internal static bool DoStartup(Sequence s) { int count = s._sequencedObjs.Count; if (s.sequencedTweens.Count == 0 && count == 0 && !IsAnyCallbackSet(s)) { return false; } s.startupDone = true; s.fullDuration = ((s.loops > -1) ? (s.duration * (float)s.loops) : float.PositiveInfinity); StableSortSequencedObjs(s._sequencedObjs); if (s.isRelative) { int count2 = s.sequencedTweens.Count; for (int i = 0; i < count2; i++) { _ = s.sequencedTweens[i]; if (!s.isBlendable) { s.sequencedTweens[i].isRelative = true; } } } if (s.isInverted) { for (int j = 0; j < count; j++) { ABSSequentiable aBSSequentiable = s._sequencedObjs[j]; if (aBSSequentiable.tweenType == TweenType.Tweener) { Tween tween = (Tween)aBSSequentiable; TweenManager.Goto(tween, tween.duration * (float)tween.loops, andPlay: false, UpdateMode.IgnoreOnComplete); tween.isInverted = true; } } } return true; } internal static bool DoApplyTween(Sequence s, float prevPosition, int prevCompletedLoops, int newCompletedSteps, bool useInversePosition, UpdateMode updateMode) { float num = prevPosition; float num2 = s.position; if (s.isInverted) { useInversePosition = !useInversePosition; } if (s.easeType != Ease.Linear) { num = s.duration * EaseManager.Evaluate(s.easeType, s.customEase, num, s.duration, s.easeOvershootOrAmplitude, s.easePeriod); num2 = s.duration * EaseManager.Evaluate(s.easeType, s.customEase, num2, s.duration, s.easeOvershootOrAmplitude, s.easePeriod); } float num3 = 0f; bool flag = (s.loops == -1 || s.loops > 1) && s.loopType == LoopType.Yoyo && ((num < s.duration) ? (prevCompletedLoops % 2 != 0) : (prevCompletedLoops % 2 == 0)); if (s.isBackwards) { flag = !flag; } if (s.isInverted) { flag = !flag; } float num8; if (newCompletedSteps > 0) { int num4 = s.completedLoops; float num5 = s.position; int num6 = newCompletedSteps; int num7 = 0; num8 = num; if (updateMode == UpdateMode.Update) { while (num7 < num6) { if (num7 > 0) { num8 = num3; } else if (flag && !s.isBackwards) { num8 = s.duration - num8; } num3 = (flag ? 0f : s.duration); if (ApplyInternalCycle(s, num8, num3, updateMode, useInversePosition, flag, multiCycleStep: true)) { return true; } num7++; if (s.hasLoops && s.loopType == LoopType.Yoyo) { flag = !flag; } } if (num4 != s.completedLoops || Math.Abs(num5 - s.position) > float.Epsilon) { return !s.active; } } else { if (s.hasLoops && s.loopType == LoopType.Yoyo && newCompletedSteps % 2 != 0) { flag = !flag; num = s.duration - num; } newCompletedSteps = 0; } } if (newCompletedSteps == 1 && s.isComplete) { return false; } if (newCompletedSteps > 0 && !s.isComplete) { num8 = (useInversePosition ? s.duration : 0f); if (s.loopType == LoopType.Restart && num3 > 0f) { ApplyInternalCycle(s, s.duration, 0f, UpdateMode.Goto, useInverse: false, prevPosIsInverse: false); } } else { num8 = (useInversePosition ? (s.duration - num) : num); } return ApplyInternalCycle(s, num8, useInversePosition ? (s.duration - num2) : num2, updateMode, useInversePosition, flag); } private static bool ApplyInternalCycle(Sequence s, float fromPos, float toPos, UpdateMode updateMode, bool useInverse, bool prevPosIsInverse, bool multiCycleStep = false) { bool flag = s.isPlaying; if (toPos < fromPos) { int num = s._sequencedObjs.Count - 1; for (int num2 = num; num2 > -1; num2--) { if (!s.active) { return true; } if (!s.isPlaying && flag) { return false; } ABSSequentiable aBSSequentiable = s._sequencedObjs[num2]; if (!(aBSSequentiable.sequencedEndPosition < toPos) && !(aBSSequentiable.sequencedPosition > fromPos)) { if (aBSSequentiable.tweenType == TweenType.Callback) { if (updateMode == UpdateMode.Update && prevPosIsInverse) { Tween.OnTweenCallback(aBSSequentiable.onStart, s); } } else { float num3 = toPos - aBSSequentiable.sequencedPosition; if (num3 < 0f) { num3 = 0f; } Tween tween = (Tween)aBSSequentiable; if (tween.startupDone) { tween.isBackwards = true; if (s.isInverted) { num3 = tween.fullDuration - num3; } if (TweenManager.Goto(tween, num3, andPlay: false, updateMode)) { if (DOTween.nestedTweenFailureBehaviour == NestedTweenFailureBehaviour.KillWholeSequence) { return true; } if (s.sequencedTweens.Count == 1 && s._sequencedObjs.Count == 1 && !IsAnyCallbackSet(s)) { return true; } TweenManager.Despawn(tween, modifyActiveLists: false); s._sequencedObjs.RemoveAt(num2); s.sequencedTweens.Remove(tween); num2--; num--; } else if (multiCycleStep && tween.tweenType == TweenType.Sequence) { if (s.position <= 0f && s.completedLoops == 0) { tween.position = 0f; } else { bool flag2 = s.completedLoops == 0 || (s.isBackwards && (s.completedLoops < s.loops || s.loops == -1)); if (tween.isBackwards) { flag2 = !flag2; } if (useInverse) { flag2 = !flag2; } if (s.isBackwards && !useInverse && !prevPosIsInverse) { flag2 = !flag2; } tween.position = (flag2 ? 0f : tween.duration); } } } } } } } else { int num4 = s._sequencedObjs.Count; for (int i = 0; i < num4; i++) { if (!s.active) { return true; } if (!s.isPlaying && flag) { return false; } ABSSequentiable aBSSequentiable2 = s._sequencedObjs[i]; if (aBSSequentiable2.sequencedPosition > toPos || (aBSSequentiable2.sequencedPosition > 0f && aBSSequentiable2.sequencedEndPosition <= fromPos) || (aBSSequentiable2.sequencedPosition <= 0f && aBSSequentiable2.sequencedEndPosition < fromPos)) { continue; } if (aBSSequentiable2.tweenType == TweenType.Callback) { if (updateMode == UpdateMode.Update && ((!s.isBackwards && !useInverse && !prevPosIsInverse) || (s.isBackwards && useInverse && !prevPosIsInverse))) { Tween.OnTweenCallback(aBSSequentiable2.onStart, s); } continue; } float num5 = toPos - aBSSequentiable2.sequencedPosition; if (num5 < 0f) { num5 = 0f; } Tween tween2 = (Tween)aBSSequentiable2; if (toPos >= aBSSequentiable2.sequencedEndPosition) { if (!tween2.startupDone) { TweenManager.ForceInit(tween2, isSequenced: true); } if (num5 < tween2.fullDuration) { num5 = tween2.fullDuration; } } tween2.isBackwards = false; if (s.isInverted) { num5 = tween2.fullDuration - num5; } if (TweenManager.Goto(tween2, num5, andPlay: false, updateMode)) { if (DOTween.nestedTweenFailureBehaviour == NestedTweenFailureBehaviour.KillWholeSequence) { return true; } if (s.sequencedTweens.Count == 1 && s._sequencedObjs.Count == 1 && !IsAnyCallbackSet(s)) { return true; } TweenManager.Despawn(tween2, modifyActiveLists: false); s._sequencedObjs.RemoveAt(i); s.sequencedTweens.Remove(tween2); i--; num4--; } else { if (!multiCycleStep || tween2.tweenType != TweenType.Sequence) { continue; } if (s.position <= 0f && s.completedLoops == 0) { tween2.position = 0f; continue; } bool flag3 = s.completedLoops == 0 || (!s.isBackwards && (s.completedLoops < s.loops || s.loops == -1)); if (tween2.isBackwards) { flag3 = !flag3; } if (useInverse) { flag3 = !flag3; } if (s.isBackwards && !useInverse && !prevPosIsInverse) { flag3 = !flag3; } tween2.position = (flag3 ? 0f : tween2.duration); } } } return false; } private static void StableSortSequencedObjs(List<ABSSequentiable> list) { int count = list.Count; for (int i = 1; i < count; i++) { int num = i; ABSSequentiable aBSSequentiable = list[i]; while (num > 0 && list[num - 1].sequencedPosition > aBSSequentiable.sequencedPosition) { list[num] = list[num - 1]; num--; } list[num] = aBSSequentiable; } } private static bool IsAnyCallbackSet(Sequence s) { if (s.onComplete == null && s.onKill == null && s.onPause == null && s.onPlay == null && s.onRewind == null && s.onStart == null && s.onStepComplete == null) { return s.onUpdate != null; } return true; } } public static class ShortcutExtensions { public static TweenerCore<float, float, FloatOptions> DOAspect(this Camera target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.aspect, delegate(float x) { target.aspect = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOColor(this Camera target, Color endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.To(() => target.backgroundColor, delegate(Color x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.backgroundColor = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOFarClipPlane(this Camera target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.farClipPlane, delegate(float x) { target.farClipPlane = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOFieldOfView(this Camera target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.fieldOfView, delegate(float x) { target.fieldOfView = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DONearClipPlane(this Camera target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.nearClipPlane, delegate(float x) { target.nearClipPlane = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOOrthoSize(this Camera target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.orthographicSize, delegate(float x) { target.orthographicSize = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Rect, Rect, RectOptions> DOPixelRect(this Camera target, Rect endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Rect, Rect, RectOptions> tweenerCore = DOTween.To(() => target.pixelRect, delegate(Rect x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.pixelRect = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Rect, Rect, RectOptions> DORect(this Camera target, Rect endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Rect, Rect, RectOptions> tweenerCore = DOTween.To(() => target.rect, delegate(Rect x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.rect = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static Tweener DOShakePosition(this Camera target, float duration, float strength = 3f, int vibrato = 10, float randomness = 90f, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { if (duration <= 0f) { if (DG.Tweening.Core.Debugger.logPriority > 0) { Debug.LogWarning((object)"DOShakePosition: duration can't be 0, returning NULL without creating a tween"); } return null; } return DOTween.Shake(() => ((Component)target).transform.localPosition, delegate(Vector3 x) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)target).transform.localPosition = x; }, duration, strength, vibrato, randomness, ignoreZAxis: true, fadeOut, randomnessMode).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetCameraShakePosition); } public static Tweener DOShakePosition(this Camera target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (duration <= 0f) { if (DG.Tweening.Core.Debugger.logPriority > 0) { Debug.LogWarning((object)"DOShakePosition: duration can't be 0, returning NULL without creating a tween"); } return null; } return DOTween.Shake(() => ((Component)target).transform.localPosition, delegate(Vector3 x) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)target).transform.localPosition = x; }, duration, strength, vibrato, randomness, fadeOut, randomnessMode).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetCameraShakePosition); } public static Tweener DOShakeRotation(this Camera target, float duration, float strength = 90f, int vibrato = 10, float randomness = 90f, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { if (duration <= 0f) { if (DG.Tweening.Core.Debugger.logPriority > 0) { Debug.LogWarning((object)"DOShakeRotation: duration can't be 0, returning NULL without creating a tween"); } return null; } return DOTween.Shake(() => ((Component)target).transform.localEulerAngles, delegate(Vector3 x) { //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) ((Component)target).transform.localRotation = Quaternion.Euler(x); }, duration, strength, vibrato, randomness, ignoreZAxis: false, fadeOut, randomnessMode).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake); } public static Tweener DOShakeRotation(this Camera target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f, bool fadeOut = true, ShakeRandomnessMode randomnessMode = ShakeRandomnessMode.Full) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (duration <= 0f) { if (DG.Tweening.Core.Debugger.logPriority > 0) { Debug.LogWarning((object)"DOShakeRotation: duration can't be 0, returning NULL without creating a tween"); } return null; } return DOTween.Shake(() => ((Component)target).transform.localEulerAngles, delegate(Vector3 x) { //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) ((Component)target).transform.localRotation = Quaternion.Euler(x); }, duration, strength, vibrato, randomness, fadeOut, randomnessMode).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake); } public static TweenerCore<Color, Color, ColorOptions> DOColor(this Light target, Color endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.To(() => target.color, delegate(Color x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.color = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOIntensity(this Light target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.intensity, delegate(float x) { target.intensity = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOShadowStrength(this Light target, float endValue, float duration) { TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.shadowStrength, delegate(float x) { target.shadowStrength = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static Tweener DOColor(this LineRenderer target, Color2 startValue, Color2 endValue, float duration) { return DOTween.To(() => startValue, delegate(Color2 x) { //IL_0007: 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) target.startColor = x.ca; target.endColor = x.cb; }, endValue, duration).SetTarget(target); } public static TweenerCore<Color, Color, ColorOptions> DOColor(this Material target, Color endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.To(() => target.color, delegate(Color x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.color = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOColor(this Material target, Color endValue, string property, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.To(() => target.GetColor(property), delegate(Color x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetColor(property, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOColor(this Material target, Color endValue, int propertyID, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!target.HasProperty(propertyID)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(propertyID); } return null; } TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.To(() => target.GetColor(propertyID), delegate(Color x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetColor(propertyID, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOFade(this Material target, float endValue, float duration) { TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.ToAlpha(() => target.color, delegate(Color x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.color = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOFade(this Material target, float endValue, string property, float duration) { if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.ToAlpha(() => target.GetColor(property), delegate(Color x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetColor(property, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Color, Color, ColorOptions> DOFade(this Material target, float endValue, int propertyID, float duration) { if (!target.HasProperty(propertyID)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(propertyID); } return null; } TweenerCore<Color, Color, ColorOptions> tweenerCore = DOTween.ToAlpha(() => target.GetColor(propertyID), delegate(Color x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetColor(propertyID, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOFloat(this Material target, float endValue, string property, float duration) { if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.GetFloat(property), delegate(float x) { target.SetFloat(property, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<float, float, FloatOptions> DOFloat(this Material target, float endValue, int propertyID, float duration) { if (!target.HasProperty(propertyID)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(propertyID); } return null; } TweenerCore<float, float, FloatOptions> tweenerCore = DOTween.To(() => target.GetFloat(propertyID), delegate(float x) { target.SetFloat(propertyID, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Vector2, Vector2, VectorOptions> tweenerCore = DOTween.To(() => target.mainTextureOffset, delegate(Vector2 x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.mainTextureOffset = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Vector2, Vector2, VectorOptions> DOOffset(this Material target, Vector2 endValue, string property, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<Vector2, Vector2, VectorOptions> tweenerCore = DOTween.To(() => target.GetTextureOffset(property), delegate(Vector2 x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetTextureOffset(property, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, float duration) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) TweenerCore<Vector2, Vector2, VectorOptions> tweenerCore = DOTween.To(() => target.mainTextureScale, delegate(Vector2 x) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) target.mainTextureScale = x; }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Vector2, Vector2, VectorOptions> DOTiling(this Material target, Vector2 endValue, string property, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<Vector2, Vector2, VectorOptions> tweenerCore = DOTween.To(() => target.GetTextureScale(property), delegate(Vector2 x) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) target.SetTextureScale(property, x); }, endValue, duration); tweenerCore.SetTarget(target); return tweenerCore; } public static TweenerCore<Vector4, Vector4, VectorOptions> DOVector(this Material target, Vector4 endValue, string property, float duration) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!target.HasProperty(property)) { if (DG.Tweening.Core.Debugger.logPriority > 0) { DG.Tweening.Core.Debugger.LogMissingMaterialProperty(property); } return null; } TweenerCore<Vector4, Vector4, VectorOptions> tweenerCore = DOTween.To(() => target.GetVecto