I’m trying to figure out how to change the material on an object using a button, so far I have this but I’m not fully understanding the reference to the game object that needs the material changed.
using UnityEngine;
using System.Collections;
public class VideoScreenManager : MonoBehaviour {
//Material Reference
public Material newMaterialRef01;
public Material newMaterialRef02;
public Material newMaterialRef03;
public Material newMaterialRef04;
public Material newMaterialRef05;
public Material newMaterialRef06; //Default White Material
public void GoColor01(){
gameObject.name=("VideoPlayerScreen").renderer.material.color = newMaterialRef01;
}
}