Hi
I have a folder in c:/Img/ with some images and i want to make them dynamically textures form my 3D Object.
I have this code
using UnityEngine;
using System.Collections;
using System.IO;
public class ListImgs : MonoBehaviour {
public Texture2D textureIs;
GameObject MyCube;
void Awake () {
MyCube = GameObject.Find ("Cube2");
string image = "c:/Img/a.jpg";
void Start () {
textureIs = Resources.Load (image, typeof(Texture2D)) as Texture2D;
MyCube.renderer.material.mainTexture = textureIs;
}
}
And does not work for me.
It gives an empty cube.
What is the problem