iTween.RotateTo C# (CSharp) Method

RotateTo() public static method

Rotates a GameObject to the supplied Euler angles in degrees over time with FULL customization options.
public static RotateTo ( GameObject target, Hashtable args ) : void
target GameObject
args Hashtable
return void
    public static void RotateTo(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("rotation")){
            if (args["rotation"].GetType() == typeof(Transform)) {
                Transform transform = (Transform)args["rotation"];
                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"]="rotate";
        args["method"]="to";
        Launch(target,args);
    }

Same methods

iTween::RotateTo ( GameObject target, Vector3 rotation, float time ) : void
iTween