Hi everybody. I have a problem. I am using a script to change textures of an object but it´s works only until third texture, no four, no five. Is the script limited to three textures only?
var Texture:Texture2D;
var Texture2:Texture2D;
var Texture3:Texture2D;
var Texture4:Texture2D;
var Texture5:Texture2D;
function Update ()
{
if(Input.GetKey (“1”) )
{
if(Texture)
{
Debug.Log(“Texture Loaded Sucessfully…”);
renderer.material.mainTexture = Texture;
}
else
{
Debug.Log(“Unable to Load texture…”);
}
}
if(Input.GetKey (“2”) )
{
if(Texture)
{
Debug.Log(“Texture Loaded Sucessfully…”);
renderer.material.mainTexture = Texture2;
}
else
{
Debug.Log(“Unable to Load texture…”);
}
}
if(Input.GetKey (“3”) )
{
if(Texture)
{
Debug.Log(“Texture Loaded Sucessfully…”);
renderer.material.mainTexture = Texture3;
}
else
{
Debug.Log(“Unable to Load texture…”);
}
}
}
if(Input.GetKey (“4”) )
{
if(Texture)
{
Debug.Log(“Texture Loaded Sucessfully…”);
renderer.material.mainTexture = Texture4;
}
else
{
Debug.Log(“Unable to Load texture…”);
}
}
if(Input.GetKey (“”) )
{
if(Texture)
{
Debug.Log(“Texture Loaded Sucessfully…”);
renderer.material.mainTexture = Texture5;
}
else
{
Debug.Log(“Unable to Load texture…”);
}
}