Ejemplo n.º 1
0
        private void Awake()
        {
            _roomConstructor = GetComponentInChildren <RoomConstructor>();

            _pathFinding = GetComponent <PathFinding>();
            _roomGrid    = GetComponent <RoomGrid>();
            _pathFinding = GetComponent <PathFinding>();
        }
Ejemplo n.º 2
0
        public static void RequestPath(Vector3 _start, Vector3 _end, Grid _grid, PathFinding _pathFinding, Action <Vector3[], bool> _callback)
        {
            var newRequest = new PathRequest(_start, _end, _grid, _pathFinding, _callback);

            instance.pathRequestQueue.Enqueue(newRequest);
            count++;
            instance.TryProcessNext();
        }
Ejemplo n.º 3
0
 public PathRequest(Vector3 _start, Vector3 _end, Grid _grid, PathFinding _pathFinding, Action <Vector3[], bool> _callback)
 {
     pathStart   = _start;
     pathEnd     = _end;
     grid        = _grid;
     pathfinding = _pathFinding;
     callback    = _callback;
 }
Ejemplo n.º 4
0
        void Start()
        {
            if (pathFinding == null)
            {
                pathFinding = GetComponent <PathFinding>();
            }

            StartFindPath();
        }
Ejemplo n.º 5
0
        ///////////////////////////////// Maze PlayableZone////////////////////////////////////

        public void CreatePathFinder(Vector3 origin, Vector3 dest, Grid grid, PathFinding _pathFinding)
        {
            var pathFinder = GameObject.CreatePrimitive(PrimitiveType.Capsule);

            pathFinder.name = "seeker1";
            // pathFinder.transform.parent = pathFinders;
            pathFinder.transform.position = origin;

            var target = GameObject.CreatePrimitive(PrimitiveType.Capsule).transform;

            target.name = "target1";
            target.transform.position = dest;
            // target.transform.parent = pathFinders;
            var pathfindUnit = pathFinder.AddComponent <PathFindUnit>();

            pathfindUnit.target      = target;
            pathfindUnit.grid        = grid;
            pathfindUnit.pathFinding = _pathFinding;
        }