1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-15 03:21:37 +08:00

More GUI Editor utils

This commit is contained in:
Daniele Giardini 2015-04-08 10:57:19 +02:00
parent 0e4f16f7a4
commit e194bad34e
49 changed files with 53 additions and 21 deletions

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 37ee0778ced0de945b4521e7e0ee9dac
folderAsset: yes
timeCreated: 1428482901
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,10 +7,15 @@ public class Temp : BrainBase
{ {
public Transform target; public Transform target;
void Start() public void TweenThis(int direction)
{ {
target.DOMoveX(2,1) Debug.Log("HERE");
.OnUpdate(()=> Debug.Log(DOTween.IsTweening(target))) if (DOTween.IsTweening("infoTabSwipeAnim")) {
.OnComplete(()=> Debug.Log(DOTween.IsTweening(target))); Debug.Log("IsTweening");
// DOTween.Rewind("infoTabSwipeAnim", false);
DOTween.Kill("infoTabSwipeAnim", true);
}
target.DOLocalMoveX(direction*800, 0.3f, false).From().SetEase(Ease.OutBack).SetId("infoTabSwipeAnim");
} }
} }

View File

@ -5,17 +5,17 @@ public class PooledAnimation : MonoBehaviour
{ {
public void OnSpawn() public void OnSpawn()
{ {
DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>(); // DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>();
if (doanim) doanim.DORestart(true); // if (doanim) doanim.DORestart(true);
DOTweenPath dopath = this.GetComponent<DOTweenPath>(); // DOTweenPath dopath = this.GetComponent<DOTweenPath>();
if (dopath) dopath.DORestart(true); // if (dopath) dopath.DORestart(true);
} }
public void OnDespawn() public void OnDespawn()
{ {
DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>(); // DOTweenAnimation doanim = this.GetComponent<DOTweenAnimation>();
if (doanim) doanim.DORewind(); // if (doanim) doanim.DORewind();
DOTweenPath dopath = this.GetComponent<DOTweenPath>(); // DOTweenPath dopath = this.GetComponent<DOTweenPath>();
if (dopath) dopath.DORewind(); // if (dopath) dopath.DORewind();
} }
} }

View File

@ -5,17 +5,17 @@ public class PooledChildAnimation : MonoBehaviour
{ {
public void OnSpawn() public void OnSpawn()
{ {
DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>(); // DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>();
if (doanim) doanim.DORestart(true); // if (doanim) doanim.DORestart(true);
DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>(); // DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>();
if (dopath) dopath.DORestart(true); // if (dopath) dopath.DORestart(true);
} }
public void OnDespawn() public void OnDespawn()
{ {
DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>(); // DOTweenAnimation doanim = this.GetComponentInChildren<DOTweenAnimation>();
if (doanim) doanim.DORewind(); // if (doanim) doanim.DORewind();
DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>(); // DOTweenPath dopath = this.GetComponentInChildren<DOTweenPath>();
if (dopath) dopath.DORewind(); // if (dopath) dopath.DORewind();
} }
} }

View File

@ -21,7 +21,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.0.445"; public static readonly string Version = "1.0.450";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

View File

@ -29,6 +29,19 @@ namespace DG.DOTweenEditor.Core
popupButton, popupButton,
btIconStyle; btIconStyle;
public static Texture2D logo
{
get
{
if (_logo == null) {
_logo = Resources.LoadAssetAtPath("Assets/" + EditorUtils.editorADBDir + "Imgs/DOTweenIcon.png", typeof(Texture2D)) as Texture2D;
EditorUtils.SetEditorTexture(_logo, FilterMode.Bilinear, 128);
}
return _logo;
}
}
static Texture2D _logo;
// Filtered ease types to show desired eases in Inspector panels // Filtered ease types to show desired eases in Inspector panels
internal static readonly string[] FilteredEaseTypes = new[] { internal static readonly string[] FilteredEaseTypes = new[] {
"Linear", "Linear",
@ -79,6 +92,11 @@ namespace DG.DOTweenEditor.Core
return stringEaseId == FilteredEaseTypes.Length - 1 ? Ease.INTERNAL_Custom : (Ease)Enum.Parse(typeof(Ease), FilteredEaseTypes[stringEaseId]); return stringEaseId == FilteredEaseTypes.Length - 1 ? Ease.INTERNAL_Custom : (Ease)Enum.Parse(typeof(Ease), FilteredEaseTypes[stringEaseId]);
} }
public static void InspectorLogo()
{
GUILayout.Box(logo, logoIconStyle);
}
// A button which works as a toggle // A button which works as a toggle
public static bool ToggleButton(bool toggled, GUIContent content, GUIStyle guiStyle = null, params GUILayoutOption[] options) public static bool ToggleButton(bool toggled, GUIContent content, GUIStyle guiStyle = null, params GUILayoutOption[] options)
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.