protected override void OnEnable() { base.OnEnable(); stateConfig = (StateMotorConfig)target; }
public abstract void Move(IMovable user, ref Vector2 velocity, ref CollisionStatus collisionStatus, StateMotorMachine machine, StateMotorConfig config, LayerMask collisionMask);
public void Move(IMovable user, ref Vector2 velocity, ref CollisionStatus status, StateMotorConfig config, LayerMask collisionMask) { state.Move(user, ref velocity, ref status, this, config, collisionMask); }
public override void Move(IMovable user, ref Vector2 velocity, ref CollisionStatus collisionStatus, StateMotorMachine machine, StateMotorConfig config1, LayerMask collisionMask) { var config = user.GetMotorConfig <GroundMotorConfig>(); if (config == null) { UPMDebug.LogWarning("Expected GroundMotorConfig for GroundedState @ " + user); return; } ProcessInputs(user, config, ref velocity, ref collisionStatus); velocity.y += Gravity * config.GravityScale * Time.deltaTime; var max = user.MaxSpeed; velocity.x = Mathf.Clamp(velocity.x, -max, max); GroundedBehaviour.Check(user, ref velocity, ref collisionStatus, collisionMask); }