This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
Waiting for network behavior attachment to network object #397
Unanswered
NoTuxNoBux
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I'm interested in certain behaviors being created in my application, but listening to them being created does not appear to be possible. Instead, I'm listening to network objects being created and from here on out, I can look at
AttachedBehavior
. Unfortunately, this value may benull
until the behavior is actually initialized and attaches itself to the object.This brings me to the question: is it possible to listen to either behaviors being created, or, alternatively, the behavior being set or changed of a network object?
The source code shows
NetworkObject.AttachedBehavior
does not emit any events or such whenset
is called. A possible fix would be to add a minor event to listen to, such asBehaviorChanged
.A (poor) workaround I'm using so far is to create a thread that polls for the value being non-null and resolving a promise (
Task
) when that happens, and then performing the rest of my operations as soon as it is set.Beta Was this translation helpful? Give feedback.
All reactions