Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

Game is crash when i m trying to change the texture in device ?

$
0
0
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")); } }

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>