Search Unity

Toggle Material

Discussion in 'Editor & General Support' started by luigix, Oct 20, 2010.

  1. luigix

    luigix

    Joined:
    Mar 13, 2010
    Posts:
    15
    hi unityfriends,
    I'm trying to get this to work, but after two hours last night I didn't figure out how.

    I have on Objects with 2 materials and I'd like to switch on/off one or more of these.
    I've been trying using the renderer.material.CopyPropertiesFromMaterial but it doesn't copy the shader type.

    For instance, I'm just trying to switch back and forth between Diffuse and Transparent-Diffuse to get transparency only when it's really needed (avoiding the issues about "which render first" when two ore more Transparent-Diffuse objects happen to be overlapped).

    thanks a lot!
     
    Last edited: Oct 20, 2010