This commit is contained in:
SoulliesOfficial
2025-12-17 04:19:38 -05:00
parent 7c1cb7e8e1
commit d15957c719
4315 changed files with 8260710 additions and 2940 deletions

View File

@@ -48,6 +48,32 @@ namespace Cielonos.MainGame.Characters
{
characterTransform.DOLookAt(target.transform.position, duration, AxisConstraint.Y);
}
public void TurnToDirection(Vector3 direction, float duration = 0f)
{
Vector3 dashRotation = Vector3.zero;
float angle = Vector3.SignedAngle(Vector3.forward, direction, Vector3.up);
if (owner is Player player)
{
dashRotation.y = player.viewSc.isLockedOn
? player.viewSc.cameraRotationSm.cinemachineEndLockYaw + angle
: player.viewSc.cameraRotationSm.cinemachineTargetYaw + angle;
}
else
{
dashRotation = new Vector3(0, angle, 0);
}
if (duration > 0)
{
characterTransform.DORotateQuaternion(Quaternion.Euler(dashRotation), duration);
}
else
{
characterTransform.rotation = Quaternion.Euler(dashRotation);
}
}
}
public partial class MovementSubcontrollerBase