HI Suzit,
If I have understood correctly then the solution is mentioned below. Keep your Textures in Resources Folder and name your texture as per alphabet it contains (see attachment). This script is basically instantiating cubes equal to the length of your character array and applying texture to it..Output is also shown! For any clarification feel free to ask . Hope it helps.
using UnityEngine;
using System.Collections;
public class ApplyTexture : MonoBehaviour {
private char[] charac={'R','E','D'};
public GameObject cube;
// Use this for initialization
void Start ()
{
for (int i = 0; i().material.mainTexture =gettexture;
}
}
}
[1]: /storage/temp/51333-screen-shot-2015-07-31-at-42736-pm.png
[2]: /storage/temp/51334-screen-shot-2015-07-31-at-42955-pm.png
↧