mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-09 08:38:45 +08:00
Added CustomPlugins.PureQuaternionPlugin + Transform.DORotateQuaternion/DOLocalRotateQuaternion
This commit is contained in:
parent
55bd172cdc
commit
8345c34fca
@ -188,6 +188,43 @@
|
||||
Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.CustomPlugins.PureQuaternionPlugin">
|
||||
<summary>
|
||||
Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
|
||||
<para>Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).</para>
|
||||
<para>To use it, call DOTween.To with the plugin parameter overload, passing it <c>PureQuaternionPlugin.Plug()</c> as first parameter
|
||||
(do not use any of the other public PureQuaternionPlugin methods):</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Plug">
|
||||
<summary>
|
||||
Plug this plugin inside a DOTween.To call.
|
||||
<para>Example:</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Reset(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetFrom(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},System.Boolean)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.ConvertToStartValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetRelativeEndValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetChangeValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.GetSpeedBasedDuration(DG.Tweening.Plugins.Options.NoOptions,System.Single,UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.EvaluateAndApply(DG.Tweening.Plugins.Options.NoOptions,DG.Tweening.Tween,System.Boolean,DG.Tweening.Core.DOGetter{UnityEngine.Quaternion},DG.Tweening.Core.DOSetter{UnityEngine.Quaternion},System.Single,UnityEngine.Quaternion,UnityEngine.Quaternion,System.Single,System.Boolean,DG.Tweening.Core.Enums.UpdateNotice)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.DOTween">
|
||||
<summary>
|
||||
Main DOTween class. Contains static methods to create and control tweens in a generic way
|
||||
@ -1419,12 +1456,30 @@
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DORotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotate(UnityEngine.Transform,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
|
||||
<summary>Tweens a Transform's localRotation to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOScale(UnityEngine.Transform,UnityEngine.Vector3,System.Single)">
|
||||
<summary>Tweens a Transform's localScale to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -188,6 +188,43 @@
|
||||
Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.CustomPlugins.PureQuaternionPlugin">
|
||||
<summary>
|
||||
Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
|
||||
<para>Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).</para>
|
||||
<para>To use it, call DOTween.To with the plugin parameter overload, passing it <c>PureQuaternionPlugin.Plug()</c> as first parameter
|
||||
(do not use any of the other public PureQuaternionPlugin methods):</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Plug">
|
||||
<summary>
|
||||
Plug this plugin inside a DOTween.To call.
|
||||
<para>Example:</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Reset(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetFrom(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},System.Boolean)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.ConvertToStartValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetRelativeEndValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetChangeValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.GetSpeedBasedDuration(DG.Tweening.Plugins.Options.NoOptions,System.Single,UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.EvaluateAndApply(DG.Tweening.Plugins.Options.NoOptions,DG.Tweening.Tween,System.Boolean,DG.Tweening.Core.DOGetter{UnityEngine.Quaternion},DG.Tweening.Core.DOSetter{UnityEngine.Quaternion},System.Single,UnityEngine.Quaternion,UnityEngine.Quaternion,System.Single,System.Boolean,DG.Tweening.Core.Enums.UpdateNotice)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.DOTween">
|
||||
<summary>
|
||||
Main DOTween class. Contains static methods to create and control tweens in a generic way
|
||||
@ -1419,12 +1456,30 @@
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DORotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotate(UnityEngine.Transform,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
|
||||
<summary>Tweens a Transform's localRotation to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOScale(UnityEngine.Transform,UnityEngine.Vector3,System.Single)">
|
||||
<summary>Tweens a Transform's localScale to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -188,6 +188,43 @@
|
||||
Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.CustomPlugins.PureQuaternionPlugin">
|
||||
<summary>
|
||||
Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
|
||||
<para>Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).</para>
|
||||
<para>To use it, call DOTween.To with the plugin parameter overload, passing it <c>PureQuaternionPlugin.Plug()</c> as first parameter
|
||||
(do not use any of the other public PureQuaternionPlugin methods):</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Plug">
|
||||
<summary>
|
||||
Plug this plugin inside a DOTween.To call.
|
||||
<para>Example:</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Reset(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetFrom(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},System.Boolean)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.ConvertToStartValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetRelativeEndValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetChangeValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.GetSpeedBasedDuration(DG.Tweening.Plugins.Options.NoOptions,System.Single,UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.EvaluateAndApply(DG.Tweening.Plugins.Options.NoOptions,DG.Tweening.Tween,System.Boolean,DG.Tweening.Core.DOGetter{UnityEngine.Quaternion},DG.Tweening.Core.DOSetter{UnityEngine.Quaternion},System.Single,UnityEngine.Quaternion,UnityEngine.Quaternion,System.Single,System.Boolean,DG.Tweening.Core.Enums.UpdateNotice)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.DOTween">
|
||||
<summary>
|
||||
Main DOTween class. Contains static methods to create and control tweens in a generic way
|
||||
@ -1419,12 +1456,30 @@
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DORotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotate(UnityEngine.Transform,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
|
||||
<summary>Tweens a Transform's localRotation to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOScale(UnityEngine.Transform,UnityEngine.Vector3,System.Single)">
|
||||
<summary>Tweens a Transform's localScale to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
17
UnityTests.Unity5/Assets/_Tests/PureQuaternionPluginTests.cs
Normal file
17
UnityTests.Unity5/Assets/_Tests/PureQuaternionPluginTests.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
using DG.Tweening.CustomPlugins;
|
||||
|
||||
public class PureQuaternionPluginTests : BrainBase
|
||||
{
|
||||
public Transform target;
|
||||
public Vector3 to;
|
||||
public bool isRelative;
|
||||
|
||||
IEnumerator Start()
|
||||
{
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
target.DORotateQuaternion(Quaternion.Euler(to), 3).SetLoops(-1, LoopType.Yoyo).SetRelative(isRelative);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 627093d16b467164c860afac4c085a5a
|
||||
timeCreated: 1444906165
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_Tests/PureQuaternionPluginTests.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Tests/PureQuaternionPluginTests.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08a387945eb5d9d4d92b39ae0cdbbc24
|
||||
timeCreated: 1444906156
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,88 @@
|
||||
// Author: Daniele Giardini - http://www.demigiant.com
|
||||
// Created: 2015/10/15 12:29
|
||||
// License Copyright (c) Daniele Giardini
|
||||
// This work is subject to the terms at http://dotween.demigiant.com/license.php
|
||||
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Core.Easing;
|
||||
using DG.Tweening.Core.Enums;
|
||||
using DG.Tweening.Plugins.Core;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DG.Tweening.CustomPlugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
|
||||
/// <para>Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).</para>
|
||||
/// <para>To use it, call DOTween.To with the plugin parameter overload, passing it <c>PureQuaternionPlugin.Plug()</c> as first parameter
|
||||
/// (do not use any of the other public PureQuaternionPlugin methods):</para>
|
||||
/// <code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
/// </summary>
|
||||
public class PureQuaternionPlugin : ABSTweenPlugin<Quaternion, Quaternion, NoOptions>
|
||||
{
|
||||
static PureQuaternionPlugin _plug;
|
||||
/// <summary>
|
||||
/// Plug this plugin inside a DOTween.To call.
|
||||
/// <para>Example:</para>
|
||||
/// <code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
/// </summary>
|
||||
public static PureQuaternionPlugin Plug()
|
||||
{
|
||||
if (_plug == null) _plug = new PureQuaternionPlugin();
|
||||
return _plug;
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override void Reset(TweenerCore<Quaternion, Quaternion, NoOptions> t) { }
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override void SetFrom(TweenerCore<Quaternion, Quaternion, NoOptions> t, bool isRelative)
|
||||
{
|
||||
Quaternion prevEndVal = t.endValue;
|
||||
t.endValue = t.getter();
|
||||
t.startValue = isRelative ? t.endValue * prevEndVal : prevEndVal;
|
||||
t.setter(t.startValue);
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override Quaternion ConvertToStartValue(TweenerCore<Quaternion, Quaternion, NoOptions> t, Quaternion value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override void SetRelativeEndValue(TweenerCore<Quaternion, Quaternion, NoOptions> t)
|
||||
{
|
||||
t.endValue *= t.startValue;
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override void SetChangeValue(TweenerCore<Quaternion, Quaternion, NoOptions> t)
|
||||
{
|
||||
t.changeValue = t.endValue * Quaternion.Inverse(t.startValue);
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override float GetSpeedBasedDuration(NoOptions options, float unitsXSecond, Quaternion changeValue)
|
||||
{
|
||||
return changeValue.eulerAngles.magnitude / unitsXSecond;
|
||||
}
|
||||
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
public override void EvaluateAndApply(NoOptions options, Tween t, bool isRelative, DOGetter<Quaternion> getter, DOSetter<Quaternion> setter, float elapsed, Quaternion startValue, Quaternion changeValue, float duration, bool usingInversePosition, UpdateNotice updateNotice)
|
||||
{
|
||||
// if (t.loopType == LoopType.Incremental) startValue *= changeValue * (t.isComplete ? t.completedLoops - 1 : t.completedLoops);
|
||||
// if (t.isSequenced && t.sequenceParent.loopType == LoopType.Incremental) {
|
||||
// startValue += changeValue * (t.loopType == LoopType.Incremental ? t.loops : 1)
|
||||
// * (t.sequenceParent.isComplete ? t.sequenceParent.completedLoops - 1 : t.sequenceParent.completedLoops);
|
||||
// }
|
||||
float easeVal = EaseManager.Evaluate(t.easeType, t.customEase, elapsed, duration, t.easeOvershootOrAmplitude, t.easePeriod);
|
||||
startValue.x += changeValue.x * easeVal;
|
||||
startValue.y += changeValue.y * easeVal;
|
||||
startValue.z += changeValue.z * easeVal;
|
||||
startValue.w += changeValue.w * easeVal;
|
||||
setter(startValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.1.015";
|
||||
public static readonly string Version = "1.1.020";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
<Compile Include="Core\Surrogates\Vector4Wrapper.cs" />
|
||||
<Compile Include="Core\TweenManager.cs" />
|
||||
<Compile Include="Core\Utils.cs" />
|
||||
<Compile Include="CustomPlugins\PureQuaternionPlugin.cs" />
|
||||
<Compile Include="DOTween.cs" />
|
||||
<Compile Include="DOVirtual.cs" />
|
||||
<Compile Include="Ease.cs" />
|
||||
|
||||
@ -14,6 +14,7 @@ using DOQuaternion = UnityEngine.Quaternion;
|
||||
#endif
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Core.Enums;
|
||||
using DG.Tweening.CustomPlugins;
|
||||
using DG.Tweening.Plugins;
|
||||
using DG.Tweening.Plugins.Core.PathCore;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
@ -604,6 +605,20 @@ namespace DG.Tweening
|
||||
return t;
|
||||
}
|
||||
|
||||
/// <summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
/// Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
/// <para>PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
|
||||
/// This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
/// (neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
/// </summary>
|
||||
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
public static Tweener DORotateQuaternion(this Transform target, Quaternion endValue, float duration)
|
||||
{
|
||||
TweenerCore<Quaternion, Quaternion, NoOptions> t = DOTween.To(PureQuaternionPlugin.Plug(), () => target.rotation, x => target.rotation = x, endValue, duration);
|
||||
t.SetTarget(target);
|
||||
return t;
|
||||
}
|
||||
|
||||
/// <summary>Tweens a Transform's localRotation to the given value.
|
||||
/// Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
@ -616,6 +631,20 @@ namespace DG.Tweening
|
||||
return t;
|
||||
}
|
||||
|
||||
/// <summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
/// Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
/// <para>PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
|
||||
/// This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
/// (neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
/// </summary>
|
||||
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
public static Tweener DOLocalRotateQuaternion(this Transform target, Quaternion endValue, float duration)
|
||||
{
|
||||
TweenerCore<Quaternion, Quaternion, NoOptions> t = DOTween.To(PureQuaternionPlugin.Plug(), () => target.localRotation, x => target.localRotation = x, endValue, duration);
|
||||
t.SetTarget(target);
|
||||
return t;
|
||||
}
|
||||
|
||||
/// <summary>Tweens a Transform's localScale to the given value.
|
||||
/// Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
|
||||
@ -188,6 +188,43 @@
|
||||
Used for custom and animationCurve-based ease functions. Must return a value between 0 and 1.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.CustomPlugins.PureQuaternionPlugin">
|
||||
<summary>
|
||||
Straight Quaternion plugin. Instead of using Vector3 values accepts Quaternion values directly.
|
||||
<para>Beware: doesn't work with LoopType.Incremental (neither directly nor if inside a LoopType.Incremental Sequence).</para>
|
||||
<para>To use it, call DOTween.To with the plugin parameter overload, passing it <c>PureQuaternionPlugin.Plug()</c> as first parameter
|
||||
(do not use any of the other public PureQuaternionPlugin methods):</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Plug">
|
||||
<summary>
|
||||
Plug this plugin inside a DOTween.To call.
|
||||
<para>Example:</para>
|
||||
<code>DOTween.To(PureQuaternionPlugin.Plug(), ()=> myQuaternionProperty, x=> myQuaternionProperty = x, myQuaternionEndValue, duration);</code>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.Reset(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetFrom(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},System.Boolean)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.ConvertToStartValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions},UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetRelativeEndValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.SetChangeValue(DG.Tweening.Core.TweenerCore{UnityEngine.Quaternion,UnityEngine.Quaternion,DG.Tweening.Plugins.Options.NoOptions})">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.GetSpeedBasedDuration(DG.Tweening.Plugins.Options.NoOptions,System.Single,UnityEngine.Quaternion)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.CustomPlugins.PureQuaternionPlugin.EvaluateAndApply(DG.Tweening.Plugins.Options.NoOptions,DG.Tweening.Tween,System.Boolean,DG.Tweening.Core.DOGetter{UnityEngine.Quaternion},DG.Tweening.Core.DOSetter{UnityEngine.Quaternion},System.Single,UnityEngine.Quaternion,UnityEngine.Quaternion,System.Single,System.Boolean,DG.Tweening.Core.Enums.UpdateNotice)">
|
||||
<summary>INTERNAL: do not use</summary>
|
||||
</member>
|
||||
<member name="T:DG.Tweening.DOTween">
|
||||
<summary>
|
||||
Main DOTween class. Contains static methods to create and control tweens in a generic way
|
||||
@ -1419,12 +1456,30 @@
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DORotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DORotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotate(UnityEngine.Transform,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
|
||||
<summary>Tweens a Transform's localRotation to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
<param name="mode">Rotation mode</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalRotateQuaternion(UnityEngine.Transform,UnityEngine.Quaternion,System.Single)">
|
||||
<summary>Tweens a Transform's rotation to the given value using pure quaternion values.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations.
|
||||
<para>PLEASE NOTE: DOLocalRotate, which takes Vector3 values, is the preferred rotation method.
|
||||
This method was implemented for very special cases, and doesn't support LoopType.Incremental loops
|
||||
(neither for itself nor if placed inside a LoopType.Incremental Sequence)</para>
|
||||
</summary>
|
||||
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOScale(UnityEngine.Transform,UnityEngine.Vector3,System.Single)">
|
||||
<summary>Tweens a Transform's localScale to the given value.
|
||||
Also stores the transform as the tween's target so it can be used for filtered operations</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user