Exemple #1
0
        public void OnSearchTrackComplete(
            SearchTrackManager searchTrackManager)
        {
            searchTrackManager.OnSearchTrackComplete -= OnSearchTrackComplete;

            foreach (var guard in _allSquadMembers)
            {
                // old implementation reliant on searchmode behaviours
                // neds to be remade
                // guard.GetComponent<SearchModeBehaviour>()
                //                 .EndSearchParticipation();
            }

            _currentSearchTrackIndex++;

            if (_currentSearchTrackIndex >= _searchTracks.Count)
            {
                ExitPoint exit = UnityEngine.Object
                                 .FindObjectOfType <ExitPoint>();

                // todo: move logic for initexit etc. to SquadMember
                // _allSquadMembers.ForEach(
                //  (squadBehaviour) => squadBehaviour.InitExit(exit)
                // );
                OnSquadClearingComplete?.Invoke();
            }
            else
            {
                TakeNextSearchTrack();
            }
        }
Exemple #2
0
        public void LeaderPositionReached()
        {
            SearchTrack searchTrack = _searchTracks[_currentSearchTrackIndex];

            _searchTrackManager = _searchTrackManagerFactory.Create(
                searchTrack,
                _allSquadMembers.Map(
                    (guard) => guard.GetComponent <GuardStateBrainPBT>()
                    ),
                null
                );

            _searchTrackManager.OnSearchTrackComplete += OnSearchTrackComplete;
        }