public static void Start(MethodBase __originalMethod, ref Profiler __state) { if (p.Active) { __state = p.Start(__originalMethod.Name, __originalMethod); } }
public static bool Prefix(MethodBase __originalMethod, Section __instance, MapMeshFlag changeType) { if (p.Active) { for (int i = 0; i < __instance.layers.Count; i++) { SectionLayer sectionLayer = __instance.layers[i]; if ((sectionLayer.relevantChangeTypes & changeType) != MapMeshFlag.None) { try { var prof = p.Start(__instance.layers[i].GetType().FullName, __originalMethod); sectionLayer.Regenerate(); prof.Stop(); } catch (Exception ex) { Log.Error(string.Concat(new object[] { "Could not regenerate layer ", sectionLayer.ToStringSafe <SectionLayer>(), ": ", ex }), false); } } } return(false); } return(true); }