Skip to content

Commit

Permalink
Added Event testing to Testing script
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreylanters committed Jul 20, 2022
1 parent 772305f commit 8ddfed9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Tests/TweenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,27 @@ private void OnGUI () {
if (GUILayout.Button ("Tween Value Vector3"))
this.target.TweenValueVector3 (Vector3.one, 2, (v) => Debug.Log (v)).SetEaseSineInOut ().SetFrom (-Vector3.one);

// Event Testing
GUILayout.Label ("[EVENT TESTING]");
if (GUILayout.Button ("Tween OnComplete"))
this.target.TweenValueFloat (1, 1, (v) => { }).SetFrom (0).SetOnComplete (() => Debug.Log ("OnComplete"));
if (GUILayout.Button ("Tween OnComplete with no duration"))
this.target.TweenValueFloat (1, 0, (v) => { }).SetFrom (0).SetOnComplete (() => Debug.Log ("OnComplete"));
if (GUILayout.Button ("Tween OnCancel"))
this.target.TweenValueFloat (1, 1, (v) => { }).SetFrom (0).SetOnCancel (() => Debug.Log ("OnCancel"));
if (GUILayout.Button ("Tween OnStart"))
this.target.TweenValueFloat (1, 1, (v) => { }).SetFrom (0).SetOnStart (() => Debug.Log ("OnStart"));
if (GUILayout.Button ("Tween OnStart with delay"))
this.target.TweenValueFloat (1, 1, (v) => { }).SetFrom (0).SetOnStart (() => Debug.Log ("OnStart")).SetDelay(1);
if (GUILayout.Button ("Tween OnStart with no duration"))
this.target.TweenValueFloat (1, 0, (v) => { }).SetFrom (0).SetOnStart (() => Debug.Log ("OnStart"));
if (GUILayout.Button ("Tween OnStart with delay and no duration"))
this.target.TweenValueFloat (1, 0, (v) => { }).SetFrom (0).SetOnStart (() => Debug.Log ("OnStart")).SetDelay(1);

// Flicker Testing
GUILayout.Label ("[CANCELING TESTING]");
if (GUILayout.Button ("TweenScale"))
this.target.TweenLocalScaleX (1, 5).SetFrom (0);
if (GUILayout.Button ("TweenScale With OnCancel"))
this.target.TweenLocalScaleX (1, 5).SetFrom (0).SetOnCancel (() => Debug.Log ("Did Cancel"));
if (GUILayout.Button ("CancelAll"))
this.target.TweenCancelAll ();

Expand Down

0 comments on commit 8ddfed9

Please sign in to comment.