mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-04 22:34:56 +08:00
[BUGFIX] Added PreserveAttribute to preserve Reflection/reflected methods on Unity 2018 and medium/high stripping levels
This commit is contained in:
parent
0e63b84837
commit
64b3cb86a1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,8 @@
|
|||||||
// Author: Daniele Giardini - http://www.demigiant.com
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
// Created: 2018/07/13
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using DG.Tweening.Core;
|
using DG.Tweening.Core;
|
||||||
using DG.Tweening.Plugins.Core.PathCore;
|
using DG.Tweening.Plugins.Core.PathCore;
|
||||||
@ -25,9 +27,14 @@ namespace DG.Tweening
|
|||||||
{
|
{
|
||||||
static bool _initialized;
|
static bool _initialized;
|
||||||
|
|
||||||
|
#region Reflection
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called via Reflection by DOTweenComponent on Awake
|
/// Called via Reflection by DOTweenComponent on Awake
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
if (_initialized) return;
|
if (_initialized) return;
|
||||||
@ -44,6 +51,18 @@ namespace DG.Tweening
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
// Just used to preserve methods when building, never called
|
||||||
|
static void Preserver()
|
||||||
|
{
|
||||||
|
Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
|
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
|
||||||
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
||||||
@ -89,6 +108,9 @@ namespace DG.Tweening
|
|||||||
|
|
||||||
// Called via Reflection by DOTweenPathInspector
|
// Called via Reflection by DOTweenPathInspector
|
||||||
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
|
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static bool HasRigidbody(Component target)
|
public static bool HasRigidbody(Component target)
|
||||||
{
|
{
|
||||||
#if true // PHYSICS_MARKER
|
#if true // PHYSICS_MARKER
|
||||||
@ -99,6 +121,9 @@ namespace DG.Tweening
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called via Reflection by DOTweenPath
|
// Called via Reflection by DOTweenPath
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
|
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
|
||||||
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
|
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
|
||||||
){
|
){
|
||||||
|
|||||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
|||||||
public class DOTween
|
public class DOTween
|
||||||
{
|
{
|
||||||
/// <summary>DOTween's version</summary>
|
/// <summary>DOTween's version</summary>
|
||||||
public static readonly string Version = "1.2.190"; // Last version before modules: 1.1.755
|
public static readonly string Version = "1.2.196"; // Last version before modules: 1.1.755
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Options ////////////////////////////////////
|
// Options ////////////////////////////////////
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,8 @@
|
|||||||
// Author: Daniele Giardini - http://www.demigiant.com
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
// Created: 2018/07/13
|
// Created: 2018/07/13
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using DG.Tweening.Core;
|
using DG.Tweening.Core;
|
||||||
using DG.Tweening.Plugins.Core.PathCore;
|
using DG.Tweening.Plugins.Core.PathCore;
|
||||||
@ -25,9 +27,14 @@ namespace DG.Tweening
|
|||||||
{
|
{
|
||||||
static bool _initialized;
|
static bool _initialized;
|
||||||
|
|
||||||
|
#region Reflection
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called via Reflection by DOTweenComponent on Awake
|
/// Called via Reflection by DOTweenComponent on Awake
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
if (_initialized) return;
|
if (_initialized) return;
|
||||||
@ -44,6 +51,18 @@ namespace DG.Tweening
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
// Just used to preserve methods when building, never called
|
||||||
|
static void Preserver()
|
||||||
|
{
|
||||||
|
Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
|
// Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime)
|
||||||
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1
|
||||||
@ -89,6 +108,9 @@ namespace DG.Tweening
|
|||||||
|
|
||||||
// Called via Reflection by DOTweenPathInspector
|
// Called via Reflection by DOTweenPathInspector
|
||||||
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
|
// Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static bool HasRigidbody(Component target)
|
public static bool HasRigidbody(Component target)
|
||||||
{
|
{
|
||||||
#if true // PHYSICS_MARKER
|
#if true // PHYSICS_MARKER
|
||||||
@ -99,6 +121,9 @@ namespace DG.Tweening
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called via Reflection by DOTweenPath
|
// Called via Reflection by DOTweenPath
|
||||||
|
#if UNITY_2018_1_OR_NEWER
|
||||||
|
[UnityEngine.Scripting.Preserve]
|
||||||
|
#endif
|
||||||
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
|
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
|
||||||
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
|
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
|
||||||
){
|
){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user