Best practices for requesting ownership of RealtimeView and needing to execute logic based on that
In the below pseudo code I believe there would be a bug due to the asynchronous nature of ownership requests ? I'd like to wait for the answer within a reasonable time frame
var rv = other.gameObject.GetComponent<RealtimeView>();
// Request network ownership
rv.RequestOwnershipOfSelfAndChildren();
// ownership will not be instant because of latency
if (rv.isOwnedLocallySelf )
{
// Do Stuff
}
var rv = other.gameObject.GetComponent<RealtimeView>();
// Request network ownership
rv.RequestOwnershipOfSelfAndChildren();
// ownership will not be instant because of latency
if (rv.isOwnedLocallySelf )
{
// Do Stuff
}