diff --git a/Assets/Fungus/iTween/Commands/MoveTo.cs b/Assets/Fungus/iTween/Commands/MoveTo.cs index 1c2eeaeb..79145e4e 100644 --- a/Assets/Fungus/iTween/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Commands/MoveTo.cs @@ -5,16 +5,24 @@ namespace Fungus { [CommandInfo("iTween", "Move To", - "Moves a game object to a specified position over time.")] + "Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] public class MoveTo : iTweenCommand { - public Vector3 position; + public Transform toTransform; + public Vector3 toPosition; public bool isLocal; public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("position", position); + if (toTransform == null) + { + tweenParams.Add("position", toPosition); + } + else + { + tweenParams.Add("position", toTransform); + } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); diff --git a/Assets/Fungus/iTween/Commands/RotateTo.cs b/Assets/Fungus/iTween/Commands/RotateTo.cs index 9dcedccc..2ed4ea81 100644 --- a/Assets/Fungus/iTween/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Commands/RotateTo.cs @@ -8,13 +8,21 @@ namespace Fungus "Rotates a game object to the specified angles over time.")] public class RotateTo : iTweenCommand { - public Vector3 rotation; + public Transform toTransform; + public Vector3 toRotation; public bool isLocal; public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("rotation", rotation); + if (toTransform == null) + { + tweenParams.Add("rotation", toRotation); + } + else + { + tweenParams.Add("rotation", toTransform); + } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); diff --git a/Assets/Fungus/iTween/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Commands/ScaleTo.cs index 51253aed..24291471 100644 --- a/Assets/Fungus/iTween/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Commands/ScaleTo.cs @@ -8,12 +8,20 @@ namespace Fungus "Changes a game object's scale to a specified value over time.")] public class ScaleTo : iTweenCommand { - public Vector3 scale; + public Transform toTransform; + public Vector3 toScale; public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("scale", scale); + if (toTransform == null) + { + tweenParams.Add("scale", toScale); + } + else + { + tweenParams.Add("scale", toTransform); + } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType);