Char To Texture

I have one major issue in applying texture on object with respect to char.
For e.g.: I have array of char which has like “R” “E” “D” of string “RED”. so, with respect to this i want to apply these texture on single object each like on quad. Quad 1 has “R” of char[0] texture Quad 2 - “E” of char[1] and Quad - “D” char[2].

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<charac.Length; i++) 
			GameObject x = Instantiate(cube,new Vector3(i*2,0,0),Quaternion.identity) as GameObject;
			Texture gettexture =  Resources.Load (charac*.ToString()) as Texture;*
  •  	x.GetComponent<Renderer>().material.mainTexture =gettexture;*
  •  }*
  • }*