Using iTween.MoveTo with GUITextures

I've been trying to use iTween with C# and there always has casting problem.. How can I use iTween.MoveTo() FUnction in C#... iTween is written in C# but there is no example for iTween usage in C#.. What a shame with this?

Note : buttons *is the array of GUITexture..

* *```* *public void CreateMainMenu()* *{* *float startPosX = 0.0f;* *float finalPosX = 0.5f;* *float startPosY = 0.5f;* *float offsetY = 0.1f;* *buttons = new GUITexture[numButtons];* *for (int i = 0; i < numButtons; i++)* *{* _buttons *= Instantiate(GUIButton, new Vector3(0.0f, startPosY, 1.0f), Quaternion.identity) as GUITexture;*_ _*//Animate the Button*_ _*Vector3 finalPos = new Vector3(finalPosX, startPosY, 1.0f);*_ _iTween.MoveTo((GameObject)buttons *, finalPos, 1.0f);*_ _*startPosY -= offsetY;*_ _*}*_ _*}*_ _*```*_ _*

The error for the above code is " Cannot convert GUITexture to UnityEngine.GameObject" .. How can I use iTween in C#??*_ _*anyone helps me...*_ _*please

*_
iTween.MoveTo(...)

only works on GameObjects, you can't use it on GUITexture. But there's good news: Each GUITexture also has a gameObject (because it's a component attached to a game object). You can access the GameObject of GUITexture via the gameObject property.

So, the solution is simply:

iTween.MoveTo(buttons*.gameObject, ...);*
*```*
*<p>... and ... as mentioned in my comment to your question: This has nothing do with C#.</p>*

Just added an example that shows how to animate GUITextures, hope it helps: http://itween.pixelplacement.com/examples.php

Try this:

GameObject button = buttons *as GameObject;*
*if( button != null)*
 *iTween.MoveTo(button, finalPos, 1.0f);*
*else*
 *Debug.Log("Button was null");*
*```*
*<p>EDIT:</p>*
*<p>Upon further investigation, a GUITexture does not inherit from GameObject. Therefore, a GUITexture is not a GameObject, and will return null if you try to cast it as one.</p>*

iTween.MoveTo(Your game object name,iTween.Hash(“x”,0.2f,“y”,3,“time”,2.0f,“delay”,2.0f));

if you using this you can move any game object.