iTween.MoveTo C# (CSharp) Method

MoveTo() public static method

Changes a GameObject's position over time to a supplied destination with FULL customization options.
public static MoveTo ( GameObject target, Hashtable args ) : void
target GameObject
args Hashtable
return void
    public static void MoveTo(GameObject target, Hashtable args)
    {
        //clean args:
        args = iTween.CleanArgs(args);

        //additional property to ensure ConflictCheck can work correctly since Transforms are refrences:
        if(args.Contains("position")){
            if (args["position"].GetType() == typeof(Transform)) {
                Transform transform = (Transform)args["position"];
                args["position"]=new Vector3(transform.position.x,transform.position.y,transform.position.z);
                args["rotation"]=new Vector3(transform.eulerAngles.x,transform.eulerAngles.y,transform.eulerAngles.z);
                args["scale"]=new Vector3(transform.localScale.x,transform.localScale.y,transform.localScale.z);
            }
        }

        //establish iTween:
        args["type"]="move";
        args["method"]="to";
        Launch(target,args);
    }

Same methods

iTween::MoveTo ( GameObject target, Vector3 position, float time ) : void
iTween