public AIStateAttack(ArtificialIntelligence brains) : base(brains) { State = EAIState.Attack; _guardBrains = (GuardBrains)brains; _guardBrains.RanAway += GuardBrainsOnRanAway; DeathController.Death += OnDeath; }
public AIStateAlert(ArtificialIntelligence brains, float searchDistance, float alertTime) : base(brains) { _searchDistance = searchDistance; _alertTime = alertTime; State = EAIState.Alert; _timeInState = alertTime; _guardBrains = (GuardBrains)brains; _guardBrains.Spotted += GuardBrainsOnSpotted; _player = GameObject.FindObjectOfType <Core.Characters.Player.PlayerBehaviour>(); }
public AIStateWandering(ArtificialIntelligence brains, float searchDistance, Transform pathRoot, Image suspentionBar) : base(brains) { _searchDistance = searchDistance; State = EAIState.Wandering; _movementController = new SequentialMovement(pathRoot.GetComponentsInChildren <Transform>(), _masterBrain.MovableObject, true); _bellCreepy = Resources.Load <AudioClip>("Sounds/bellCreepy"); _whispering = Resources.Load <AudioClip>("Sounds/whisper"); _effect = GameObject.FindObjectOfType <NoiseEffect>(); _player = GameObject.FindObjectOfType <PlayerBehaviour>(); _suspentionBar = suspentionBar; _guardBrains = (GuardBrains)brains; }