public void CallExorcist(SpookItem targetItem) { if (!exorcistAtHome && Random.Range(1, 101) < ExorcistChance) { SpawnExorcist(targetItem); } }
void Update() { if (targetItem != null) { if (targetItem.GhostIsInRange) { targetItem.Activate(); targetItem = null; } } }
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(); }
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); }
private void MoveToPoint(Vector3 target, SpookItem targetItem) { ControlledNavigator.MoveTo(target, targetItem); MoveMarker.DisplayMarker(target); }
private bool IsInRange(SpookItem item) => item.GhostIsInRange;
private bool IsItem(SpookItem item) => item != null;
public void MoveTo(Vector3 targetPosition, SpookItem targetItem) { this.targetItem = targetItem; Agent.SetDestination(targetPosition); }
public void MoveTo(Vector3 targetPosition) { targetItem = null; Agent.SetDestination(targetPosition); }