1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-13 18:48:47 +08:00

Fixed OnWaypointChange sometimes not working correctly between the last waypoint and the previous one

This commit is contained in:
Demigiant 2016-10-12 16:49:49 +02:00
parent 64763e124e
commit c7d916ef53
55 changed files with 223 additions and 21 deletions

View File

@ -4,6 +4,13 @@
<name>DemiEditor</name>
</assembly>
<members>
<member name="T:DG.DemiEditor.Core.DeGUIScope">
<summary>
Replicates Unity's GUI.Scope with Unity versions older than 5.X.
Thanks to Dmitriy Yukhanov for pointing this out and creating an initial version
(which I meant to use until we discovered Unity had implemented it too)
</summary>
</member>
<member name="T:DG.DemiEditor.DeEditorFileUtils">
<summary>
File utils
@ -47,6 +54,18 @@
</summary>
<param name="adbPath">Path, relative to Unity's project folder</param>
</member>
<member name="M:DG.DemiEditor.DeEditorFileUtils.ConvertToValidFilename(System.String)">
<summary>
Converts the given string to a valid filename and returns it.
Beware: doesn't check for reserved words
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorFileUtils.GUIDToExistingAssetPath(System.String)">
<summary>
Returns the asset path of the given GUID (relative to Unity project's folder),
or an empty string if either the GUID is invalid or the related path doesn't exist.
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorFileUtils.IsEmpty(System.String)">
<summary>
Checks if the given directory (full path) is empty or not
@ -57,12 +76,6 @@
Deletes all files and subdirectories from the given directory
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorFileUtils.GUIDToExistingAssetPath(System.String)">
<summary>
Returns the asset path of the given GUID (relative to Unity project's folder),
or an empty string if either the GUID is invalid or the related path doesn't exist.
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorFileUtils.MonoInstanceADBPath(UnityEngine.ScriptableObject)">
<summary>Returns the adb path to the given ScriptableObject</summary>
</member>
@ -108,9 +121,55 @@
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
<param name="createFoldersIfMissing">If TRUE also creates the path folders if they don't exist</param>
</member>
<member name="M:DG.DemiEditor.DeEditorPanelUtils.SetWindowTitle(UnityEditor.EditorWindow,UnityEngine.Texture,System.String)">
<summary>
Sets the icon and title of an editor window. Works with older versions of Unity, where the titleContent property wasn't available.
</summary>
<param name="editor">Reference to the editor panel whose icon to set</param>
<param name="icon">Icon to apply</param>
<param name="title">Title. If NULL doesn't change it</param>
</member>
<member name="T:DG.DemiEditor.DeEditorPrefabUtils">
<summary>
Prefab utilities
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorPrefabUtils.ApplyPrefabInstanceModifications(UnityEngine.GameObject)">
<summary>
Behaves as the Inspector's Apply button, applying any modification of this instance to the prefab parent
</summary>
<param name="instance"></param>
</member>
<member name="M:DG.DemiEditor.DeEditorPrefabUtils.BreakPrefabInstances(System.Collections.Generic.List{UnityEngine.GameObject})">
<summary>
Completely removes any prefab connection from the given prefab instances.
<para>
Based on RodGreen's method (http://forum.unity3d.com/threads/82883-Breaking-connection-from-gameObject-to-prefab-for-good.?p=726602&amp;viewfull=1#post726602)
</para>
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorPrefabUtils.BreakPrefabInstance(UnityEngine.GameObject)">
<summary>
Completely removes any prefab connection from the given prefab instance.
<para>
Based on RodGreen's method (http://forum.unity3d.com/threads/82883-Breaking-connection-from-gameObject-to-prefab-for-good.?p=726602&amp;viewfull=1#post726602)
</para>
</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorUtils.DelayedCall(System.Single,System.Action)">
<summary>Calls the given action after the given delay</summary>
</member>
<member name="M:DG.DemiEditor.DeEditorUtils.GetGameViewSize">
<summary>
Return the size of the editor game view, eventual extra bars excluded (meaning the true size of the game area)
</summary>
<returns></returns>
</member>
<member name="M:DG.DemiEditor.DeEditorUtils.ClearConsole">
<summary>
Clears all logs from Unity's console
</summary>
</member>
<member name="F:DG.DemiEditor.DeDragResultType.NoDrag">
<summary>Nothing is being dragged</summary>
</member>
@ -242,12 +301,26 @@
</member>
<member name="M:DG.DemiEditor.GUIStyleExtensions.Clone(UnityEngine.GUIStyle,System.Object[])">
<summary>
Clones the style and adds the given formats to it
Clones the style and adds the given formats to it. You can pass any of these types of values:
<list type="bullet">
<item><term>Format:</term><description>Rich-text, wordwrap</description></item>
<item><term>FontStyle:</term><description>Font style</description></item>
<item><term>TextAnchor:</term><description>Content anchor</description></item>
<item><term>int:</term><description>Font size</description></item>
<item><term>Color/DeSkinColor:</term><description>Font color</description></item>
</list>
</summary>
</member>
<member name="M:DG.DemiEditor.GUIStyleExtensions.Add(UnityEngine.GUIStyle,System.Object[])">
<summary>
Adds the given formats to the style
Adds the given formats to the style. You can pass any of these types of values:
<list type="bullet">
<item><term>Format:</term><description>RichText, WordWrap</description></item>
<item><term>FontStyle:</term><description>Font style</description></item>
<item><term>TextAnchor:</term><description>Content anchor</description></item>
<item><term>int:</term><description>Font size</description></item>
<item><term>Color/DeSkinColor:</term><description>Font color</description></item>
</list>
</summary>
</member>
<member name="M:DG.DemiEditor.GUIStyleExtensions.Border(UnityEngine.GUIStyle,UnityEngine.RectOffset)">
@ -488,6 +561,11 @@
</member>
<member name="M:DG.DemiEditor.DeGUILayout.ToggleButton(System.Boolean,UnityEngine.GUIContent,DG.DemiLib.DeColorPalette,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[])">
<summary>Button that can be toggled on and off</summary>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.ToggleButton(System.Boolean,System.String,UnityEngine.Color,UnityEngine.Color,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[])">
<summary>Button that can be toggled on and off</summary>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.ToggleButton(System.Boolean,UnityEngine.GUIContent,UnityEngine.Color,UnityEngine.Color,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[])">
<summary>Button that can be toggled on and off</summary>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.BeginToolbar(UnityEngine.GUILayoutOption[])">
@ -535,6 +613,59 @@
<member name="M:DG.DemiEditor.DeGUILayout.HorizontalDivider(System.Nullable{UnityEngine.Color},System.Int32,System.Int32,System.Int32)">
<summary>Horizontal Divider</summary>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.DoubleClickTextField(UnityEditor.EditorWindow,System.String,System.String,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click
</summary>
<param name="editorWindow">EditorWindow reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.DoubleClickTextField(UnityEditor.Editor,System.String,System.String,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click
</summary>
<param name="editor">Editor reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.DoubleClickDraggableTextField(UnityEditor.EditorWindow,System.String,System.String,System.Int32,System.Collections.IList,System.Int32,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click and can also be dragged
</summary>
<param name="editorWindow">EditorWindow reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="dragId">ID for this drag operation (must be the same for both this and Drag</param>
<param name="draggableList">List containing the dragged item and all other relative draggable items</param>
<param name="draggedItemIndex">DraggableList index of the item being dragged</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
<returns></returns>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.DoubleClickDraggableTextField(UnityEditor.Editor,System.String,System.String,System.Int32,System.Collections.IList,System.Int32,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click and can also be dragged
</summary>
<param name="editor">Editor reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="dragId">ID for this drag operation (must be the same for both this and Drag</param>
<param name="draggableList">List containing the dragged item and all other relative draggable items</param>
<param name="draggedItemIndex">DraggableList index of the item being dragged</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
<returns></returns>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.GradientField(System.String,UnityEngine.Gradient,UnityEngine.GUILayoutOption[])">
<summary>
Creates a Gradient field by using Unity 4.x hidden default one and Reflection.
</summary>
</member>
<member name="M:DG.DemiEditor.DeGUILayout.SceneField(System.String,UnityEngine.Object)">
<summary>Scene field</summary>
</member>
@ -647,6 +778,17 @@
<summary>Draws a colored square</summary>
</member>
<member name="M:DG.DemiEditor.DeGUI.DoubleClickTextField(UnityEngine.Rect,UnityEditor.EditorWindow,System.String,System.String,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click
</summary>
<param name="rect">Area</param>
<param name="editorWindow">EditorWindow reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
</member>
<member name="M:DG.DemiEditor.DeGUI.DoubleClickTextField(UnityEngine.Rect,UnityEditor.Editor,System.String,System.String,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click
</summary>
@ -658,6 +800,21 @@
<param name="editingStyle">Style for editing mode</param>
</member>
<member name="M:DG.DemiEditor.DeGUI.DoubleClickDraggableTextField(UnityEngine.Rect,UnityEditor.EditorWindow,System.String,System.String,System.Int32,System.Collections.IList,System.Int32,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click and can also be dragged
</summary>
<param name="rect">Area</param>
<param name="editorWindow">EditorWindow reference</param>
<param name="id">A unique ID to use in order to determine if the text is selected or not</param>
<param name="text">Text</param>
<param name="dragId">ID for this drag operation (must be the same for both this and Drag</param>
<param name="draggableList">List containing the dragged item and all other relative draggable items</param>
<param name="draggedItemIndex">DraggableList index of the item being dragged</param>
<param name="defaultStyle">Style for default (non-editing mode) appearance</param>
<param name="editingStyle">Style for editing mode</param>
<returns></returns>
</member>
<member name="M:DG.DemiEditor.DeGUI.DoubleClickDraggableTextField(UnityEngine.Rect,UnityEditor.Editor,System.String,System.String,System.Int32,System.Collections.IList,System.Int32,UnityEngine.GUIStyle,UnityEngine.GUIStyle)">
<summary>
A text field that becomes editable only on double-click and can also be dragged
</summary>
@ -675,6 +832,24 @@
<member name="M:DG.DemiEditor.DeGUI.FlatDivider(UnityEngine.Rect,System.Nullable{UnityEngine.Color})">
<summary>Divider</summary>
</member>
<member name="M:DG.DemiEditor.SerializedPropertyExtensions.CastTo``1(UnityEditor.SerializedProperty)">
<summary>
Returns the value of the given property (works like a cast to type).
<para>
Improved from HiddenMonk's functions (http://answers.unity3d.com/questions/627090/convert-serializedproperty-to-custom-class.html)
</para>
</summary>
</member>
<member name="M:DG.DemiEditor.SerializedPropertyExtensions.IsArrayElement(UnityEditor.SerializedProperty)">
<summary>
Returns TRUE if this property is inside an array
</summary>
</member>
<member name="M:DG.DemiEditor.SerializedPropertyExtensions.GetIndexInArray(UnityEditor.SerializedProperty)">
<summary>
Returns -1 if the property is not inside an array, otherwise returns its index inside the array
</summary>
</member>
<member name="T:DG.DemiEditor.StringExtensions">
<summary>
String extensions

View File

@ -7,12 +7,13 @@ public class TempPro : MonoBehaviour
{
public DOTweenPath path;
IEnumerator Start()
void Start ()
{
yield return new WaitForSeconds(0.5f);
path.GetTween().OnWaypointChange(OnWaypointChange);
}
Debug.Log("PLAY");
Debug.Log(path.GetTween().id);
DOTween.Play("myId");
void OnWaypointChange (int index)
{
Debug.Log(index);
}
}

View File

@ -5,18 +5,43 @@ using System.Reflection;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class TempTests : BrainBase
{
public float randomness = 90;
public bool fadeOut;
public Transform target;
public int poolId;
public Transform target;
private Transform myTransform;
private Color baseColor;
void Awake () {
myTransform = transform;
}
public void Shake()
public void Show (string txt) {
myTransform.SetAsLastSibling ();
this.StartCoroutine(RemoveIn());
}
IEnumerator RemoveIn () {
yield return new WaitForSeconds(4);
Hide ();
}
private void Hide ()
{
DOTween.KillAll(true);
target.DOShakePosition(2, 2, 10, randomness, false, fadeOut);
target.DOMoveX(2, 1).OnComplete (Remove);
}
private void Remove ()
{
target.gameObject.SetActive(false);
// Destroy(target.gameObject);
}
void OnDisable ()
{
target.DOKill();
}
}

View File

@ -1,2 +1,2 @@
m_EditorVersion: 5.3.2f1
m_EditorVersion: 5.4.0f3
m_StandardAssetsVersion: 0

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// <summary>DOTween's version</summary>
public static readonly string Version = "1.1.315";
public static readonly string Version = "1.1.330";
///////////////////////////////////////////////
// Options ////////////////////////////////////

View File

@ -138,6 +138,7 @@ namespace DG.Tweening.Plugins.Core.PathCore
float currLen = 0;
for (int i = 0, count = wpLengths.Length; i < count; i++) {
currLen += wpLengths[i];
if (i == count - 1) return isMovingForward ? i - 1 : i;
if (currLen < totPercLen) continue;
if (currLen > totPercLen) return isMovingForward ? i - 1 : i;
return i;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.