public AIStateAlert(ArtificialIntelligence brains, float searchDistance, float alertTime) : base(brains) { _searchDistance = searchDistance; _alertTime = alertTime; State = EAIState.Alert; _timeInState = alertTime; _player = GameObject.FindObjectOfType <Core.Characters.Player.PlayerBehaviour>(); }
public override void OnEnter() { base.OnEnter(); PlayerQuirks.Attacked = true; var _guardBrains = (GuardBrains)_masterBrain; _masterBrain.StatusText.text = _guardBrains.AttackStrings[Random.Range(0, _guardBrains.WanderingStrings.Length)]; _sound = ((GuardBrains)_masterBrain).AngerSound; AudioSource.PlayClipAtPoint(_sound, _masterBrain.transform.position, 1f); _player = PlayerBehaviour.CurrentPlayer; _player.GetComponent <StressAffector>().DemandTickTime *= 0.8f; }
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; }
private void OnEnable() { _player = this; }
private void OnEnable() { _animator = GetComponentInChildren <AnimateSpriteSheet>(); _player = this; }