mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
Added SetLink chainable method
+ Fixed possible error where killAdd was increased only by maxTweeners if capacity was set to increase both by tweeners and by sequences
This commit is contained in:
parent
f20425c56d
commit
0e63b84837
@ -927,6 +927,32 @@
|
|||||||
<param name="sequencesCapacity">Max Sequences capacity.
|
<param name="sequencesCapacity">Max Sequences capacity.
|
||||||
Default: 50</param>
|
Default: 50</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:DG.Tweening.LinkBehaviour">
|
||||||
|
<summary>
|
||||||
|
Behaviour that can be assigned when chaining a SetLink to a tween
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisablePlayOnEnable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled, plays it when it's enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisableRestartOnEnable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled, restarts it when it's enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PlayOnEnable">
|
||||||
|
<summary>Plays the tween when the link target is enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.RestartOnEnable">
|
||||||
|
<summary>Restarts the tween when the link target is enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.KillOnDisable">
|
||||||
|
<summary>Kills the tween when the link target is disabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.KillOnDestroy">
|
||||||
|
<summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||||
|
</member>
|
||||||
<member name="T:DG.Tweening.PathMode">
|
<member name="T:DG.Tweening.PathMode">
|
||||||
<summary>
|
<summary>
|
||||||
Path mode (used to determine correct LookAt orientation)
|
Path mode (used to determine correct LookAt orientation)
|
||||||
@ -2123,12 +2149,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0)">
|
||||||
<summary>Sets the autoKill behaviour of the tween.
|
<summary>Sets the autoKill behaviour of the tween to TRUE.
|
||||||
Has no effect if the tween has already started</summary>
|
<code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0,System.Boolean)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0,System.Boolean)">
|
||||||
<summary>Sets the autoKill behaviour of the tween.
|
<summary>Sets the autoKill behaviour of the tween.
|
||||||
Has no effect if the tween has already started</summary>
|
<code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
<param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
<param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetId``1(``0,System.Object)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetId``1(``0,System.Object)">
|
||||||
@ -2145,6 +2171,19 @@
|
|||||||
Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads)</summary>
|
Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads)</summary>
|
||||||
<param name="intId">The int ID to assign to this tween.</param>
|
<param name="intId">The int ID to assign to this tween.</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetLink``1(``0,UnityEngine.GameObject)">
|
||||||
|
<summary>Allows to link this tween to a GameObject
|
||||||
|
so that it will be automatically killed when the GameObject is destroyed.
|
||||||
|
<code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
<param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetLink``1(``0,UnityEngine.GameObject,DG.Tweening.LinkBehaviour)">
|
||||||
|
<summary>Allows to link this tween to a GameObject and assign a behaviour depending on it.
|
||||||
|
This will also automatically kill the tween when the GameObject is destroyed.
|
||||||
|
<code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
<param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
<param name="behaviour">The behaviour to use (<see cref="F:DG.Tweening.LinkBehaviour.KillOnDestroy"/> is always evaluated even if you choose another one)</param>
|
||||||
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetTarget``1(``0,System.Object)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetTarget``1(``0,System.Object)">
|
||||||
<summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
<summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
||||||
<para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
<para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
||||||
|
|||||||
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,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d3e15b806a8368742ba6f10e794d7b76
|
guid: d3e15b806a8368742ba6f10e794d7b76
|
||||||
timeCreated: 1549961173
|
timeCreated: 1551014982
|
||||||
licenseType: Pro
|
licenseType: Pro
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
fileIDToRecycleName: {}
|
fileIDToRecycleName: {}
|
||||||
|
|||||||
Binary file not shown.
22
UnityTests.Unity5/Assets/_Tests/SetLink.cs
Normal file
22
UnityTests.Unity5/Assets/_Tests/SetLink.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class SetLink : BrainBase
|
||||||
|
{
|
||||||
|
public Transform tweenTarget;
|
||||||
|
public bool autoKill = true;
|
||||||
|
public bool pauseAtStartup = true;
|
||||||
|
public int loops = 2;
|
||||||
|
public float duration = 1;
|
||||||
|
public GameObject linkTarget;
|
||||||
|
public LinkBehaviour linkBehaviour;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
Tween t = tweenTarget.DOMoveX(3, duration).SetLoops(loops, LoopType.Yoyo).SetEase(Ease.Linear)
|
||||||
|
.SetLink(linkTarget, linkBehaviour);
|
||||||
|
if (autoKill) t.SetAutoKill();
|
||||||
|
if (pauseAtStartup) t.Pause();
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityTests.Unity5/Assets/_Tests/SetLink.cs.meta
Normal file
12
UnityTests.Unity5/Assets/_Tests/SetLink.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ca67d5bc4d6738b4c9a0f4e5bac5eaaa
|
||||||
|
timeCreated: 1551014610
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
UnityTests.Unity5/Assets/_Tests/SetLink.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Tests/SetLink.unity
Normal file
Binary file not shown.
8
UnityTests.Unity5/Assets/_Tests/SetLink.unity.meta
Normal file
8
UnityTests.Unity5/Assets/_Tests/SetLink.unity.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 454dbfdf73f2661409a2833466ef5e78
|
||||||
|
timeCreated: 1426535291
|
||||||
|
licenseType: Pro
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
23
_DOTween.Assembly/DOTween/Core/TweenLink.cs
Normal file
23
_DOTween.Assembly/DOTween/Core/TweenLink.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2019/02/24 13:10
|
||||||
|
// License Copyright (c) Daniele Giardini
|
||||||
|
// This work is subject to the terms at http://dotween.demigiant.com/license.php
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DG.Tweening.Core
|
||||||
|
{
|
||||||
|
internal class TweenLink
|
||||||
|
{
|
||||||
|
public readonly GameObject target;
|
||||||
|
public readonly LinkBehaviour behaviour;
|
||||||
|
public bool lastSeenActive;
|
||||||
|
|
||||||
|
public TweenLink(GameObject target, LinkBehaviour behaviour)
|
||||||
|
{
|
||||||
|
this.target = target;
|
||||||
|
this.behaviour = behaviour;
|
||||||
|
lastSeenActive = target.activeInHierarchy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -38,6 +38,8 @@ namespace DG.Tweening.Core
|
|||||||
static readonly Stack<Tween> _PooledSequences = new Stack<Tween>();
|
static readonly Stack<Tween> _PooledSequences = new Stack<Tween>();
|
||||||
|
|
||||||
static readonly List<Tween> _KillList = new List<Tween>(_DefaultMaxTweeners + _DefaultMaxSequences);
|
static readonly List<Tween> _KillList = new List<Tween>(_DefaultMaxTweeners + _DefaultMaxSequences);
|
||||||
|
static readonly Dictionary<Tween,TweenLink> _TweenLinks = new Dictionary<Tween, TweenLink>(_DefaultMaxTweeners + _DefaultMaxSequences);
|
||||||
|
static int _totTweenLinks; // Used for quicker skip in case no TweenLinks were set
|
||||||
static int _maxActiveLookupId = -1; // Highest full ID in _activeTweens
|
static int _maxActiveLookupId = -1; // Highest full ID in _activeTweens
|
||||||
static bool _requiresActiveReorganization; // True when _activeTweens need to be reorganized to fill empty spaces
|
static bool _requiresActiveReorganization; // True when _activeTweens need to be reorganized to fill empty spaces
|
||||||
static int _reorganizeFromId = -1; // First null ID from which to reorganize
|
static int _reorganizeFromId = -1; // First null ID from which to reorganize
|
||||||
@ -216,6 +218,8 @@ namespace DG.Tweening.Core
|
|||||||
totActiveTweeners = totActiveSequences = 0;
|
totActiveTweeners = totActiveSequences = 0;
|
||||||
_maxActiveLookupId = _reorganizeFromId = -1;
|
_maxActiveLookupId = _reorganizeFromId = -1;
|
||||||
_requiresActiveReorganization = false;
|
_requiresActiveReorganization = false;
|
||||||
|
_TweenLinks.Clear();
|
||||||
|
_totTweenLinks = 0;
|
||||||
|
|
||||||
if (isUpdateLoop) _despawnAllCalledFromUpdateLoopCallback = true;
|
if (isUpdateLoop) _despawnAllCalledFromUpdateLoopCallback = true;
|
||||||
|
|
||||||
@ -317,6 +321,39 @@ namespace DG.Tweening.Core
|
|||||||
_minPooledTweenerId = _maxPooledTweenerId = -1;
|
_minPooledTweenerId = _maxPooledTweenerId = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void AddTweenLink(Tween t, TweenLink tweenLink)
|
||||||
|
{
|
||||||
|
_totTweenLinks++;
|
||||||
|
if (_TweenLinks.ContainsKey(t)) _TweenLinks[t] = tweenLink;
|
||||||
|
else _TweenLinks.Add(t, tweenLink);
|
||||||
|
// Pause or play tween immediately depending on target's state
|
||||||
|
if (tweenLink.lastSeenActive) {
|
||||||
|
switch (tweenLink.behaviour) {
|
||||||
|
case LinkBehaviour.PauseOnDisablePlayOnEnable:
|
||||||
|
case LinkBehaviour.PauseOnDisableRestartOnEnable:
|
||||||
|
case LinkBehaviour.PlayOnEnable:
|
||||||
|
case LinkBehaviour.RestartOnEnable:
|
||||||
|
Play(t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (tweenLink.behaviour) {
|
||||||
|
case LinkBehaviour.PauseOnDisable:
|
||||||
|
case LinkBehaviour.PauseOnDisablePlayOnEnable:
|
||||||
|
case LinkBehaviour.PauseOnDisableRestartOnEnable:
|
||||||
|
Pause(t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void RemoveTweenLink(Tween t)
|
||||||
|
{
|
||||||
|
if (!_TweenLinks.ContainsKey(t)) return;
|
||||||
|
_TweenLinks.Remove(t);
|
||||||
|
_totTweenLinks--;
|
||||||
|
}
|
||||||
|
|
||||||
internal static void ResetCapacities()
|
internal static void ResetCapacities()
|
||||||
{
|
{
|
||||||
SetCapacities(_DefaultMaxTweeners, _DefaultMaxSequences);
|
SetCapacities(_DefaultMaxTweeners, _DefaultMaxSequences);
|
||||||
@ -375,6 +412,7 @@ namespace DG.Tweening.Core
|
|||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
Tween t = _activeTweens[i];
|
Tween t = _activeTweens[i];
|
||||||
if (t == null || t.updateType != updateType) continue; // Wrong updateType or was added to a Sequence (thus removed from active list) while inside current updateLoop
|
if (t == null || t.updateType != updateType) continue; // Wrong updateType or was added to a Sequence (thus removed from active list) while inside current updateLoop
|
||||||
|
if (_totTweenLinks > 0) EvaluateTweenLink(t); // TweenLinks
|
||||||
if (!t.active) {
|
if (!t.active) {
|
||||||
// Manually killed by another tween's callback
|
// Manually killed by another tween's callback
|
||||||
willKill = true;
|
willKill = true;
|
||||||
@ -890,6 +928,45 @@ namespace DG.Tweening.Core
|
|||||||
_KillList.Add(t);
|
_KillList.Add(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called by Update method
|
||||||
|
static void EvaluateTweenLink(Tween t)
|
||||||
|
{
|
||||||
|
// Check tween links
|
||||||
|
TweenLink tLink;
|
||||||
|
if (!_TweenLinks.TryGetValue(t, out tLink)) return;
|
||||||
|
|
||||||
|
if (tLink.target == null) {
|
||||||
|
t.active = false;
|
||||||
|
} else {
|
||||||
|
bool goActive = tLink.target.activeInHierarchy;
|
||||||
|
bool justEnabled = !tLink.lastSeenActive && goActive;
|
||||||
|
bool justDisabled = tLink.lastSeenActive && !goActive;
|
||||||
|
tLink.lastSeenActive = goActive;
|
||||||
|
switch (tLink.behaviour) {
|
||||||
|
case LinkBehaviour.KillOnDisable:
|
||||||
|
if (!goActive) t.active = false; // Will be killed by rest of Update loop
|
||||||
|
break;
|
||||||
|
case LinkBehaviour.PauseOnDisable:
|
||||||
|
if (justDisabled && t.isPlaying) Pause(t);
|
||||||
|
break;
|
||||||
|
case LinkBehaviour.PauseOnDisablePlayOnEnable:
|
||||||
|
if (justDisabled) Pause(t);
|
||||||
|
else if (justEnabled) Play(t);
|
||||||
|
break;
|
||||||
|
case LinkBehaviour.PauseOnDisableRestartOnEnable:
|
||||||
|
if (justDisabled) Pause(t);
|
||||||
|
else if (justEnabled) Restart(t);
|
||||||
|
break;
|
||||||
|
case LinkBehaviour.PlayOnEnable:
|
||||||
|
if (justEnabled) Play(t);
|
||||||
|
break;
|
||||||
|
case LinkBehaviour.RestartOnEnable:
|
||||||
|
if (justEnabled) Restart(t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Adds the given tween to the active tweens list (updateType is always Normal, but can be changed by SetUpdateType)
|
// Adds the given tween to the active tweens list (updateType is always Normal, but can be changed by SetUpdateType)
|
||||||
static void AddActiveTween(Tween t)
|
static void AddActiveTween(Tween t)
|
||||||
{
|
{
|
||||||
@ -973,12 +1050,14 @@ namespace DG.Tweening.Core
|
|||||||
for (int i = count; i > -1; --i) Despawn(tweens[i]);
|
for (int i = count; i > -1; --i) Despawn(tweens[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes a tween from the active list, reorganizes said list
|
// Removes a tween from the active list, then reorganizes said list and decreases the given total.
|
||||||
// and decreases the given total
|
// Also removes any TweenLinks associated to this tween.
|
||||||
static void RemoveActiveTween(Tween t)
|
static void RemoveActiveTween(Tween t)
|
||||||
{
|
{
|
||||||
int index = t.activeId;
|
int index = t.activeId;
|
||||||
|
|
||||||
|
if (_totTweenLinks > 0) RemoveTweenLink(t);
|
||||||
|
|
||||||
t.activeId = -1;
|
t.activeId = -1;
|
||||||
_requiresActiveReorganization = true;
|
_requiresActiveReorganization = true;
|
||||||
if (_reorganizeFromId == -1 || _reorganizeFromId > index) _reorganizeFromId = index;
|
if (_reorganizeFromId == -1 || _reorganizeFromId > index) _reorganizeFromId = index;
|
||||||
@ -1068,7 +1147,7 @@ namespace DG.Tweening.Core
|
|||||||
maxSequences += increaseSequencesBy;
|
maxSequences += increaseSequencesBy;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
killAdd += increaseTweenersBy;
|
killAdd += increaseTweenersBy + increaseSequencesBy;
|
||||||
maxTweeners += increaseTweenersBy;
|
maxTweeners += increaseTweenersBy;
|
||||||
maxSequences += increaseSequencesBy;
|
maxSequences += increaseSequencesBy;
|
||||||
Array.Resize(ref _pooledTweeners, maxTweeners);
|
Array.Resize(ref _pooledTweeners, maxTweeners);
|
||||||
|
|||||||
@ -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.186"; // Last version before modules: 1.1.755
|
public static readonly string Version = "1.2.190"; // Last version before modules: 1.1.755
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Options ////////////////////////////////////
|
// Options ////////////////////////////////////
|
||||||
|
|||||||
@ -94,6 +94,7 @@
|
|||||||
<Compile Include="Core\Surrogates\Vector2Wrapper.cs" />
|
<Compile Include="Core\Surrogates\Vector2Wrapper.cs" />
|
||||||
<Compile Include="Core\Surrogates\Vector3Wrapper.cs" />
|
<Compile Include="Core\Surrogates\Vector3Wrapper.cs" />
|
||||||
<Compile Include="Core\Surrogates\Vector4Wrapper.cs" />
|
<Compile Include="Core\Surrogates\Vector4Wrapper.cs" />
|
||||||
|
<Compile Include="Core\TweenLink.cs" />
|
||||||
<Compile Include="Core\TweenManager.cs" />
|
<Compile Include="Core\TweenManager.cs" />
|
||||||
<Compile Include="Core\Utils.cs" />
|
<Compile Include="Core\Utils.cs" />
|
||||||
<Compile Include="CustomPlugins\PureQuaternionPlugin.cs" />
|
<Compile Include="CustomPlugins\PureQuaternionPlugin.cs" />
|
||||||
@ -102,6 +103,7 @@
|
|||||||
<Compile Include="Ease.cs" />
|
<Compile Include="Ease.cs" />
|
||||||
<Compile Include="EaseFactory.cs" />
|
<Compile Include="EaseFactory.cs" />
|
||||||
<Compile Include="IDOTweenInit.cs" />
|
<Compile Include="IDOTweenInit.cs" />
|
||||||
|
<Compile Include="LinkBehaviour.cs" />
|
||||||
<Compile Include="PathMode.cs" />
|
<Compile Include="PathMode.cs" />
|
||||||
<Compile Include="PathType.cs" />
|
<Compile Include="PathType.cs" />
|
||||||
<Compile Include="Plugins\Color2Plugin.cs" />
|
<Compile Include="Plugins\Color2Plugin.cs" />
|
||||||
|
|||||||
28
_DOTween.Assembly/DOTween/LinkBehaviour.cs
Normal file
28
_DOTween.Assembly/DOTween/LinkBehaviour.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Author: Daniele Giardini - http://www.demigiant.com
|
||||||
|
// Created: 2019/02/24 13:05
|
||||||
|
// License Copyright (c) Daniele Giardini
|
||||||
|
// This work is subject to the terms at http://dotween.demigiant.com/license.php
|
||||||
|
|
||||||
|
namespace DG.Tweening
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Behaviour that can be assigned when chaining a SetLink to a tween
|
||||||
|
/// </summary>
|
||||||
|
public enum LinkBehaviour
|
||||||
|
{
|
||||||
|
/// <summary>Pauses the tween when the link target is disabled</summary>
|
||||||
|
PauseOnDisable,
|
||||||
|
/// <summary>Pauses the tween when the link target is disabled, plays it when it's enabled</summary>
|
||||||
|
PauseOnDisablePlayOnEnable,
|
||||||
|
/// <summary>Pauses the tween when the link target is disabled, restarts it when it's enabled</summary>
|
||||||
|
PauseOnDisableRestartOnEnable,
|
||||||
|
/// <summary>Plays the tween when the link target is enabled</summary>
|
||||||
|
PlayOnEnable,
|
||||||
|
/// <summary>Restarts the tween when the link target is enabled</summary>
|
||||||
|
RestartOnEnable,
|
||||||
|
/// <summary>Kills the tween when the link target is disabled</summary>
|
||||||
|
KillOnDisable,
|
||||||
|
/// <summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||||
|
KillOnDestroy,
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -34,8 +34,8 @@ namespace DG.Tweening
|
|||||||
{
|
{
|
||||||
#region Tweeners + Sequences
|
#region Tweeners + Sequences
|
||||||
|
|
||||||
/// <summary>Sets the autoKill behaviour of the tween.
|
/// <summary>Sets the autoKill behaviour of the tween to TRUE.
|
||||||
/// Has no effect if the tween has already started</summary>
|
/// <code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
public static T SetAutoKill<T>(this T t) where T : Tween
|
public static T SetAutoKill<T>(this T t) where T : Tween
|
||||||
{
|
{
|
||||||
if (t == null || !t.active || t.creationLocked) return t;
|
if (t == null || !t.active || t.creationLocked) return t;
|
||||||
@ -44,7 +44,7 @@ namespace DG.Tweening
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
/// <summary>Sets the autoKill behaviour of the tween.
|
/// <summary>Sets the autoKill behaviour of the tween.
|
||||||
/// Has no effect if the tween has already started</summary>
|
/// <code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
/// <param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
/// <param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
||||||
public static T SetAutoKill<T>(this T t, bool autoKillOnCompletion) where T : Tween
|
public static T SetAutoKill<T>(this T t, bool autoKillOnCompletion) where T : Tween
|
||||||
{
|
{
|
||||||
@ -84,6 +84,30 @@ namespace DG.Tweening
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Allows to link this tween to a GameObject
|
||||||
|
/// so that it will be automatically killed when the GameObject is destroyed.
|
||||||
|
/// <code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
/// <param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
public static T SetLink<T>(this T t, GameObject gameObject) where T : Tween
|
||||||
|
{
|
||||||
|
if (t == null || !t.active || t.isSequenced || gameObject == null) return t;
|
||||||
|
|
||||||
|
TweenManager.AddTweenLink(t, new TweenLink(gameObject, LinkBehaviour.KillOnDestroy));
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
/// <summary>Allows to link this tween to a GameObject and assign a behaviour depending on it.
|
||||||
|
/// This will also automatically kill the tween when the GameObject is destroyed.
|
||||||
|
/// <code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
/// <param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
/// <param name="behaviour">The behaviour to use (<see cref="LinkBehaviour.KillOnDestroy"/> is always evaluated even if you choose another one)</param>
|
||||||
|
public static T SetLink<T>(this T t, GameObject gameObject, LinkBehaviour behaviour) where T : Tween
|
||||||
|
{
|
||||||
|
if (t == null || !t.active || t.isSequenced || gameObject == null) return t;
|
||||||
|
|
||||||
|
TweenManager.AddTweenLink(t, new TweenLink(gameObject, behaviour));
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
/// <summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
||||||
/// <para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
/// <para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
||||||
/// When using shorcuts the shortcut target is already assigned as the tween's target,
|
/// When using shorcuts the shortcut target is already assigned as the tween's target,
|
||||||
|
|||||||
@ -927,6 +927,32 @@
|
|||||||
<param name="sequencesCapacity">Max Sequences capacity.
|
<param name="sequencesCapacity">Max Sequences capacity.
|
||||||
Default: 50</param>
|
Default: 50</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:DG.Tweening.LinkBehaviour">
|
||||||
|
<summary>
|
||||||
|
Behaviour that can be assigned when chaining a SetLink to a tween
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisablePlayOnEnable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled, plays it when it's enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PauseOnDisableRestartOnEnable">
|
||||||
|
<summary>Pauses the tween when the link target is disabled, restarts it when it's enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.PlayOnEnable">
|
||||||
|
<summary>Plays the tween when the link target is enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.RestartOnEnable">
|
||||||
|
<summary>Restarts the tween when the link target is enabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.KillOnDisable">
|
||||||
|
<summary>Kills the tween when the link target is disabled</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:DG.Tweening.LinkBehaviour.KillOnDestroy">
|
||||||
|
<summary>Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen</summary>
|
||||||
|
</member>
|
||||||
<member name="T:DG.Tweening.PathMode">
|
<member name="T:DG.Tweening.PathMode">
|
||||||
<summary>
|
<summary>
|
||||||
Path mode (used to determine correct LookAt orientation)
|
Path mode (used to determine correct LookAt orientation)
|
||||||
@ -2123,12 +2149,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0)">
|
||||||
<summary>Sets the autoKill behaviour of the tween.
|
<summary>Sets the autoKill behaviour of the tween to TRUE.
|
||||||
Has no effect if the tween has already started</summary>
|
<code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0,System.Boolean)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetAutoKill``1(``0,System.Boolean)">
|
||||||
<summary>Sets the autoKill behaviour of the tween.
|
<summary>Sets the autoKill behaviour of the tween.
|
||||||
Has no effect if the tween has already started</summary>
|
<code>Has no effect</code> if the tween has already started or if it's added to a Sequence</summary>
|
||||||
<param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
<param name="autoKillOnCompletion">If TRUE the tween will be automatically killed when complete</param>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetId``1(``0,System.Object)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetId``1(``0,System.Object)">
|
||||||
@ -2145,6 +2171,19 @@
|
|||||||
Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads)</summary>
|
Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads)</summary>
|
||||||
<param name="intId">The int ID to assign to this tween.</param>
|
<param name="intId">The int ID to assign to this tween.</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetLink``1(``0,UnityEngine.GameObject)">
|
||||||
|
<summary>Allows to link this tween to a GameObject
|
||||||
|
so that it will be automatically killed when the GameObject is destroyed.
|
||||||
|
<code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
<param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetLink``1(``0,UnityEngine.GameObject,DG.Tweening.LinkBehaviour)">
|
||||||
|
<summary>Allows to link this tween to a GameObject and assign a behaviour depending on it.
|
||||||
|
This will also automatically kill the tween when the GameObject is destroyed.
|
||||||
|
<code>Has no effect</code> if the tween is added to a Sequence</summary>
|
||||||
|
<param name="gameObject">The link target (unrelated to the target set via <code>SetTarget</code>)</param>
|
||||||
|
<param name="behaviour">The behaviour to use (<see cref="F:DG.Tweening.LinkBehaviour.KillOnDestroy"/> is always evaluated even if you choose another one)</param>
|
||||||
|
</member>
|
||||||
<member name="M:DG.Tweening.TweenSettingsExtensions.SetTarget``1(``0,System.Object)">
|
<member name="M:DG.Tweening.TweenSettingsExtensions.SetTarget``1(``0,System.Object)">
|
||||||
<summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
<summary>Sets the target for the tween, which can then be used as a filter with DOTween's static methods.
|
||||||
<para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
<para>IMPORTANT: use it with caution. If you just want to set an ID for the tween use <code>SetId</code> instead.</para>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user