public void onSelectColor() { var material = EventSystem.current.currentSelectedGameObject.GetComponent <Renderer>().material; _cubeModel.ChangeColor(material.color); }