示例#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
        }
示例#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>();
        }
示例#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;
        }
示例#4
0
 // pass the controller to the base class
 public DieState(StateController controller)
     : base(controller)
 {
 }