Beispiel #1
0
 public void CallExorcist(SpookItem targetItem)
 {
     if (!exorcistAtHome && Random.Range(1, 101) < ExorcistChance)
     {
         SpawnExorcist(targetItem);
     }
 }
Beispiel #2
0
 void Update()
 {
     if (targetItem != null)
     {
         if (targetItem.GhostIsInRange)
         {
             targetItem.Activate();
             targetItem = null;
         }
     }
 }
Beispiel #3
0
        public void Initialize(TransformRepository navigationSpots, Transform outside, SpookItem targetItem, Action exitCallback)
        {
            this.exitCallback    = exitCallback;
            this.navigationSpots = navigationSpots;
            this.outside         = outside;
            this.targetItem      = targetItem;
            currentSpookPoints   = InitialSpookPoints;

            GoToTarget();

            ArriveSfx.Play();
        }
Beispiel #4
0
        private void SpawnExorcist(SpookItem targetItem)
        {
            exorcistAtHome = true;
            if (exorcist == null)
            {
                exorcist = Instantiate(ExorcistPrefab, NPCContainer);
                exorcist.transform.position = InvaderSpawnPoint.position;
                ActorRepository.AddNPC(exorcist);
            }

            exorcist.gameObject.SetActive(true);
            exorcist.Initialize(NavigationPoints, InvaderSpawnPoint, targetItem, ExorcistLeaves);
        }
Beispiel #5
0
 private void MoveToPoint(Vector3 target, SpookItem targetItem)
 {
     ControlledNavigator.MoveTo(target, targetItem);
     MoveMarker.DisplayMarker(target);
 }
Beispiel #6
0
 private bool IsInRange(SpookItem item) => item.GhostIsInRange;
Beispiel #7
0
 private bool IsItem(SpookItem item) => item != null;
Beispiel #8
0
 public void MoveTo(Vector3 targetPosition, SpookItem targetItem)
 {
     this.targetItem = targetItem;
     Agent.SetDestination(targetPosition);
 }
Beispiel #9
0
 public void MoveTo(Vector3 targetPosition)
 {
     targetItem = null;
     Agent.SetDestination(targetPosition);
 }