Example #1
0
 public ChaseState(GameObject owner)
 {
     ownerGameObject = owner;
     ownerController = owner.GetComponent <EnemyStateMachine>();
     ownerRigidbody  = ownerGameObject.GetComponent <Rigidbody2D>();
     grounder        = ownerGameObject.GetComponent <GrounderEnemy>();
     wallCheck       = ownerGameObject.GetComponent <WallChecker>();
     targeting       = ownerGameObject.GetComponent <Targeting>();
     movingSpeed     = ownerController.EnemyParameters.MovingSpeed;
 }
Example #2
0
        // Group: Functions

        /* Constructor: MoveState
         * Initialize this state.
         * Parameters:
         * owner - GameObject of the enemy controling this state.
         * controller - <EnemyController> or a function that inherits of the enemy controling this state.
         */

        public MoveState(GameObject gameObject)
        {
            ownerGameObject      = gameObject;
            ownerController      = gameObject.GetComponent <EnemyStateMachine>();
            ownerRigidbody       = ownerGameObject.GetComponent <Rigidbody2D>();
            grounder             = ownerGameObject.GetComponent <GrounderEnemy>();
            wallCheck            = ownerGameObject.GetComponent <WallChecker>();
            minTimeBetweenIddles = ownerController.EnemyParameters.MinTimeBetweenIddles;
            maxTimeBetweenIddles = ownerController.EnemyParameters.MaxTimeBetweenIddles;
            movingSpeed          = ownerController.EnemyParameters.MovingSpeed;
        }