void Update() { waitingToEditPrompt.gameObject.SetActive(false); if (IsOwnershipPending()) { if (currActor.IsLocallyOwned()) { // We've successfully gotten ownership. Reset the time and show inspector contents. lastOwnershipRequest = Mathf.NegativeInfinity; SetShowingContentInternal(true); } else if (Time.unscaledTime > lastOwnershipRequest + OWNERSHIP_CHECK_DELAY_S) { // We've failed to get ownership in the allotted time. Show the waiting to edit message. SetShowingContentInternal(false); waitingToEditPrompt.gameObject.SetActive(true); waitingToEditText.text = $"Waiting to edit after {currActor.GetLockingOwnerNickName()}"; } } else if (!currActor.IsLocallyOwned()) { // Safeguard case: // We may be showing content already, but have somehow lost ownership. SetShowingContentInternal(false); waitingToEditPrompt.gameObject.SetActive(true); } }
public static string GetUnableToEditActorReason(VoosEngine engineRef, string actorName) { VoosActor currentActor = engineRef.GetActor(actorName); if (currentActor == null) { return($"The actor does not exist anymore."); } if (currentActor.IsLockedByAnother()) { return($"{currentActor.GetLockingOwnerNickName()} is editing '{currentActor.GetDisplayName()}'."); } return(null); }