diff --git a/Assets/Extra/SendChildrenToSpeckle.cs b/Assets/Extra/SendChildrenToSpeckle.cs index 47f17f1..4de0ebc 100644 --- a/Assets/Extra/SendChildrenToSpeckle.cs +++ b/Assets/Extra/SendChildrenToSpeckle.cs @@ -2,11 +2,8 @@ using System; using System.Collections.Concurrent; using System.Collections.Immutable; using System.Linq; -using System.Runtime.CompilerServices; using Speckle.ConnectorUnity; -using UnityEditor.Experimental; using UnityEngine; -using UnityEngine.Events; [RequireComponent(typeof(Sender)), ExecuteAlways] [Obsolete] @@ -23,7 +20,7 @@ public class SendChildrenToSpeckle : MonoBehaviour { sender = GetComponent(); } - + [ContextMenu(nameof(Send))] public void Send() { @@ -31,30 +28,32 @@ public class SendChildrenToSpeckle : MonoBehaviour .Where(t => t != this.transform) .Select(o => o.gameObject) .ToImmutableHashSet(); - + Debug.Log("starting send..."); - sender.Send(streamId, selected, null, branchName, createCommit, + sender.Send( + streamId, + selected, + null, + branchName, + createCommit, onErrorAction: OnError, onProgressAction: OnProgress, - onDataSentAction: OnSent); + onDataSentAction: OnSent + ); } private void OnSent(string objectId) { Debug.Log($"Data sent {objectId}", this); } - + private void OnError(string message, Exception e) { Debug.LogError($"Error while sending {message} \n {e}", this); - } + private void OnProgress(ConcurrentDictionary dict) { Debug.Log($"progress was made", this); } - - - - } diff --git a/Assets/InteractionLogic.cs b/Assets/InteractionLogic.cs index 5418810..b7b80ef 100644 --- a/Assets/InteractionLogic.cs +++ b/Assets/InteractionLogic.cs @@ -1,220 +1,244 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using Speckle.Core.Api; -using Speckle.Core.Logging; using UnityEngine; using UnityEngine.UI; using Text = UnityEngine.UI.Text; namespace Speckle.ConnectorUnity -{ +{ [Obsolete] - public class InteractionLogic : MonoBehaviour - { - private Receiver receiver; - - public void InitReceiver(Stream stream, bool autoReceive) + public class InteractionLogic : MonoBehaviour { - gameObject.name = $"receiver-{stream.id}-{Guid.NewGuid().ToString()}"; - InitRemove(); + private Receiver _receiver; - receiver = gameObject.AddComponent(); - receiver.Stream = stream; - - var btn = gameObject.transform.Find("Btn").GetComponentInChildren