Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ShowFactionInfo(int ID)
- {
- InstantiateKVP(ID, "Name", FactionManager.Factions[ID].Name);
- InstantiateKVP(ID, "ID", FactionManager.Factions[ID].ID);
- //Relations -- This is not an issue, I don't think.
- foreach (KeyValuePair<int, Faction> _KVP in FactionManager.Factions)
- {
- if (_KVP.Key == ID)
- {
- //Set relation text to "SELF"
- }
- else
- {
- //Set relation text
- }
- }
- }
- public void InstantiateKVP<T>(int ID, string Key, T Value)
- {
- GameObject Panel;
- Text KeyText;
- Text ValueText;
- Panel = Instantiate(KeyValuePanel, InfoLeft);
- KeyText = Panel.transform.GetChild(0).GetComponent<Text>();
- ValueText = Panel.transform.GetChild(1).GetComponent<Text>();
- KeyText.text = string.Format("{0}", Key);
- ValueText.text = string.Format("{0}", Value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement