-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple colliders on the same object for VoiceOverrideTriggerZone #27
base: master
Are you sure you want to change the base?
Conversation
private int[] playerIds = new int[82]; | ||
private int[] colliderStacks = new int[82]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use DataList
or better a DataDictionary
instead of arrays, key is playerid, value is stacksize.
public override void Start() { | ||
base.Start(); | ||
// ensure that players already being inside the trigger before udon starts are detected by disabling them | ||
// once and enabling them 1 frame later again | ||
_allTrigger = gameObject.GetComponents<Collider>(); | ||
DisableAllTrigger(); | ||
SendCustomEventDelayedFrames(nameof(EnableAllTriggerDelayed), 1, EventTiming.LateUpdate); | ||
SendCustomEventDelayedSeconds(nameof(TriggerStayCheck), 1f, EventTiming.LateUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe randomizing the delay can prevent a sudden lag spike accross all zones
No description provided.