Hello everyone…
back here with a new problem…i am creating a game here with 14x14 grid, i have to change the color of cloned game objects according to my input…
i have done that.my code is working fine,but here is lot of rendering problem with my code,
do you guys any idea why this happening to me with the below given code…
function process_Color(c : int, obj : int)
{
prev_Mat = swap_Mat;
x = obj;
try{
if(square[x-14].renderer.material.color == curr_Mat.color || square[x-14].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x-14);
}
}catch (e){}
try{
if(square[x-1].renderer.material.color == curr_Mat.color || square[x-1].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x-1);
}
}catch (e){}
try{
if(square[x+1].renderer.material.color == curr_Mat.color || square[x+1].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x+1);
}
}catch (e){}
try{
if(square[x+14].renderer.material.color == curr_Mat.color || square[x+14].renderer.material.color == prev_Mat.color)
{
square[×].renderer.material = curr_Mat;
process_Color(c,x+14);
}
}catch (e){}
}
sorry for not tagging,i don’t know how to do tagging.
and thanks for the help.