void Awake() { if (instance == null) { instance = this; } }
void Start() { buttonRenderer = GetComponent <Renderer>(); buttonsTexture = FindObjectOfType <ButtonsTexture>().GetInstance(); buttonRenderer.material = buttonsTexture.materials[index]; }