Esempio n. 1
0
        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
        }
Esempio n. 2
0
        // 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>();
        }
Esempio n. 3
0
        // 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;
        }
Esempio n. 4
0
 // pass the controller to the base class
 public DieState(StateController controller)
     : base(controller)
 {
 }