Esempio n. 1
0
 protected override void OnLoadLevel()
 {
     Instance = null;
     activeDiagrams.Clear();
     UnityEngine.Object.Destroy(base.gameObject);
     base.OnLoadLevel();
 }
Esempio n. 2
0
 protected override void OnSpawn()
 {
     base.OnSpawn();
     if ((UnityEngine.Object)Instance == (UnityEngine.Object)null)
     {
         Instance         = this;
         activeUnitObjs   = new List <GameObject>();
         inactiveUnitObjs = new List <GameObject>();
         foreach (OverlayInfo overlayInfo in overlayInfoList)
         {
             overlayInfo.name = Strings.Get(overlayInfo.name);
             for (int i = 0; i < overlayInfo.infoUnits.Count; i++)
             {
                 overlayInfo.infoUnits[i].description = Strings.Get(overlayInfo.infoUnits[i].description);
                 if (!string.IsNullOrEmpty(overlayInfo.infoUnits[i].tooltip))
                 {
                     overlayInfo.infoUnits[i].tooltip = Strings.Get(overlayInfo.infoUnits[i].tooltip);
                 }
             }
         }
         ClearLegend();
     }
     else
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
Esempio n. 3
0
            public static void Prefix(OverlayLegend __instance)
            {
                var instance = Traverse.Create(__instance);

                if (instance.Field("overlayInfoList").FieldExists() && instance.Field("overlayInfoList").GetValue <List <OverlayLegend.OverlayInfo> >() != null)
                {
                    var info = new OverlayLegend.OverlayInfo
                    {
                        name      = MapOverlay.LocName,
                        mode      = MapOverlay.ID,
                        infoUnits = new List <OverlayLegend.OverlayInfoUnit>(),
                        isProgrammaticallyPopulated = true
                    };

                    instance.Field("overlayInfoList").GetValue <List <OverlayLegend.OverlayInfo> >().Add(info);
                }
            }