Browse Source

Refactored iTween commands to use protected serialised fields

master
Christopher 8 years ago
parent
commit
7475ff89e7
  1. 6
      Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs
  2. 6
      Assets/Fungus/iTween/Scripts/Commands/LookTo.cs
  3. 4
      Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs
  4. 6
      Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs
  5. 6
      Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs
  6. 4
      Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs
  7. 4
      Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs
  8. 2
      Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs
  9. 4
      Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs
  10. 6
      Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs
  11. 6
      Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs
  12. 2
      Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs
  13. 4
      Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs
  14. 4
      Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs
  15. 6
      Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs
  16. 4
      Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs
  17. 2
      Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs
  18. 2
      Assets/Fungus/iTween/Scripts/Commands/StopTween.cs
  19. 14
      Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs

6
Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs

@ -17,13 +17,13 @@ namespace Fungus
public class LookFrom : iTweenCommand public class LookFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will look at")] [Tooltip("Target transform that the GameObject will look at")]
public TransformData _fromTransform; [SerializeField] protected TransformData _fromTransform;
[Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")]
public Vector3Data _fromPosition; [SerializeField] protected Vector3Data _fromPosition;
[Tooltip("Restricts rotation to the supplied axis only")] [Tooltip("Restricts rotation to the supplied axis only")]
public iTweenAxis axis; [SerializeField] protected iTweenAxis axis;
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/LookTo.cs

@ -17,13 +17,13 @@ namespace Fungus
public class LookTo : iTweenCommand public class LookTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will look at")] [Tooltip("Target transform that the GameObject will look at")]
public TransformData _toTransform; [SerializeField] protected TransformData _toTransform;
[Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")]
public Vector3Data _toPosition; [SerializeField] protected Vector3Data _toPosition;
[Tooltip("Restricts rotation to the supplied axis only")] [Tooltip("Restricts rotation to the supplied axis only")]
public iTweenAxis axis; [SerializeField] protected iTweenAxis axis;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs

@ -17,10 +17,10 @@ namespace Fungus
public class MoveAdd : iTweenCommand public class MoveAdd : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _offset; [SerializeField] protected Vector3Data _offset;
[Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")]
public Space space = Space.Self; [SerializeField] protected Space space = Space.Self;
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs

@ -17,13 +17,13 @@ namespace Fungus
public class MoveFrom : iTweenCommand public class MoveFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will move from")] [Tooltip("Target transform that the GameObject will move from")]
public TransformData _fromTransform; [SerializeField] protected TransformData _fromTransform;
[Tooltip("Target world position that the GameObject will move from, if no From Transform is set")] [Tooltip("Target world position that the GameObject will move from, if no From Transform is set")]
public Vector3Data _fromPosition; [SerializeField] protected Vector3Data _fromPosition;
[Tooltip("Whether to animate in world space or relative to the parent. False by default.")] [Tooltip("Whether to animate in world space or relative to the parent. False by default.")]
public bool isLocal; [SerializeField] protected bool isLocal;
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs

@ -17,13 +17,13 @@ namespace Fungus
public class MoveTo : iTweenCommand public class MoveTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will move to")] [Tooltip("Target transform that the GameObject will move to")]
public TransformData _toTransform; [SerializeField] protected TransformData _toTransform;
[Tooltip("Target world position that the GameObject will move to, if no From Transform is set")] [Tooltip("Target world position that the GameObject will move to, if no From Transform is set")]
public Vector3Data _toPosition; [SerializeField] protected Vector3Data _toPosition;
[Tooltip("Whether to animate in world space or relative to the parent. False by default.")] [Tooltip("Whether to animate in world space or relative to the parent. False by default.")]
public bool isLocal; [SerializeField] protected bool isLocal;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs

@ -17,10 +17,10 @@ namespace Fungus
public class PunchPosition : iTweenCommand public class PunchPosition : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
[Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")]
public Space space = Space.Self; [SerializeField] protected Space space = Space.Self;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs

@ -17,10 +17,10 @@ namespace Fungus
public class PunchRotation : iTweenCommand public class PunchRotation : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
[Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")]
public Space space = Space.Self; [SerializeField] protected Space space = Space.Self;
public override void DoTween() public override void DoTween()
{ {

2
Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs

@ -17,7 +17,7 @@ namespace Fungus
public class PunchScale : iTweenCommand public class PunchScale : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs

@ -17,10 +17,10 @@ namespace Fungus
public class RotateAdd : iTweenCommand public class RotateAdd : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _offset; [SerializeField] protected Vector3Data _offset;
[Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")]
public Space space = Space.Self; [SerializeField] protected Space space = Space.Self;
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs

@ -17,13 +17,13 @@ namespace Fungus
public class RotateFrom : iTweenCommand public class RotateFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will rotate from")] [Tooltip("Target transform that the GameObject will rotate from")]
public TransformData _fromTransform; [SerializeField] protected TransformData _fromTransform;
[Tooltip("Target rotation that the GameObject will rotate from, if no From Transform is set")] [Tooltip("Target rotation that the GameObject will rotate from, if no From Transform is set")]
public Vector3Data _fromRotation; [SerializeField] protected Vector3Data _fromRotation;
[Tooltip("Whether to animate in world space or relative to the parent. False by default.")] [Tooltip("Whether to animate in world space or relative to the parent. False by default.")]
public bool isLocal; [SerializeField] protected bool isLocal;
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs

@ -17,13 +17,13 @@ namespace Fungus
public class RotateTo : iTweenCommand public class RotateTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will rotate to")] [Tooltip("Target transform that the GameObject will rotate to")]
public TransformData _toTransform; [SerializeField] protected TransformData _toTransform;
[Tooltip("Target rotation that the GameObject will rotate to, if no To Transform is set")] [Tooltip("Target rotation that the GameObject will rotate to, if no To Transform is set")]
public Vector3Data _toRotation; [SerializeField] protected Vector3Data _toRotation;
[Tooltip("Whether to animate in world space or relative to the parent. False by default.")] [Tooltip("Whether to animate in world space or relative to the parent. False by default.")]
public bool isLocal; [SerializeField] protected bool isLocal;
public override void DoTween() public override void DoTween()
{ {

2
Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs

@ -17,7 +17,7 @@ namespace Fungus
public class ScaleAdd : iTweenCommand public class ScaleAdd : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _offset; [SerializeField] protected Vector3Data _offset;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs

@ -17,10 +17,10 @@ namespace Fungus
public class ScaleFrom : iTweenCommand public class ScaleFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will scale from")] [Tooltip("Target transform that the GameObject will scale from")]
public TransformData _fromTransform; [SerializeField] protected TransformData _fromTransform;
[Tooltip("Target scale that the GameObject will scale from, if no From Transform is set")] [Tooltip("Target scale that the GameObject will scale from, if no From Transform is set")]
public Vector3Data _fromScale; [SerializeField] protected Vector3Data _fromScale;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs

@ -17,10 +17,10 @@ namespace Fungus
public class ScaleTo : iTweenCommand public class ScaleTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will scale to")] [Tooltip("Target transform that the GameObject will scale to")]
public TransformData _toTransform; [SerializeField] protected TransformData _toTransform;
[Tooltip("Target scale that the GameObject will scale to, if no To Transform is set")] [Tooltip("Target scale that the GameObject will scale to, if no To Transform is set")]
public Vector3Data _toScale = new Vector3Data(Vector3.one); [SerializeField] protected Vector3Data _toScale = new Vector3Data(Vector3.one);
public override void DoTween() public override void DoTween()
{ {

6
Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs

@ -17,13 +17,13 @@ namespace Fungus
public class ShakePosition : iTweenCommand public class ShakePosition : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
[Tooltip("Whether to animate in world space or relative to the parent. False by default.")] [Tooltip("Whether to animate in world space or relative to the parent. False by default.")]
public bool isLocal; [SerializeField] protected bool isLocal;
[Tooltip("Restricts rotation to the supplied axis only")] [Tooltip("Restricts rotation to the supplied axis only")]
public iTweenAxis axis; [SerializeField] protected iTweenAxis axis;
public override void DoTween() public override void DoTween()
{ {

4
Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs

@ -17,10 +17,10 @@ namespace Fungus
public class ShakeRotation : iTweenCommand public class ShakeRotation : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
[Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")]
public Space space = Space.Self; [SerializeField] protected Space space = Space.Self;
public override void DoTween() public override void DoTween()
{ {

2
Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs

@ -17,7 +17,7 @@ namespace Fungus
public class ShakeScale : iTweenCommand public class ShakeScale : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _amount; [SerializeField] protected Vector3Data _amount;
public override void DoTween() public override void DoTween()
{ {

2
Assets/Fungus/iTween/Scripts/Commands/StopTween.cs

@ -17,7 +17,7 @@ namespace Fungus
public class StopTween : Command public class StopTween : Command
{ {
[Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")]
public StringData _tweenName; [SerializeField] protected StringData _tweenName;
public override void OnEnter() public override void OnEnter()
{ {

14
Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs

@ -22,25 +22,25 @@ namespace Fungus
public abstract class iTweenCommand : Command public abstract class iTweenCommand : Command
{ {
[Tooltip("Target game object to apply the Tween to")] [Tooltip("Target game object to apply the Tween to")]
public GameObjectData _targetObject; [SerializeField] protected GameObjectData _targetObject;
[Tooltip("An individual name useful for stopping iTweens by name")] [Tooltip("An individual name useful for stopping iTweens by name")]
public StringData _tweenName; [SerializeField] protected StringData _tweenName;
[Tooltip("The time in seconds the animation will take to complete")] [Tooltip("The time in seconds the animation will take to complete")]
public FloatData _duration = new FloatData(1f); [SerializeField] protected FloatData _duration = new FloatData(1f);
[Tooltip("The shape of the easing curve applied to the animation")] [Tooltip("The shape of the easing curve applied to the animation")]
public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; [SerializeField] protected iTween.EaseType easeType = iTween.EaseType.easeInOutQuad;
[Tooltip("The type of loop to apply once the animation has completed")] [Tooltip("The type of loop to apply once the animation has completed")]
public iTween.LoopType loopType = iTween.LoopType.none; [SerializeField] protected iTween.LoopType loopType = iTween.LoopType.none;
[Tooltip("Stop any previously added iTweens on this object before adding this iTween")] [Tooltip("Stop any previously added iTweens on this object before adding this iTween")]
public bool stopPreviousTweens = false; [SerializeField] protected bool stopPreviousTweens = false;
[Tooltip("Wait until the tween has finished before executing the next command")] [Tooltip("Wait until the tween has finished before executing the next command")]
public bool waitUntilFinished = true; [SerializeField] protected bool waitUntilFinished = true;
public override void OnEnter() public override void OnEnter()
{ {

Loading…
Cancel
Save