Esempio n. 1
0
 /// <summary>
 /// On exit we stop force crouching
 /// </summary>
 /// <param name="collider"></param>
 protected virtual void OnTriggerExit(Collider collider)
 {
     _characterCrouch = collider.gameObject.MMGetComponentNoAlloc <Character>()?.FindAbility <CharacterCrouch>();
     if (_characterCrouch != null)
     {
         _characterCrouch.StopForcedCrouch();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// On enter we force crouch if we can
 /// </summary>
 /// <param name="collider"></param>
 protected virtual void OnTriggerEnter(Collider collider)
 {
     _characterCrouch = collider.gameObject.MMGetComponentNoAlloc <CharacterCrouch>();
     if (_characterCrouch != null)
     {
         _characterCrouch.StartForcedCrouch();
     }
 }
 /// <summary>
 /// Grabs dependencies
 /// </summary>
 protected override void Initialization()
 {
     _character       = this.gameObject.GetComponent <Character>();
     _characterCrouch = this.gameObject.GetComponent <CharacterCrouch>();
 }
Esempio n. 4
0
 /// <summary>
 /// Grabs dependencies
 /// </summary>
 protected override void Initialization()
 {
     _character       = this.gameObject.GetComponentInParent <Character>();
     _characterCrouch = _character?.FindAbility <CharacterCrouch>();
 }