diff --git a/Assets/KGB/Animal/2.animator_controllers/beagle_anim.controller b/Assets/KGB/Animal/2.animator_controllers/beagle_anim.controller index 1f7ce75..d6ecb47 100644 --- a/Assets/KGB/Animal/2.animator_controllers/beagle_anim.controller +++ b/Assets/KGB/Animal/2.animator_controllers/beagle_anim.controller @@ -83,8 +83,8 @@ AnimatorStateTransition: - m_ConditionMode: 1 m_ConditionEvent: ReactTrigger m_EventTreshold: 0 - - m_ConditionMode: 4 - m_ConditionEvent: HungerLevel + - m_ConditionMode: 2 + m_ConditionEvent: IsHungry m_EventTreshold: 50 - m_ConditionMode: 6 m_ConditionEvent: TouchIndex @@ -138,7 +138,10 @@ AnimatorStateTransition: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: - m_Conditions: [] + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: IsHungry + m_EventTreshold: 0 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 1102192097396800364} m_Solo: 0 diff --git a/Assets/KGB/Scripts/ARPlacementManager.cs b/Assets/KGB/Scripts/ARPlacementManager.cs index 78846c7..e3f39d4 100644 --- a/Assets/KGB/Scripts/ARPlacementManager.cs +++ b/Assets/KGB/Scripts/ARPlacementManager.cs @@ -57,10 +57,20 @@ private void SpawnAnimal(Pose hitPose) { Vector3 spawnPosition = new Vector3(hitPose.position.x, 0f, hitPose.position.z); _spawnedAnimal = Instantiate(_animalPrefabs[_selectedAnimalIndex], spawnPosition, hitPose.rotation); + + if (_spawnedAnimal == null) + { + Debug.LogError("ARPlacementManager: Failed to instantiate prefab!"); + return; + } + + Debug.Log($"ARPlacementManager: Prefab spawned -> {_spawnedAnimal.name} / Position: {spawnPosition}"); + _spawnedAnimal.AddComponent(); + Debug.Log("ARPlacementManager: AnimalMover added"); - var status = _spawnedAnimal.AddComponent(); - status.SetAnimator(_spawnedAnimal.GetComponent()); + _spawnedAnimal.AddComponent(); + Debug.Log("ARPlacementManager: PetStatusController added"); HJS.AR_MyPet.MyPetManager.myPetInstance?.RegisterPet(_spawnedAnimal); } diff --git a/Assets/KGB/Scripts/AnimalMover.cs b/Assets/KGB/Scripts/AnimalMover.cs index bedc5a1..0ee3e3d 100644 --- a/Assets/KGB/Scripts/AnimalMover.cs +++ b/Assets/KGB/Scripts/AnimalMover.cs @@ -12,7 +12,7 @@ public class AnimalMover : MonoBehaviour private Vector3 _targetPosition; private bool _isMoving = false; - private bool _isLookingAtCamera = false; + private float _idleTimer = 0f; private Camera _camera; private Animator _animator; @@ -46,7 +46,6 @@ private void Update() { if (_isMoving) { - _isLookingAtCamera = false; MoveToTarget(); } else @@ -67,8 +66,8 @@ private void DecideIdleBehavior() if (roll == 0) { - // 앉기 - 제자리에서 sitting 애니메이션 - _isLookingAtCamera = false; + // 카메라 바라보고 앉기 + LookAtCamera(); _animator.SetBool("IsWalking", false); } else @@ -96,6 +95,7 @@ private void MoveToTarget() _isMoving = false; _idleTimer = 0f; _animator.SetBool("IsWalking", false); + LookAtCamera(); } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 4094275..36ed2d8 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -145,6 +145,10 @@ PlayerSettings: bundleVersion: 0.1.0 preloadedAssets: - {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} + - {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3} + - {fileID: 4800000, guid: 0945859e5a1034c2cb6dce53cb4fb899, type: 3} + - {fileID: -567818772020245008, guid: 46d8f5b32de3ff54899142f12a8c12f1, type: 2} + - {fileID: 6781703603346133630, guid: 2f4279554e860004e80298147bac00aa, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1