private void check()
 {
     p.x = target.position.x;
     p.y = target.position.z;
     p   = p / K;
     if (inNode == null)
     {
         inNode = MapMeshGenerator.isIn(p);
     }
     else
     {
         if (!inNode.GetBoundingRectangle().Contains(p))
         {
             inNode = MapMeshGenerator.isIn(p);
             GameObject.Find("MapGenerator").SendMessage("changeCenter", inNode);
         }
     }
 }
Esempio n. 2
0
    private void addGrass(System.Object[] data)
    {
        MapGraph.MapNode node  = (MapGraph.MapNode)data[0];
        Vector3[]        roots = (Vector3[])data[1];

        if (node == null || roots.Length == 0 || nodeList.ContainsKey(node))
        {
            return;
        }

        int len          = roots.Length;
        var node_matrics = new Matrix4x4[len];
        var rec          = node.GetBoundingRectangle();



        for (int i = 0; i < roots.Length; i++)
        {
            var center = roots[i];
            madeGrass(node_matrics, center.x, center.y, center.z, i);
        }

        nodeList.Add(node, node_matrics);
    }