public AddListener ( |
||
newListener | ||
Результат | void |
/// <summary> /// Called when the sharing stage connects to a server. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Events Arguements.</param> private void Connected(object sender = null, EventArgs e = null) { SharingStage.Instance.SharingManagerConnected -= Connected; if (SharingStage.Instance.ShowDetailedLogs) { Debug.Log("Anchor Manager: Starting..."); } if (AnchorDebugText != null) { AnchorDebugText.text += "\nConnected to Server"; } // Setup the room manager callbacks. roomManager = SharingStage.Instance.Manager.GetRoomManager(); roomManagerListener = new RoomManagerAdapter(); roomManagerListener.AnchorsChangedEvent += RoomManagerCallbacks_AnchorsChanged; roomManagerListener.AnchorsDownloadedEvent += RoomManagerListener_AnchorsDownloaded; roomManagerListener.AnchorUploadedEvent += RoomManagerListener_AnchorUploaded; roomManager.AddListener(roomManagerListener); // We will register for session joined and left to indicate when the sharing service // is ready for us to make room related requests. SharingStage.Instance.SessionsTracker.CurrentUserJoined += CurrentUserJoinedSession; SharingStage.Instance.SessionsTracker.CurrentUserLeft += CurrentUserLeftSession; }
private void Start() { // We will register for session joined and left to indicate when the sharing service // is ready for us to make room related requests. sharingStage = SharingStage.Instance; sharingStage.SessionsTracker.CurrentUserJoined += CurrentUserJoinedSession; sharingStage.SessionsTracker.CurrentUserLeft += CurrentUserLeftSession; // Setup the room manager callbacks. roomManager = sharingStage.Manager.GetRoomManager(); roomManagerCallbacks = new RoomManagerAdapter(); roomManagerCallbacks.AnchorsDownloadedEvent += RoomManagerCallbacks_AnchorsDownloaded; roomManagerCallbacks.AnchorUploadedEvent += RoomManagerCallbacks_AnchorUploaded; roomManager.AddListener(roomManagerCallbacks); }
void Start() { Debug.Log("Import Export Manager starting"); CurrentState = ImportExportState.Ready; // We need to get our local anchor store started up. CurrentState = ImportExportState.AnchorStore_Initializing; WorldAnchorStore.GetAsync(AnchorStoreReady); // We will register for session joined to indicate when the sharing service // is ready for us to make room related requests. SharingStage.Instance.SessionsTracker.UserJoined += Instance_SessionJoined; // Setup the room manager callbacks. roomManager = SharingStage.Instance.Manager.GetRoomManager(); roomManagerCallbacks = new HoloToolkit.Sharing.RoomManagerAdapter(); roomManagerCallbacks.AnchorsDownloadedEvent += RoomManagerCallbacks_AnchorsDownloaded; roomManagerCallbacks.AnchorUploadedEvent += RoomManagerCallbacks_AnchorUploaded; roomManager.AddListener(roomManagerCallbacks); }