Browse Source

Added tweenName & StopTween / StopTweens commands.

Can now name an individual tween and later stop it by name.
master
chrisgregan 10 years ago
parent
commit
d5919520e9
  1. 9
      Assets/Examples/iTween/iTween.unity
  2. 1
      Assets/Fungus/iTween/Commands/MoveAdd.cs
  3. 1
      Assets/Fungus/iTween/Commands/MoveFrom.cs
  4. 1
      Assets/Fungus/iTween/Commands/MoveTo.cs
  5. 1
      Assets/Fungus/iTween/Commands/PunchPosition.cs
  6. 1
      Assets/Fungus/iTween/Commands/PunchRotation.cs
  7. 1
      Assets/Fungus/iTween/Commands/PunchScale.cs
  8. 1
      Assets/Fungus/iTween/Commands/RotateAdd.cs
  9. 1
      Assets/Fungus/iTween/Commands/RotateFrom.cs
  10. 1
      Assets/Fungus/iTween/Commands/RotateTo.cs
  11. 1
      Assets/Fungus/iTween/Commands/ScaleAdd.cs
  12. 1
      Assets/Fungus/iTween/Commands/ScaleFrom.cs
  13. 1
      Assets/Fungus/iTween/Commands/ScaleTo.cs
  14. 20
      Assets/Fungus/iTween/Commands/StopTween.cs
  15. 8
      Assets/Fungus/iTween/Commands/StopTween.cs.meta
  16. 18
      Assets/Fungus/iTween/Commands/StopTweens.cs
  17. 8
      Assets/Fungus/iTween/Commands/StopTweens.cs.meta
  18. 3
      Assets/Fungus/iTween/Commands/iTweenCommand.cs

9
Assets/Examples/iTween/iTween.unity

@ -335,7 +335,7 @@ MonoBehaviour:
errorMessage:
indentLevel: 0
target: {fileID: 1090256565}
tweenName:
tweenName: MoveIt
duration: 1
easeType: 2
loopType: 0
@ -392,10 +392,9 @@ MonoBehaviour:
x: -350
y: -350
width: 1050
height: 1084
selectedSequence: {fileID: 868138992}
selectedCommands:
- {fileID: 868139003}
height: 1104
selectedSequence: {fileID: 0}
selectedCommands: []
variables: []
startSequence: {fileID: 868138992}
executeOnStart: 1

1
Assets/Fungus/iTween/Commands/MoveAdd.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", offset);
tweenParams.Add("space", space);
tweenParams.Add("time", duration);

1
Assets/Fungus/iTween/Commands/MoveFrom.cs

@ -15,6 +15,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (fromTransform == null)
{
tweenParams.Add("position", fromPosition);

1
Assets/Fungus/iTween/Commands/MoveTo.cs

@ -15,6 +15,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (toTransform == null)
{
tweenParams.Add("position", toPosition);

1
Assets/Fungus/iTween/Commands/PunchPosition.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", amount);
tweenParams.Add("space", space);
tweenParams.Add("time", duration);

1
Assets/Fungus/iTween/Commands/PunchRotation.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", amount);
tweenParams.Add("space", space);
tweenParams.Add("time", duration);

1
Assets/Fungus/iTween/Commands/PunchScale.cs

@ -13,6 +13,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", amount);
tweenParams.Add("time", duration);
tweenParams.Add("easetype", easeType);

1
Assets/Fungus/iTween/Commands/RotateAdd.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", offset);
tweenParams.Add("space", space);
tweenParams.Add("time", duration);

1
Assets/Fungus/iTween/Commands/RotateFrom.cs

@ -15,6 +15,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (fromTransform == null)
{
tweenParams.Add("rotation", fromRotation);

1
Assets/Fungus/iTween/Commands/RotateTo.cs

@ -15,6 +15,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (toTransform == null)
{
tweenParams.Add("rotation", toRotation);

1
Assets/Fungus/iTween/Commands/ScaleAdd.cs

@ -13,6 +13,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
tweenParams.Add("amount", offset);
tweenParams.Add("time", duration);
tweenParams.Add("easetype", easeType);

1
Assets/Fungus/iTween/Commands/ScaleFrom.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (fromTransform == null)
{
tweenParams.Add("scale", fromScale);

1
Assets/Fungus/iTween/Commands/ScaleTo.cs

@ -14,6 +14,7 @@ namespace Fungus
public override void DoTween()
{
Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName);
if (toTransform == null)
{
tweenParams.Add("scale", toScale);

20
Assets/Fungus/iTween/Commands/StopTween.cs

@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
[CommandInfo("iTween",
"Stop Tween",
"Stops an active iTween by name.")]
public class StopTween : Command
{
public string tweenName;
public override void OnEnter()
{
iTween.StopByName(tweenName);
Continue();
}
}
}

8
Assets/Fungus/iTween/Commands/StopTween.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e7026a0b1ea104ec0af471324ee3daea
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

18
Assets/Fungus/iTween/Commands/StopTweens.cs

@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
[CommandInfo("iTween",
"Stop Tweens",
"Stop all active iTweens in the current scene.")]
public class StopTweens : Command
{
public override void OnEnter()
{
iTween.Stop();
Continue();
}
}
}

8
Assets/Fungus/iTween/Commands/StopTweens.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 46af98f4c7e084a5a96eb982e7271174
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

3
Assets/Fungus/iTween/Commands/iTweenCommand.cs

@ -7,10 +7,11 @@ namespace Fungus
public abstract class iTweenCommand : Command
{
public GameObject target;
public string tweenName;
public float duration = 1f;
public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad;
public iTween.LoopType loopType = iTween.LoopType.none;
public bool waitUntilFinished;
public bool waitUntilFinished = true;
public override void OnEnter()
{

Loading…
Cancel
Save