This commit is contained in:
2026-06-14 23:55:20 +07:00
parent d731f962a3
commit 132def45c7
16 changed files with 380 additions and 77 deletions

View File

@@ -51,7 +51,6 @@ namespace OnlyScove.Scripts
if (animator == null) animator = GetComponentInParent<Animator>();
// 3. TỰ ĐỘNG TẮT SCRIPT XUNG ĐỘT (CameraOpenDoor) nếu nó đang tồn tại trên Camera
// Điều này giúp hệ thống của bạn chiếm quyền điều khiển hoàn toàn
var conflictingScript = Object.FindFirstObjectByType<CameraDoorScript.CameraOpenDoor>();
if (conflictingScript != null)
{
@@ -60,31 +59,24 @@ namespace OnlyScove.Scripts
}
}
// protected override void PerformInteraction(PlayerStateMachine player)
// {
// Debug.Log($"[Interaction] PerformInteraction CALLED on {gameObject.name}!");
//
// // 1. Ưu tiên script của Door Pack (Wood Door Script)
// if (woodDoorScript != null)
// {
// Debug.Log($"[Interaction] Calling woodDoorScript.OpenDoor() on {gameObject.name}. Previous state: {woodDoorScript.open}");
// woodDoorScript.OpenDoor();
// isOpen = woodDoorScript.open;
// Debug.Log($"[Interaction] New state: {woodDoorScript.open}");
// return;
// }
//
// // 2. Nếu không có script Pack mới dùng Animator
// if (animator != null)
// {
// isOpen = !isOpen;
// animator.SetBool(boolParameterName, isOpen);
// Debug.Log($"[Interaction] Triggered Animator: {boolParameterName} = {isOpen}");
// }
// else
// {
// Debug.LogError($"[Interaction] FAILED: No woodDoorScript or animator found on {gameObject.name}");
// }
// }
protected override void PerformInteraction(GameObject interactor)
{
Debug.Log($"[Interaction] PerformInteraction CALLED on {gameObject.name}!");
// 1. Ưu tiên script của Door Pack (Wood Door Script)
if (woodDoorScript != null)
{
woodDoorScript.OpenDoor();
isOpen = woodDoorScript.open;
return;
}
// 2. Nếu không có script Pack mới dùng Animator
if (animator != null)
{
isOpen = !isOpen;
animator.SetBool(boolParameterName, isOpen);
}
}
}
}
}