/// <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; }
/// <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(); }
/// <summary> /// On init we grab our CharacterFly ability /// </summary> protected override void Initialization() { _characterFly = this.gameObject.GetComponent <CharacterFly>(); }
/// <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>(); }
/// <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>(); }
/// <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>(); }
/// <summary> /// On init we grab our CharacterFly ability /// </summary> protected override void Initialization() { _characterFly = this.gameObject.GetComponentInParent <Character>()?.FindAbility <CharacterFly>(); }