Search Unity

(C#) change texture to 2d prefabs randomly

Discussion in 'Scripting' started by dousi96, Jul 28, 2014.

  1. dousi96

    dousi96

    Joined:
    Jul 28, 2014
    Posts:
    23
    Hi guys!
    i need to change the texture to a smart group of prefabs; the textures that I want use are in assets/texture/terrain and the name of the texture are "rocce1","rocce2","rocce3"....etc
    I want to set the texture on the prefabs after it is instantiated.

    thanks!
    Dousi96
     
  2. dousi96

    dousi96

    Joined:
    Jul 28, 2014
    Posts:
    23
    here where to insert the c# script!
    thanks
     

    Attached Files: