Exemplo n.º 1
0
        public void DoStuff()
        {
            var go = graph.Value as FsmNavGraph;

            if (go.Value == null)
            {
                Finish();
                return;
            }

            g = FsmConverter.GetNavGraph(graph);

            if (!drawGizmos.IsNone)
            {
                g.drawGizmos = drawGizmos.Value;
            }

            if (!infoScreenOpen.IsNone)
            {
                g.infoScreenOpen = infoScreenOpen.Value;
            }

            if (!initialPenalty.IsNone)
            {
                g.initialPenalty = (uint)initialPenalty.Value;
            }

            if (!name.IsNone)
            {
                g.name = name.Value;
            }

            if (!nodes.IsNone)
            {
                g.nodes = FsmConverter.NodeArrayFromList((nodes.Value as FsmNodes).Value);
            }

            if (!open.IsNone)
            {
                g.open = open.Value;
            }

            if (graphType == GraphType.pointGraph && g as PointGraph != null)
            {
                if (!autoLinkNodes.IsNone)
                {
                    (g as PointGraph).autoLinkNodes = autoLinkNodes.Value;
                }

                if (!limits.IsNone)
                {
                    (g as PointGraph).limits = limits.Value;
                }

                if (!mask.IsNone)
                {
                    (g as PointGraph).mask = mask.Value;
                }

                if (!maxDistance.IsNone)
                {
                    (g as PointGraph).maxDistance = maxDistance.Value;
                }

                if (!raycast.IsNone)
                {
                    (g as PointGraph).raycast = raycast.Value;
                }

                if (!recursive.IsNone)
                {
                    (g as PointGraph).recursive = recursive.Value;
                }

                if (!searchTag.IsNone)
                {
                    (g as PointGraph).searchTag = searchTag.Value;
                }

                if (!thickRaycast.IsNone)
                {
                    (g as PointGraph).thickRaycast = thickRaycast.Value;
                }

                if (!thickRaycastRadius.IsNone)
                {
                    (g as PointGraph).thickRaycastRadius = thickRaycastRadius.Value;
                }
            }

            if (graphType == GraphType.gridGraph && g as GridGraph != null)
            {
                if (!getNearestForceOverlap.IsNone)
                {
                    (g as GridGraph).getNearestForceOverlap = getNearestForceOverlap.Value;
                }

                if (!scans.IsNone)
                {
                    (g as GridGraph).scans = scans.Value;
                }

                if (!size.IsNone)
                {
                    (g as GridGraph).size = size.Value;
                }
            }
        }