public override void OnToolUpdate()
        {
            if (NodeMarkupTool.MouseRayValid)
            {
                RaycastInput input = new RaycastInput(NodeMarkupTool.MouseRay, Camera.main.farClipPlane)
                {
                    m_ignoreTerrain      = true,
                    m_ignoreNodeFlags    = NetNode.Flags.None,
                    m_ignoreSegmentFlags = JustFun ? NetSegment.Flags.None : NetSegment.Flags.All
                };
                input.m_netService.m_itemLayers = (ItemClass.Layer.Default | ItemClass.Layer.MetroTunnels);
                input.m_netService.m_service    = ItemClass.Service.Road;

                if (NodeMarkupTool.RayCast(input, out RaycastOutput output))
                {
                    HoverNodeId    = output.m_netNode;
                    HoverSegmentId = output.m_netSegment;
                    return;
                }
            }

            HoverNodeId    = 0;
            HoverSegmentId = 0;
        }
Example #2
0
        private bool GetRayCast(ItemClass.Service service, ItemClass.SubService subService = ItemClass.SubService.None)
        {
            RaycastInput input = new RaycastInput(NodeMarkupTool.MouseRay, Camera.main.farClipPlane)
            {
                m_ignoreTerrain      = true,
                m_ignoreNodeFlags    = InputExtension.OnlyShiftIsPressed ? NetNode.Flags.All : NetNode.Flags.None,
                m_ignoreSegmentFlags = NetSegment.Flags.None,
            };

            input.m_netService.m_itemLayers = (ItemClass.Layer.Default | ItemClass.Layer.MetroTunnels);
            input.m_netService.m_service    = service;
            input.m_netService.m_subService = subService;

            if (NodeMarkupTool.RayCast(input, out RaycastOutput output))
            {
                HoverNodeId    = output.m_netNode;
                HoverSegmentId = output.m_netSegment;
                return(true);
            }
            else
            {
                return(false);
            }
        }