Пример #1
0
 //
 public void RequestPath(Node _StartNode, Node _TargetNode, MovementCommand _MovCom)
 {
     if (CurrentPathStatus == PathRequestStatus.NoneRequested)
     {
         CurrentPathStatus = PathRequestStatus.RequestedAndWaiting;
         PathFinderManager.Instance.RequestPathFromNodes(_StartNode, _TargetNode, _MovCom);
     }
 }
Пример #2
0
        //
        public void RequestPathFromVec3s(Vector3 _CurrentPos, Vector3 _TargetPos, MovementCommand _Requestee)
        {
            Node StartingNode = NM.FindNodeFromWorldPosition(_CurrentPos);
            Node TargetNode   = NM.FindNodeFromWorldPosition(_TargetPos);

            PathRequest PR = new PathRequest(StartingNode, TargetNode, _Requestee);

            PathRequests.Enqueue(PR);
        }
Пример #3
0
 public PathRequest(Node _StartingNode, Node _TargetNode, MovementCommand _Requestee)
 {
     StartingNode     = _StartingNode;
     TargetNode       = _TargetNode;
     Requestee        = _Requestee;
     PathIsFound      = false;
     IsBeingProcessed = false;
     CompletedPath    = null;
 }
Пример #4
0
        //This should be queued to be handled when ready to rather than a immediate method call
        public void RequestRandomPathFromVec3(Vector3 _CurrentPos, MovementCommand _Requestee)
        {
            Node StartingNode = NM.FindNodeFromWorldPosition(_CurrentPos);
            Node TargetNode   = NM.GetRandNode();

            int RandAttempts = 0;

            if (TargetNode == null)
            {
                while (TargetNode == null)
                {
                    ++RandAttempts;
                    TargetNode = NM.GetRandNode();
                    if (RandAttempts > 20)
                    {
                        break;
                    }
                }
            }

            PathRequest PR = new PathRequest(StartingNode, TargetNode, _Requestee);

            PathRequests.Enqueue(PR);
        }
Пример #5
0
        //TODO: When giving commands to a GCM that already has a movment command, Get it to clearup to current order then enstate new.... Also having a seperate Gameobject to house orders to avoid clutter
        public void IssueMovementCommand(GunCrewMember _GCM, Node _TargetNode)
        {
            MovementCommand NewMC = _GCM.gameObject.AddComponent <MovementCommand>();

            NewMC.PassInfo(_GCM, _TargetNode);
        }
Пример #6
0
        //This should be queued to be handled when ready to rather than a immediate method call
        public void RequestPathFromNodes(Node _StartingNode, Node _TargetNode, MovementCommand _Requestee)
        {
            PathRequest PR = new PathRequest(_StartingNode, _TargetNode, _Requestee);

            PathRequests.Enqueue(PR);
        }