Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3a10a3c7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return; | ||
| } | ||
|
|
||
| if (!other.CompareTag("Player") || !Input.GetKeyDown(KeyCode.E)) |
There was a problem hiding this comment.
Move interaction key check out of physics callback
The NPC hand-in gate uses Input.GetKeyDown(KeyCode.E) inside OnTriggerStay2D, but GetKeyDown is frame-based while OnTriggerStay2D runs on physics ticks, so key presses can be missed when render and fixed-update timing diverge. In play this causes intermittent failures to deliver items even when the player is inside the NPC trigger and pressing E correctly.
Useful? React with 👍 / 👎.
|
|
||
| int index = Random.Range(0, pool.Count); | ||
| ItemType selected = pool[index]; | ||
| npcs[i].SetRequest(selected); |
There was a problem hiding this comment.
Initialize NPC quest-manager links during assignment
Quest completion is only checked through questManager?.CheckQuestState() in NPCRequester, but MansionQuestManager.AssignRequests() currently configures only the requested item and never injects itself into the NPCs. In scenes where designers only populate the manager's NPC list (as the quick setup suggests), each NPC's questManager stays null and onAllNPCsSatisfied will never be evaluated after deliveries.
Useful? React with 👍 / 👎.
Motivation
Description
ItemTypeenum (ItemType.cs) and a simple player inventory componentInventory2DwithAddItem,HasItemandRemoveItemmethods.ItemPickupwhich can beConfigured at spawn time and collects items into the player'sInventory2Don trigger.RandomItemSpawnerto randomly place item prefabs at configured spawn points and set theirItemTypeviaItemPickup.Configure.NPCRequesterwhich requires the player to pressEto deliver an exactrequestedItem, optionally consumes the item, fires success/failureUnityEvents and notifies the quest manager.MansionQuestManagerto assign requests (optionally unique) to a list of NPCs and invokeonAllNPCsSatisfiedwhen all are fulfilled.DoorTeleporterto let the player interact with doors to teleport to a destination point.README.mdthat documents setup steps and the gameplay flow.Testing
git diff --checkto validate there are no whitespace/patch issues and it succeeded.Assets/Scripts/withfind Assets -maxdepth 3 -type f | sortand the check succeeded.git status --shortafter changes and it showed no outstanding changes (success).Codex Task