diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index 6e570a18..2e84e721 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -61,11 +61,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index bc7a035f..bc9e5834 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -61,11 +61,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 1d3a6a4f..04d217e5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index 027646c5..72d2df28 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("position", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index b8163caa..13ad4b48 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("position", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index 3b16d4dd..94b61567 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index 7dc61581..0071edda 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index f3e9002e..040200fd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index ab18e756..2c1401e5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index 4b4561e3..cb4898bf 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("rotation", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 8b91b402..926d62b5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("rotation", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 5be57f33..0ddfcc5b 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index d167364f..1d1f7eba 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -33,7 +33,7 @@ namespace Fungus { tweenParams.Add("scale", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -46,11 +46,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index f33de0a2..84108c97 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -33,7 +33,7 @@ namespace Fungus { tweenParams.Add("scale", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -46,11 +46,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index e1f06af9..89d8760b 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -40,7 +40,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -54,11 +54,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index 59443e2e..d57f7f74 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index 92c9477d..b88f9bbc 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs index eeda68f2..0f79ec37 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs @@ -27,10 +27,10 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public virtual void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public virtual void OnAfterDeserialize() { if (tweenNameOLD != "") { diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index bf77eee7..dc142018 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -18,6 +18,7 @@ namespace Fungus #region Obsolete Properties [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; #endregion [Tooltip("Target game object to apply the Tween to")] @@ -27,7 +28,7 @@ namespace Fungus public StringData _tweenName; [Tooltip("The time in seconds the animation will take to complete")] - public float duration = 1f; + public FloatData _duration = new FloatData(1f); [Tooltip("The shape of the easing curve applied to the animation")] public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; @@ -89,7 +90,7 @@ namespace Fungus return "Error: No target object selected"; } - return _targetObject.Value.name + " over " + duration + " seconds"; + return _targetObject.Value.name + " over " + _duration.Value + " seconds"; } public override Color GetButtonColor() @@ -101,16 +102,22 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public virtual void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public virtual void OnAfterDeserialize() { if (targetObjectOLD != null) { _targetObject.Value = targetObjectOLD; targetObjectOLD = null; } + + if (durationOLD == default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } } }