How can I attach script to UITexture I've made by script?
I have something like this:
UITexture newTexture;
newTexture = NGUITools.AddWidget<UITexture>(scrollViewObject);
newTexture.SetRect(x,y,texWidth,texHeight);
newTexture.mainTexture=texTmp;
It makes me newTexture in ScrollViewGrid. Now I want to do something like this:
newTexture.AddComponent<UIDragScrollView>();
Of course it doesn't work. So how can I do it better?