void OnMouseOver() { if (!snake.isCoolingDown) { materialManager.ChangeLeavesMaterial(meshRenderer, MaterialManager.LeavesMaterial.Hovered); } }
void ChangeAllLeavesMaterial(MaterialManager.LeavesMaterial leavesMaterial) { foreach (var leaves in FindObjectsOfType <Leaves>()) { materialManager.ChangeLeavesMaterial(leaves.GetComponent <MeshRenderer>(), leavesMaterial); } }