Exemplo n.º 1
0
 // This is that was added to the RegisterResearch.OnGetResearchTranslation event
 static public void GetResearchTranslation(Player.UpgradeType upgradeType)
 {
     if (upgradeTranslationKeys.ContainsKey(upgradeType))
     {
         RegisterResearch.researchTranslation = GetTranslation(upgradeTranslationKeys[upgradeType]);
     }
 }
Exemplo n.º 2
0
                static void Postfix(ResearchUI __instance)
                {
                    FieldInfo   optionMapInfo       = typeof(ResearchUI).GetField("optionMap", BindingFlags.NonPublic | BindingFlags.Instance);
                    IDictionary optionMapDictionary = (IDictionary)optionMapInfo.GetValue(__instance);

                    foreach (object upgradeTypeObject in optionMapDictionary.Keys)
                    {
                        Player.UpgradeType upgradeType     = (Player.UpgradeType)upgradeTypeObject;
                        Transform          optionTransform = (Transform)optionMapDictionary[upgradeTypeObject];
                        researchTranslation = optionTransform.GetChild(0).GetComponent <TMPro.TextMeshProUGUI>().text;
                        OnGetResearchTranslation.Invoke(upgradeType);
                        optionTransform.GetChild(0).GetComponent <TMPro.TextMeshProUGUI>().text = researchTranslation;
                    }
                }