public static void Prefix(MapTaskOverlay __instance) { if (!Enabled) { return; } foreach (var PooledIcon in PooledIcons.Values) { Object.Destroy(PooledIcon.gameObject); } PooledIcons.Clear(); }
public static bool Prefix(MapTaskOverlay __instance) { if (!Enabled) { return(true); } __instance.gameObject.SetActive(true); foreach (var MapIcon in Icons) { var Pooled = Object.Instantiate(__instance.icons.Prefab, __instance.transform) .GetComponent <PooledMapIcon>(); Pooled.transform.localScale = new Vector3(Pooled.NormalSize, Pooled.NormalSize, Pooled.NormalSize); MapIcon.Pooled = Pooled; MapIcon.Color = MapIcon.Color; Pooled.SetFrom(MapIcon); PooledIcons.Add(MapIcon, Pooled); } return(false); }