Conversation
Guribo
requested changes
Jul 22, 2024
Comment on lines
+26
to
+27
| private int[] playerIds = new int[82]; | ||
| private int[] colliderStacks = new int[82]; |
Owner
There was a problem hiding this comment.
Please use DataList or better a DataDictionary instead of arrays, key is playerid, value is stacksize.
| _allTrigger = gameObject.GetComponents<Collider>(); | ||
| DisableAllTrigger(); | ||
| SendCustomEventDelayedFrames(nameof(EnableAllTriggerDelayed), 1, EventTiming.LateUpdate); | ||
| SendCustomEventDelayedSeconds(nameof(TriggerStayCheck), 1f, EventTiming.LateUpdate); |
Owner
There was a problem hiding this comment.
Depending on the scene setup this can have a major impact on performance when many zones update all at once.
Additionally, is guaranteed that this custom loop keeps running should this script be disabled?
| } | ||
| } | ||
|
|
||
| private void expand(ref int[] stale, int newSize) |
Owner
There was a problem hiding this comment.
can be removed if DataDictionary is used
| // This ensures continuity for edge cases like players entering stations while in the trigger zone. | ||
| public void TriggerStayCheck() | ||
| { | ||
| SendCustomEventDelayedSeconds(nameof(TriggerStayCheck), 5f); |
Owner
There was a problem hiding this comment.
maybe randomizing the delay can prevent a sudden lag spike accross all zones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.