public override void EnterMovement(AvatarController avatar) { acceleration = Vector2.zero; }
public override void UpdateMovement(AvatarController avatar) { var targetVelocity = new Vector2(avatar.velocity.x, avatar.velocity.y - downDragOverY.Evaluate(avatar.transform.position.y)); avatar.velocity = Vector2.SmoothDamp(avatar.velocity, targetVelocity, ref acceleration, duration); }
public abstract void UpdateMovement(AvatarController avatar);
public override void UpdateMovement(AvatarController avatar) { }
public abstract void EnterMovement(AvatarController avatar);
public override void EnterMovement(AvatarController avatar) { avatar.velocity += Physics2D.gravity * Time.deltaTime * multiplier; }
void Awake() { OnValidate(); isAlive = true; instance = this; }
public override void UpdateMovement(AvatarController avatar) { avatar.velocity = Vector2.SmoothDamp(avatar.velocity, new Vector2(avatar.facingMultiplier * targetVelocity.x, targetVelocity.y), ref acceleration, duration); }
void Start() { attachedAvatar = FindObjectOfType <AvatarController>(); }