/// <summary> /// SDisplay the agents that are available for hire to the user. /// </summary> public void ShowAgentsToHire() { AgentCreator ac = GameObject.FindObjectOfType <AgentCreator>(); agentCanvas.SetActive(true); ScrollableList sl = agentCanvas.GetComponentInChildren <ScrollableList>(); sl.ClearList(); sl.CreateList(agentsForHire.Count, 1); for (int i = 0; i < agentsForHire.Count; i++) { SetAgentBoxData(sl.elements[i].transform, agentsForHire[i], Purpose.ShowAgentsToHire); } }
void OnMouseDown() { guiManager.gunMarketGUI.SetActive(true); ScrollableList sl = guiManager.gunMarketGUI.GetComponentInChildren <ScrollableList> (); sl.ClearList(); sl.CreateList(guns.Length, 1); for (int i = 0; i < guns.Length; i++) { Gun gun = guns[i]; sl.elements[i].transform.FindChild("Text").GetComponent <Text>().text = guns[i].name; sl.elements[i].transform.FindChild("Text - Price").GetComponent <Text>().text = "£" + guns[i].price; sl.elements[i].transform.FindChild("Button").GetComponent <Button>().onClick.AddListener(delegate { AddEquipmentToPlayer(gun); }); } }
/// <summary> /// Updates the list of agents available for hire. This is global due to the nature of this object. /// </summary> public void UpdateHireList() { ScrollableList sl = agentCanvas.GetComponentInChildren <ScrollableList>(); sl.ClearList(); if (agentsForHire.Count > 0) { sl.CreateList(agentsForHire.Count, 1); for (int i = 0; i < agentsForHire.Count; i++) { SetAgentBoxData(sl.elements[i].transform, agentsForHire[i], Purpose.ShowAgentsToHire); } } }
/// <summary> /// Updates the agents that are currently in the office associated with this object. /// </summary> private void UpdateOfficeList() { ScrollableList sl = agentCanvas.GetComponentInChildren <ScrollableList>(); sl.ClearList(); if (safehouse.officeAgents.Count > 0) { sl.CreateList(safehouse.officeAgents.Count, 1); for (int i = 0; i < safehouse.officeAgents.Count; i++) { SetAgentBoxData(sl.elements[i].transform, safehouse.officeAgents[i], Purpose.ShowAgentsInOffice); } } }