private Transform trans; // trans of the enemy so we can move it #endregion Fields #region Constructors // pass the controller to the base class public PatrolState(StateController controller) : base(controller) { // get the trans from the controller trans = GameObject.GetComponent<Transform>(); Enemy = GameObject.GetComponent<Enemy>(); PatrolPoints = new List<Transform>(); // instanciate the list }
// pass the controller to the base class public EngagedState(StateController controller) : base(controller) { // get the trans from the controller trans = GameObject.GetComponent<Transform>(); Enemy = GameObject.GetComponent<Enemy>(); // player stuff playerTrans = Services.Run.Player.Character.gameObject.GetComponent<Transform>(); }
// pass the controller to the base class public AttackState(StateController controller) : base(controller) { // get the trans from the controller trans = GameObject.GetComponent<Transform>(); Enemy = GameObject.GetComponent<Enemy>(); enemyAttackSound = GameObject.GetComponent<AudioSource>(); // player stuff playerTrans = Services.Run.Player.Character.gameObject.transform; }
// pass the controller to the base class public DieState(StateController controller) : base(controller) { }