コード例 #1
0
        /// <summary>
        /// On init we grab all the components we'll need
        /// </summary>
        protected override void Initialization()
        {
            // we get the CorgiController2D component
            _controller   = this.gameObject.GetComponent <CorgiController>();
            _character    = this.gameObject.GetComponent <Character>();
            _characterFly = this.gameObject.GetComponent <CharacterFly>();
            _health       = this.gameObject.GetComponent <Health>();
            // initialize the start position
            _startPosition = transform.position;
            // initialize the direction
            _direction = _character.IsFacingRight ? Vector2.right : Vector2.left;

            _initialPosition  = this.transform.position;
            _initialDirection = _direction;
            _initialScale     = transform.localScale;
        }
コード例 #2
0
        /// <summary>
        /// On init we grab all the components we'll need
        /// </summary>
        protected override void Initialization()
        {
            // we get the CorgiController2D component
            _controller   = this.gameObject.GetComponentInParent <CorgiController>();
            _character    = this.gameObject.GetComponentInParent <Character>();
            _characterFly = _character?.FindAbility <CharacterFly>();
            _health       = this.gameObject.GetComponentInParent <Health>();
            _mmPath       = this.gameObject.GetComponent <MMPath>();
            // initialize the start position
            _startPosition = transform.position;
            // initialize the direction
            _direction = _character.IsFacingRight ? Vector2.right : Vector2.left;

            _initialPosition      = this.transform.position;
            _initialDirection     = _direction;
            _initialScale         = transform.localScale;
            _mmPathPointLastFrame = _mmPath.CurrentPoint();
            _mmPathIndexLastFrame = _mmPath.CurrentIndex();
        }
コード例 #3
0
 /// <summary>
 /// On init we grab our CharacterFly ability
 /// </summary>
 protected override void Initialization()
 {
     _characterFly = this.gameObject.GetComponent <CharacterFly>();
 }
コード例 #4
0
 /// <summary>
 /// On Start(), we set our tunnel flag to false
 /// </summary>
 protected override void Initialization()
 {
     base.Initialization();
     _model        = _character.CharacterModel;
     _characterFly = this.gameObject.GetComponentNoAlloc <CharacterFly>();
 }
コード例 #5
0
 /// <summary>
 /// On init we grab our CharacterFly ability
 /// </summary>
 protected override void Initialization()
 {
     _characterFly = this.gameObject.GetComponent <CharacterFly>();
     anim          = this.gameObject.GetComponent <Animator>();
     box           = this.gameObject.GetComponent <BoxCollider2D>();
 }
コード例 #6
0
 /// <summary>
 /// On init we grab our CharacterHandleWeapon ability
 /// </summary>
 protected override void Initialization()
 {
     beamAnim     = Beam.GetComponent <Animator>();
     characterFly = this.gameObject.GetComponent <CharacterFly>();
     beamDecision = this.gameObject.GetComponent <AIDecisionFireBeam>();
 }
コード例 #7
0
 /// <summary>
 /// On init we grab our CharacterFly ability
 /// </summary>
 protected override void Initialization()
 {
     _characterFly = this.gameObject.GetComponentInParent <Character>()?.FindAbility <CharacterFly>();
 }