IEnumerator Ok2(string URL)
{
byte[] byteArray = File.ReadAllBytes (URL);
yield return new WaitUntil (() =>byteArray.Length > 0);
Texture2D texture = new Texture2D (1, 1);
texture.LoadImage (byteArray);
Material[] a1;
a1 = cars [tmpSelectedCar].transform.GetChild (0).GetComponent ().materials;
a1 [1].mainTexture = texture;
a1 [0].mainTexture = texture;
cars [tmpSelectedCar].transform.GetChild (0).GetComponent ().materials = a1;
cars [tmpSelectedCar].transform.GetChild (1).GetComponent ().material.mainTexture = texture;
cars [tmpSelectedCar].transform.GetChild (2).GetComponent ().material.mainTexture = texture;
}
//@Textutre Change For Cars
public void MaterialChange(int numb)
{
MaterialSelect = numb;
if (File.Exists (Application.persistentDataPath + "car" + numb + ".jpg"))
{
StartCoroutine (Ok2 (Application.persistentDataPath + "car" + numb + ".jpg"));
}
}
↧