How do I change this material to have the Toon/ Lit Outline shader via code at the Start of the scene?
Here is my code that I have as of now, that does not work:
using UnityEngine;
using System.Collections;
public class MainMenuManager : MonoBehaviour
{
public Material hatMaterial; //This is my character's hat shader - I set this in the Inspector
private Shader toonShader; //This is the Toon Shader with an Outline
void Start ()
{
toonShader = GetComponent<Shader> ();
toonShader = Shader.Find ("Toon/Lit Outline");
hatMaterial = GetComponent<Material> ();
hatMaterial.shader = toonShader;
}
}