Beispiel #1
0
 /// <summary>
 /// On Start we grab our components
 /// </summary>
 protected override void Initialization()
 {
     base.Initialization();
     _characterJump     = this.gameObject.MMGetComponentNoAlloc <CharacterJump>();
     _characterWallJump = this.gameObject.MMGetComponentNoAlloc <CharacterWalljump>();
     _characterSwim     = this.gameObject.MMGetComponentNoAlloc <CharacterSwim>();
 }
 /// <summary>
 /// On Start we grab our components
 /// </summary>
 protected override void Initialization()
 {
     base.Initialization();
     _characterJump     = _character?.FindAbility <CharacterJump>();
     _characterWallJump = _character?.FindAbility <CharacterWalljump>();
     _characterSwim     = _character?.FindAbility <CharacterSwim>();
 }
 /// <summary>
 /// Triggered when something exits the water
 /// </summary>
 /// <param name="collider">Something colliding with the water.</param>
 protected virtual void OnTriggerExit2D(Collider2D collider)
 {
     // we check that the object colliding with the water is actually a corgi controller and a character
     _characterSwim = collider.gameObject.MMGetComponentNoAlloc <Character>()?.FindAbility <CharacterSwim>();
     if (_characterSwim != null)
     {
         _characterSwim.ExitWater();
     }
 }