示例#1
0
        public override bool PlaceAgentInCell(GridAgentBase agent, uint cellId)
        {
            GridNode cell = GetNode(cellId) as GridNode;

            if (cell != null && cell.GetAgent() == null)
            {
                agent.cell = cellId;
                agent.transform.localPosition = GetCellPos(new GridCoords(agent.cell));
                cell.SetAgent(agent);
                return(true);
            }
            return(false);
        }
示例#2
0
 public bool SetAgent(GridAgentBase agent)
 {
     Agent = agent as GridAgentAbstract <GridCoords>;
     return(Agent != null);
 }