public static void EndColliding(/*ulong[] ___m_collidingSegments1*/) { StackTrace stackTrace = new StackTrace(); ToolController targetInstance = Singleton <ToolManager> .instance.m_properties; if (stackTrace.GetFrame(1).GetMethod().Name == "SimulationStep") { ulong[] ___m_collidingSegments1 = typeof(ToolController).GetField("m_collidingSegments1", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(targetInstance) as ulong[]; //UnityEngine.Debug.Log("EndColliding caller: " + stackTrace.GetFrame(2).GetMethod().GetUnderlyingType() + " " + stackTrace.GetFrame(2).GetMethod().Name + " " + ", count: " + CollidingSegments.Count); CollidingSegments.Clear(); foreach (int segment in NetUtil.SegmentsFromMask(___m_collidingSegments1)) { CollidingSegments.Add((ushort)segment); } CollidingSegmentsCache2 = CollidingSegments.ToArray(); } Redirector <ToolControllerDetour> .Revert(); targetInstance.EndColliding(); Redirector <ToolControllerDetour> .Deploy(); //UnityEngine.Debug.Log("EndColliding: " + CollidingSegmentsCache2.Length); }