Hi everyone, I have a problem with to load a texture, and i dont know why.
I want download many images from internet and put in UITexture directly and its work fine in editor but this doesn't work in android, I tested many ways and nothing
With this code I create a GameObject with necessary script
_objectPicture
= _createGUI
.GUIObject("Photo_"+i
.ToString(),
new float[]{_position,
0 ,
0},
new float[]{10,
10,
1},ContainerPhotos
); _texture = _objectPicture.AddComponent<UITexture>();
_objectPicture.AddComponent<DownloadPhoto>().url = Constants.LinkDownloadPhoto+N["images"][i];
_objectPicture.AddComponent<UIDragPanelContents>();
And with this script i download the image from web but before it shows the preloading image and then the photo
void Start() {
_texture = GetComponent<UITexture>();
_texture.mainTexture = (Texture)Resources.Load("images/Logo") as Texture;
_texture.MakePixelPerfect();
StartCoroutine(DownloadImage());
}
IEnumerator DownloadImage() {
yield return www;
_texture.mainTexture = www.texture;
_texture.MakePixelPerfect();
gameObject.AddComponent<BoxCollider>();
gameObject
.transform.localScale = new Vector3
(534,
388,
1); }