camera_system #5
@ -17,7 +17,7 @@ public async void PostInit()
|
||||
{
|
||||
try
|
||||
{
|
||||
ItemDataSo = await AssetManager.LoadAsset<ItemDataSo>("ItemDataSo");
|
||||
ItemDataSo = await AssetManager.LoadAsset<ItemDataSo>(DataConstants.ItemDataSo);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -12,10 +12,10 @@ private async void Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
var playerPrefab = await AssetManager.LoadAsset<GameObject>("RestaurantPlayer");
|
||||
var playerPrefab = await AssetManager.LoadAsset<GameObject>(CommonConstants.RestaurantPlayer);
|
||||
|
||||
var player = Instantiate(playerPrefab, _spawnPosition, playerPrefab.transform.rotation);
|
||||
player.name = "RestaurantPlayer";
|
||||
CameraManager.Instance.GetCameraGameObject("RestaurantBaseCamera").SetFollowAndLookAtTarget(player.transform);
|
||||
player.name = CommonConstants.RestaurantPlayer;
|
||||
CameraManager.Instance.GetCameraGameObject(CameraType.RestaurantBaseCamera).SetFollowAndLookAtTarget(player.transform);
|
||||
Jeonghyeon
commented
여기도 리터럴 스트링 제거하고 레퍼런스 기반으로 작업할 방법이 있을까요? 여기도 리터럴 스트링 제거하고 레퍼런스 기반으로 작업할 방법이 있을까요?
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -24,14 +24,14 @@ private void Awake()
|
||||
{
|
||||
_rigidbody = GetComponent<Rigidbody>();
|
||||
_animation = GetComponent<RestaurantCharacterAnimation>();
|
||||
_visualLook = transform.Find("VisualLook");
|
||||
_visualLook = transform.Find(CommonConstants.VisualLook);
|
||||
Jeonghyeon
commented
리터럴 제거 바랍니다. 다른 방식으로 얻을 수 없을까요? 리터럴 제거 바랍니다. 다른 방식으로 얻을 수 없을까요?
|
||||
}
|
||||
|
||||
private async void Start()
|
||||
{
|
||||
try
|
||||
{
|
||||
_playerData = await AssetManager.LoadAsset<RestaurantPlayerDataSo>("RestaurantPlayerDataSo");
|
||||
_playerData = await AssetManager.LoadAsset<RestaurantPlayerDataSo>(DataConstants.RestaurantPlayerDataSo);
|
||||
Jeonghyeon
commented
리터럴 제거 리터럴 제거
|
||||
|
||||
_playerData.MoveActionReference.action.performed += OnMove;
|
||||
_playerData.MoveActionReference.action.canceled += OnMove;
|
||||
@ -107,7 +107,7 @@ private void Move()
|
||||
SetCurrentDirection(_inputDirection);
|
||||
|
||||
_isMoving = _inputDirection != Vector3.zero;
|
||||
string animationName = _isMoving ? "RunFast" : "Idle";
|
||||
string animationName = _isMoving ? RestaurantPlayerAnimation.Walk : RestaurantPlayerAnimation.Idle;
|
||||
Jeonghyeon
commented
애니메이션 재생 역시 무브먼트의 소관이 아님. 애니메이션 재생 역시 무브먼트의 소관이 아님.
애니메이션 컴포넌트로 이동해야할듯합니다.
|
||||
_animation.PlayAnimation(animationName, true);
|
||||
|
||||
Vector3 finalVelocity = _inputDirection * _playerData.MoveSpeed;
|
||||
@ -134,7 +134,7 @@ private IEnumerator DashCoroutine()
|
||||
_isDashing = true;
|
||||
_isDashCooldown = true;
|
||||
|
||||
_animation.PlayAnimationDuration("Dash", false, _playerData.DashTime);
|
||||
_animation.PlayAnimationDuration(RestaurantPlayerAnimation.Dash, false, _playerData.DashTime);
|
||||
Jeonghyeon
commented
애니메이션 제거. OnDashStarted나 IsDashing 등으로 처리할 것. 애니메이션 제거. OnDashStarted나 IsDashing 등으로 처리할 것.
|
||||
|
||||
Vector3 dashVelocity = _currentDirection.normalized * _playerData.DashSpeed;
|
||||
_rigidbody.linearVelocity = dashVelocity;
|
||||
|
21
Assets/_DDD/_Scripts/Utilities/Constants.cs
Normal file
21
Assets/_DDD/_Scripts/Utilities/Constants.cs
Normal 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";
|
||||
}
|
||||
}
|
2
Assets/_DDD/_Scripts/Utilities/Constants.cs.meta
Normal file
2
Assets/_DDD/_Scripts/Utilities/Constants.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e8cf38ab843c9e40a94a26ba7102dc4
|
Loading…
Reference in New Issue
Block a user
리터럴 스트링 제거할 방법이 있을까요?