// This spawns the UI elements for racks into the rigs menu private void PopulateRacksMenu() { for (int i = 0; i < currentMapController.maxRacks; i++) { RigUI spawnedRackInfo = Instantiate(individualRackTemplate, Vector3.zero, Quaternion.identity, rigMenuHolder).GetComponent <RigUI>(); rackUIElementsSpawned++; spawnedRackInfo.slotText.text = "Rack Slot # " + (i + 1); } }
private void PopulateRigsMenu() { for (int i = 0; i < currentMapController.maxRigs; i++) { RigUI spawnedRigUI = Instantiate(individualRigTemplate, Vector3.zero, Quaternion.identity, rigMenuHolder).GetComponent <RigUI>(); // Enable the very first rig because that one is always present if (i == 0) { spawnedRigUI.isEnabled = true; } spawnedRigUI.slotText.text = "Rig Slot # " + (i + 1); rigUIElementsSpawned++; } }
public void RefreshMenuIDs() { currentMapController = FindObjectOfType <MapController>(); for (int i = rackUIElementsSpawned; i < currentMapController.maxRacks; i++) { RigUI spawnedRackUI = Instantiate(individualRackTemplate, Vector3.zero, Quaternion.identity, rigMenuHolder).GetComponent <RigUI>(); spawnedRackUI.slotText.text = "Rack Slot # " + (i + 1); rackUIElementsSpawned++; } for (int i = rigUIElementsSpawned; i < currentMapController.maxRigs; i++) { RigUI spawnedRigUI = Instantiate(individualRigTemplate, Vector3.zero, Quaternion.identity, rigMenuHolder).GetComponent <RigUI>(); spawnedRigUI.slotText.text = "Rig Slot # " + (i + 1); rigUIElementsSpawned++; } AssignIDToRigMenu(); }