SHARE
TWEET

Untitled

a guest Apr 20th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public void ShowFactionInfo(int ID)
  2.     {
  3.  
  4.  
  5.         InstantiateKVP(ID, "Name", FactionManager.Factions[ID].Name);
  6.         InstantiateKVP(ID, "ID", FactionManager.Factions[ID].ID);
  7.  
  8.         //Relations -- This is not an issue, I don't think.
  9.         foreach (KeyValuePair<int, Faction> _KVP in FactionManager.Factions)
  10.         {
  11.             if (_KVP.Key == ID)
  12.             {
  13.                 //Set relation text to "SELF"
  14.             }
  15.             else
  16.             {
  17.                 //Set relation text
  18.             }
  19.         }
  20.     }
  21.  
  22.     public void InstantiateKVP<T>(int ID, string Key, T Value)
  23.     {
  24.         GameObject Panel;
  25.         Text KeyText;
  26.         Text ValueText;
  27.  
  28.         Panel = Instantiate(KeyValuePanel, InfoLeft);
  29.         KeyText = Panel.transform.GetChild(0).GetComponent<Text>();
  30.         ValueText = Panel.transform.GetChild(1).GetComponent<Text>();
  31.  
  32.         KeyText.text = string.Format("{0}", Key);
  33.         ValueText.text = string.Format("{0}", Value);
  34.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top