Browse Source

iTween target object

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -21,7 +21,7 @@ namespace Fungus
public override void DoTween() public override void DoTween()
{ {
Hashtable tweenParams = new Hashtable(); Hashtable tweenParams = new Hashtable();
tweenParams.Add("name", tweenName); tweenParams.Add("name", _tweenName.Value);
tweenParams.Add("amount", amount); tweenParams.Add("amount", amount);
switch (axis) switch (axis)
{ {

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

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

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

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

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

@ -1,6 +1,6 @@
using UnityEngine; using UnityEngine;
using System.Collections;
using UnityEngine.Serialization; using UnityEngine.Serialization;
using System.Collections;
namespace Fungus namespace Fungus
{ {
@ -13,18 +13,18 @@ namespace Fungus
Z Z
} }
public abstract class iTweenCommand : Command, IUpdateable public abstract class iTweenCommand : Command, ISerializationCallbackReceiver
{ {
// Obsolete: Use _targetObject instead. #region Obsolete Properties
[HideInInspector] [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD;
[FormerlySerializedAs("target")] [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD;
public GameObject targetObject; #endregion
[Tooltip("Target game object to apply the Tween to")] [Tooltip("Target game object to apply the Tween to")]
public GameObjectData _targetObject; public GameObjectData _targetObject;
[Tooltip("An individual name useful for stopping iTweens by name")] [Tooltip("An individual name useful for stopping iTweens by name")]
public string tweenName; public 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 float duration = 1f; public float duration = 1f;
@ -98,17 +98,18 @@ namespace Fungus
} }
// //
// IUpdateable implementation // ISerializationCallbackReceiver implementation
// //
public virtual void UpdateToVersion(int oldVersion, int newVersion) public void OnBeforeSerialize()
{}
public void OnAfterDeserialize()
{ {
if (oldVersion == 0 && if (targetObjectOLD != null)
targetObject != null)
{ {
_targetObject.gameObjectVal = targetObject; _targetObject.Value = targetObjectOLD;
_targetObject.gameObjectRef = null; targetObjectOLD = null;
targetObject = null;
} }
} }
} }

533
Assets/FungusExamples/iTween/iTween.unity

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save