// Update is called once per frame void Update() { //figure out what got hit if (Input.GetMouseButtonDown(0)) { //first frame where left mouse button is clicked var clickedGO = CheckForObjectUnderMouse(); if (clickedGO == null) { Debug.Log("nothing clicked"); } else { var clickedName = clickedGO.name; Debug.Log("clicked on " + clickedName); if (clickedName == "Initialize") { ac.InitializeOffsets(); } } } //find matching commodity //reduce production of that commodity (signal to relevant agents) }