I'm using the Toon-BasicOutline on a GameObject right now, and I'd like to be able to disable just the outline effect (not the GoodDirt material).
Does anyone know a way to do this with code?
I'm using the Toon-BasicOutline on a GameObject right now, and I'd like to be able to disable just the outline effect (not the GoodDirt material).
Does anyone know a way to do this with code?
Drop this script on your object, run the game and press spacebar to see the outline appear/disappear:
private var shaderNoOutline = Shader.Find( "Toon/Basic" );
private var shaderOutline = Shader.Find( "Toon/Basic Outline" );
function Update() {
if( Input.GetButtonDown("Jump") ) {
if( renderer.material.shader == shaderNoOutline )
renderer.material.shader = shaderOutline;
else
renderer.material.shader = shaderNoOutline;
}
}