camera_system #5

Merged
Jeonghyeon merged 18 commits from camera_system into develop 2025-07-14 07:10:06 +00:00
5 changed files with 31 additions and 8 deletions
Showing only changes of commit 5065d1a738 - Show all commits

View File

@ -17,7 +17,7 @@ public async void PostInit()
{ {
try try
{ {
ItemDataSo = await AssetManager.LoadAsset<ItemDataSo>("ItemDataSo"); ItemDataSo = await AssetManager.LoadAsset<ItemDataSo>(DataConstants.ItemDataSo);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -12,10 +12,10 @@ private async void Start()
{ {
try try
{ {
var playerPrefab = await AssetManager.LoadAsset<GameObject>("RestaurantPlayer"); var playerPrefab = await AssetManager.LoadAsset<GameObject>(CommonConstants.RestaurantPlayer);

리터럴 스트링 제거할 방법이 있을까요?

리터럴 스트링 제거할 방법이 있을까요?
var player = Instantiate(playerPrefab, _spawnPosition, playerPrefab.transform.rotation); var player = Instantiate(playerPrefab, _spawnPosition, playerPrefab.transform.rotation);
player.name = "RestaurantPlayer"; player.name = CommonConstants.RestaurantPlayer;
CameraManager.Instance.GetCameraGameObject("RestaurantBaseCamera").SetFollowAndLookAtTarget(player.transform); CameraManager.Instance.GetCameraGameObject(CameraType.RestaurantBaseCamera).SetFollowAndLookAtTarget(player.transform);

여기도 리터럴 스트링 제거하고 레퍼런스 기반으로 작업할 방법이 있을까요?

여기도 리터럴 스트링 제거하고 레퍼런스 기반으로 작업할 방법이 있을까요?
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -24,14 +24,14 @@ private void Awake()
{ {
_rigidbody = GetComponent<Rigidbody>(); _rigidbody = GetComponent<Rigidbody>();
_animation = GetComponent<RestaurantCharacterAnimation>(); _animation = GetComponent<RestaurantCharacterAnimation>();
_visualLook = transform.Find("VisualLook"); _visualLook = transform.Find(CommonConstants.VisualLook);

리터럴 제거 바랍니다. 다른 방식으로 얻을 수 없을까요?

리터럴 제거 바랍니다. 다른 방식으로 얻을 수 없을까요?
} }
private async void Start() private async void Start()
{ {
try try
{ {
_playerData = await AssetManager.LoadAsset<RestaurantPlayerDataSo>("RestaurantPlayerDataSo"); _playerData = await AssetManager.LoadAsset<RestaurantPlayerDataSo>(DataConstants.RestaurantPlayerDataSo);

리터럴 제거

리터럴 제거
_playerData.MoveActionReference.action.performed += OnMove; _playerData.MoveActionReference.action.performed += OnMove;
_playerData.MoveActionReference.action.canceled += OnMove; _playerData.MoveActionReference.action.canceled += OnMove;
@ -107,7 +107,7 @@ private void Move()
SetCurrentDirection(_inputDirection); SetCurrentDirection(_inputDirection);
_isMoving = _inputDirection != Vector3.zero; _isMoving = _inputDirection != Vector3.zero;
string animationName = _isMoving ? "RunFast" : "Idle"; string animationName = _isMoving ? RestaurantPlayerAnimation.Walk : RestaurantPlayerAnimation.Idle;

애니메이션 재생 역시 무브먼트의 소관이 아님.
애니메이션 컴포넌트로 이동해야할듯합니다.

애니메이션 재생 역시 무브먼트의 소관이 아님. 애니메이션 컴포넌트로 이동해야할듯합니다.
_animation.PlayAnimation(animationName, true); _animation.PlayAnimation(animationName, true);
Vector3 finalVelocity = _inputDirection * _playerData.MoveSpeed; Vector3 finalVelocity = _inputDirection * _playerData.MoveSpeed;
@ -134,7 +134,7 @@ private IEnumerator DashCoroutine()
_isDashing = true; _isDashing = true;
_isDashCooldown = true; _isDashCooldown = true;
_animation.PlayAnimationDuration("Dash", false, _playerData.DashTime); _animation.PlayAnimationDuration(RestaurantPlayerAnimation.Dash, false, _playerData.DashTime);

애니메이션 제거. OnDashStarted나 IsDashing 등으로 처리할 것.

애니메이션 제거. OnDashStarted나 IsDashing 등으로 처리할 것.
Vector3 dashVelocity = _currentDirection.normalized * _playerData.DashSpeed; Vector3 dashVelocity = _currentDirection.normalized * _playerData.DashSpeed;
_rigidbody.linearVelocity = dashVelocity; _rigidbody.linearVelocity = dashVelocity;

View File

@ -0,0 +1,21 @@
namespace DDD
{
public static class CommonConstants
{
public const string VisualLook = "VisualLook";
public const string RestaurantPlayer = "RestaurantPlayer";
}
public static class DataConstants
{
public const string ItemDataSo = "ItemDataSo";
public const string RestaurantPlayerDataSo = "RestaurantPlayerDataSo";
}
public static class RestaurantPlayerAnimation
{
public const string Idle = "Idle";
public const string Walk = "RunFast";
public const string Dash = "Dash";
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6e8cf38ab843c9e40a94a26ba7102dc4