Beispiel #1
0
        /// <summary>
        /// Override this to send parameters to the character's animator. This is called once per cycle, by the Character
        /// class, after Early, normal and Late process().
        /// </summary>
        public override void UpdateAnimator()
        {
            if (CurrentWeapon == null)
            {
                return;
            }

            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.IdleAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponIdle), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.StartAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponStart), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.DelayBeforeUseAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponDelayBeforeUse), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.UseAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponDelayBeforeUse || CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponUse || CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponDelayBetweenUses), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.SingleUseAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponUse), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.DelayBetweenUsesAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponDelayBetweenUses), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.StopAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponStop), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.ReloadStartAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponReloadStart), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.ReloadAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponReload), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, CurrentWeapon.ReloadStopAnimationParameter, (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponReloadStop), _character._animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "Attack2", (CurrentWeapon.WeaponState.CurrentState == Weapon.WeaponStates.WeaponReloadStop), _character._animatorParameters);

            if (_aimableWeapon != null)
            {
                InfAnimator.UpdateAnimatorFloat(_animator, CurrentWeapon.WeaponAngleAnimationParameter, _aimableWeapon.CurrentAngle, _character._animatorParameters);
                InfAnimator.UpdateAnimatorFloat(_animator, CurrentWeapon.WeaponAngleRelativeAnimationParameter, _aimableWeapon.CurrentAngleRelative, _character._animatorParameters);
            }
            else
            {
                InfAnimator.UpdateAnimatorFloat(_animator, CurrentWeapon.WeaponAngleAnimationParameter, 0f, _character._animatorParameters);
                InfAnimator.UpdateAnimatorFloat(_animator, CurrentWeapon.WeaponAngleRelativeAnimationParameter, 0f, _character._animatorParameters);
            }
        }
Beispiel #2
0
 /// <summary>
 /// At the end of each cycle, sends Jumping states to the Character's animator
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Jumping", (_movement.CurrentState == CharacterStates.MovementStates.Jumping), _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "DoubleJumping", _doubleJumping, _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "HitTheGround", _controller.State.JustGotGrounded, _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "JumpAnticipation", _movement.CurrentState == CharacterStates.MovementStates.JumpAnticipation, _character._animatorParameters);
 }
Beispiel #3
0
    /// <summary>
    /// This is called at Update() and sets each of the animators parameters to their corresponding State values
    /// </summary>
    protected virtual void UpdateAnimators()
    {
        if ((UseDefaultMecanim) && (_animator != null))
        {
            InfAnimator.UpdateAnimatorBool(_animator, "Grounded", _controller.State.IsGrounded, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "Alive", (ConditionState.CurrentState != CharacterStates.CharacterConditions.Dead), _animatorParameters);
            InfAnimator.UpdateAnimatorFloat(_animator, "xSpeed", _controller.Speed.x, _animatorParameters);
            InfAnimator.UpdateAnimatorFloat(_animator, "xAbsSpeed", Mathf.Abs(_controller.Speed.x), _animatorParameters);
            InfAnimator.UpdateAnimatorFloat(_animator, "ySpeed", _controller.Speed.y, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "CollidingLeft", _controller.State.IsCollidingLeft, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "CollidingRight", _controller.State.IsCollidingRight, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "CollidingBelow", _controller.State.IsCollidingBelow, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "CollidingAbove", _controller.State.IsCollidingAbove, _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "Idle", (MovementState.CurrentState == CharacterStates.MovementStates.Idle), _animatorParameters);
            InfAnimator.UpdateAnimatorBool(_animator, "FacingRight", IsFacingRight, _animatorParameters);

            foreach (CharacterAbility ability in _characterAbilities)
            {
                if (ability.enabled && ability.AbilityInitialized)
                {
                    ability.UpdateAnimator();
                }
            }
        }
    }
Beispiel #4
0
        public override void UpdateAnimator()
        {
            bool thisCharged = false;

            if (ChargedAmount > 0.0f)
            {
                thisCharged = true;
            }

            InfAnimator.UpdateAnimatorBool(_animator, "FireMagicCharging", Mana.Charging && thisCharged, _character._animatorParameters);
        }
Beispiel #5
0
 /// <summary>
 /// At the end of each cycle, sends Jumping states to the Character's animator
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Blocking", _hp.isBlocking, _character._animatorParameters);
 }
Beispiel #6
0
 /// <summary>
 /// Override this to send parameters to the character's animator. This is called once per cycle, by the Character
 /// class, after Early, normal and Late process().
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Attacking", attacking, _character._animatorParameters);
 }
Beispiel #7
0
 /// <summary>
 /// At the end of each cycle, we update our animator with our various states
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "LadderClimbing", (_movement.CurrentState == CharacterStates.MovementStates.LadderClimbing), _character._animatorParameters);
     InfAnimator.UpdateAnimatorFloat(_animator, "LadderClimbingSpeedX", CurrentLadderClimbingSpeed.x, _character._animatorParameters);
     InfAnimator.UpdateAnimatorFloat(_animator, "LadderClimbingSpeedY", CurrentLadderClimbingSpeed.y, _character._animatorParameters);
 }
Beispiel #8
0
 /// <summary>
 /// At the end of each cycle, sends Jumping states to the Character's animator
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Shapeshift", this.PardusMode);
     InfAnimator.UpdateAnimatorBool(_animator, "Transforming", this.isTransformingNow);
 }
Beispiel #9
0
 public void JumpAnticipationReset()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "JumpAnticipation", false, _character._animatorParameters);
 }
Beispiel #10
0
 public void StoppedCast()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Casting", false, _character._animatorParameters);
 }
Beispiel #11
0
 public void Decharge()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Casting", true, _character._animatorParameters);
 }
Beispiel #12
0
 /// <summary>
 /// At the end of each cycle, sends Jumping states to the Character's animator
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "Charging", Mana.Charging, _character._animatorParameters);
 }
Beispiel #13
0
 /// <summary>
 /// Sends the current speed and the current value of the Walking state to the animator
 /// </summary>
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorFloat(_animator, "Speed", _horizontalMovement, _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "Walking", (_movement.CurrentState == CharacterStates.MovementStates.Walking), _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "Running", (_movement.CurrentState == CharacterStates.MovementStates.Running), _character._animatorParameters);
 }
Beispiel #14
0
 public override void UpdateAnimator()
 {
     InfAnimator.UpdateAnimatorBool(_animator, "WallClimbing", isClimbing, _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "NearWall", isNearWall, _character._animatorParameters);
     InfAnimator.UpdateAnimatorBool(_animator, "FinishingClimbing", (_movement.CurrentState == CharacterStates.MovementStates.pWallClimbFinish), _character._animatorParameters);
 }