예제 #1
0
        public virtual void ChangeMovableConfig(CharacterMotor motor, MovableCondition prevCondition = null)
        {
            motor.canControl     = canControl;
            motor.useFixedUpdate = useFixedUpdate;

            motor.movement.maxForwardSpeed   = movement.maxForwardSpeed;
            motor.movement.maxSidewaysSpeed  = movement.maxSidewaysSpeed;
            motor.movement.maxBackwardsSpeed = movement.maxBackwardsSpeed;

            motor.movement.slopeSpeedMultiplier = movement.slopeSpeedMultiplier;

            motor.movement.maxGroundAcceleration = movement.maxGroundAcceleration;
            motor.movement.maxAirAcceleration    = movement.maxAirAcceleration;

            motor.movement.gravity      = movement.gravity;
            motor.movement.maxFallSpeed = movement.maxFallSpeed;
            motor.movement.maxRiseSpeed = movement.maxRiseSpeed;

            motor.jumping.enabled         = jumping.enabled;
            motor.jumping.baseHeight      = jumping.baseHeight;
            motor.jumping.extraHeight     = jumping.extraHeight;
            motor.jumping.perpAmount      = jumping.perpAmount;
            motor.jumping.steepPerpAmount = jumping.steepPerpAmount;

            motor.movingPlatform.enabled          = movingPlatform.enabled;
            motor.movingPlatform.movementTransfer = movingPlatform.movementTransfer;

            motor.sliding.enabled         = sliding.enabled;
            motor.sliding.slidingSpeed    = sliding.slidingSpeed;
            motor.sliding.sidewaysControl = sliding.sidewaysControl;
            motor.sliding.speedControl    = sliding.speedControl;
        }
예제 #2
0
 public void RegisterMovableCondition(MovableCondition movableCondition)
 {
     if (!_map.ContainsKey(movableCondition.movableConditionType))
     {
         movableCondition.SetMovableController(this);
         _map.Add(movableCondition.movableConditionType, movableCondition);
     }
 }
예제 #3
0
 public override void ChangeMovableConfig(CharacterMotor motor, MovableCondition prevCondition = null)
 {
     if (prevCondition != null && prevCondition.movableConditionType == MovableConditionType.Water)
     {
         motor.movement.velocity.y = WaterSwitchGroundSpeed;
     }
     base.ChangeMovableConfig(motor, prevCondition);
 }
예제 #4
0
 public void ChangeMovableCondition(MovableConditionType type)
 {
     if (_curMovableCondition == null || _curMovableCondition.movableConditionType != type)
     {
         if (_curMovableCondition != null)
         {
             _curMovableCondition.Reset();
         }
         MovableCondition prevCondition = _curMovableCondition;
         _curMovableCondition = GetMovableCondition(type);
         _curMovableCondition.ChangeMovableConfig(_motor, prevCondition);
     }
 }