From 7475ff89e781af5562ac1a4098f6bb65a14cdb86 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 22 Aug 2016 11:31:35 +0100 Subject: [PATCH] Refactored iTween commands to use protected serialised fields --- Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs | 6 +++--- Assets/Fungus/iTween/Scripts/Commands/LookTo.cs | 6 +++--- Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs | 4 ++-- Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs | 6 +++--- Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs | 6 +++--- .../iTween/Scripts/Commands/PunchPosition.cs | 4 ++-- .../iTween/Scripts/Commands/PunchRotation.cs | 4 ++-- .../Fungus/iTween/Scripts/Commands/PunchScale.cs | 2 +- Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs | 4 ++-- .../Fungus/iTween/Scripts/Commands/RotateFrom.cs | 6 +++--- Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs | 6 +++--- Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs | 2 +- Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs | 4 ++-- Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs | 4 ++-- .../iTween/Scripts/Commands/ShakePosition.cs | 6 +++--- .../iTween/Scripts/Commands/ShakeRotation.cs | 4 ++-- .../Fungus/iTween/Scripts/Commands/ShakeScale.cs | 2 +- Assets/Fungus/iTween/Scripts/Commands/StopTween.cs | 2 +- .../iTween/Scripts/Commands/iTweenCommand.cs | 14 +++++++------- 19 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index a82021ec..47fdbf3c 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -17,13 +17,13 @@ namespace Fungus public class LookFrom : iTweenCommand { [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")] - public Vector3Data _fromPosition; + [SerializeField] protected Vector3Data _fromPosition; [Tooltip("Restricts rotation to the supplied axis only")] - public iTweenAxis axis; + [SerializeField] protected iTweenAxis axis; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index a2e9e467..9e6871f8 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -17,13 +17,13 @@ namespace Fungus public class LookTo : iTweenCommand { [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")] - public Vector3Data _toPosition; + [SerializeField] protected Vector3Data _toPosition; [Tooltip("Restricts rotation to the supplied axis only")] - public iTweenAxis axis; + [SerializeField] protected iTweenAxis axis; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 278850c8..3927475a 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -17,10 +17,10 @@ namespace Fungus public class MoveAdd : iTweenCommand { [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")] - public Space space = Space.Self; + [SerializeField] protected Space space = Space.Self; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index dad37c38..870d72f7 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -17,13 +17,13 @@ namespace Fungus public class MoveFrom : iTweenCommand { [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")] - public Vector3Data _fromPosition; + [SerializeField] protected Vector3Data _fromPosition; [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() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index ce6cda82..bc89b6f4 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -17,13 +17,13 @@ namespace Fungus public class MoveTo : iTweenCommand { [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")] - public Vector3Data _toPosition; + [SerializeField] protected Vector3Data _toPosition; [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() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index fa486743..fa98b4fa 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -17,10 +17,10 @@ namespace Fungus public class PunchPosition : iTweenCommand { [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")] - public Space space = Space.Self; + [SerializeField] protected Space space = Space.Self; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index 4901f4dd..be92547b 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -17,10 +17,10 @@ namespace Fungus public class PunchRotation : iTweenCommand { [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")] - public Space space = Space.Self; + [SerializeField] protected Space space = Space.Self; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index 6237f0e8..160c63d0 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -17,7 +17,7 @@ namespace Fungus public class PunchScale : iTweenCommand { [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3Data _amount; + [SerializeField] protected Vector3Data _amount; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index c3690bb7..f447294d 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -17,10 +17,10 @@ namespace Fungus public class RotateAdd : iTweenCommand { [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")] - public Space space = Space.Self; + [SerializeField] protected Space space = Space.Self; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index 7a9ebec5..5366db42 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -17,13 +17,13 @@ namespace Fungus public class RotateFrom : iTweenCommand { [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")] - public Vector3Data _fromRotation; + [SerializeField] protected Vector3Data _fromRotation; [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() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index e42e3874..dc3aaff2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -17,13 +17,13 @@ namespace Fungus public class RotateTo : iTweenCommand { [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")] - public Vector3Data _toRotation; + [SerializeField] protected Vector3Data _toRotation; [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() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index b050734b..45b69091 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -17,7 +17,7 @@ namespace Fungus public class ScaleAdd : iTweenCommand { [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3Data _offset; + [SerializeField] protected Vector3Data _offset; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index 77d51ec2..f668d0af 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -17,10 +17,10 @@ namespace Fungus public class ScaleFrom : iTweenCommand { [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")] - public Vector3Data _fromScale; + [SerializeField] protected Vector3Data _fromScale; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index bc39917c..cec361c3 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -17,10 +17,10 @@ namespace Fungus public class ScaleTo : iTweenCommand { [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")] - public Vector3Data _toScale = new Vector3Data(Vector3.one); + [SerializeField] protected Vector3Data _toScale = new Vector3Data(Vector3.one); public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index 9edfc803..a5324eaa 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -17,13 +17,13 @@ namespace Fungus public class ShakePosition : iTweenCommand { [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.")] - public bool isLocal; + [SerializeField] protected bool isLocal; [Tooltip("Restricts rotation to the supplied axis only")] - public iTweenAxis axis; + [SerializeField] protected iTweenAxis axis; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index f83222d9..959a195d 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -17,10 +17,10 @@ namespace Fungus public class ShakeRotation : iTweenCommand { [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")] - public Space space = Space.Self; + [SerializeField] protected Space space = Space.Self; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index 066272ce..8f6aa204 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -17,7 +17,7 @@ namespace Fungus public class ShakeScale : iTweenCommand { [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3Data _amount; + [SerializeField] protected Vector3Data _amount; public override void DoTween() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs index a3e411e8..0f06dee0 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs @@ -17,7 +17,7 @@ namespace Fungus public class StopTween : Command { [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] - public StringData _tweenName; + [SerializeField] protected StringData _tweenName; public override void OnEnter() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index a59ba1f8..4cb3e1d1 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -22,25 +22,25 @@ namespace Fungus public abstract class iTweenCommand : Command { [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")] - public StringData _tweenName; + [SerializeField] protected StringData _tweenName; [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")] - 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")] - 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")] - public bool stopPreviousTweens = false; + [SerializeField] protected bool stopPreviousTweens = false; [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() {