July 2017
Beginner to intermediate
390 pages
10h 53m
English
Receiving the data is similar. First, we need to have some TCP listener that responds to data being sent over. Once that happens, we will end up with a large byte[] that we need to transform:
private void ReceiveNewAnchor(byte[] rawData) { WorldAnchorTransferBatch.ImportAsync(rawData, OnReceiveCompleted); } private void OnReceiveCompleted(SerializationCompletionReason reason, WorldAnchorTransferBatch batch) { if (reason != SerializationCompletionReason.Succeeded) { // Oops.. return; } var allIds = batch.GetAllIds(); foreach (var id in allIds) { GameObject newGuitar = Instantiate(objectToPlace); newGuitar.GetComponent<Identifier>().AnchorName = id; var anchor = batch.LockObject(id, newGuitar); _anchors.Add(id, ...Read now
Unlock full access