Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.15 deps #97

Merged
merged 8 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reformat code
  • Loading branch information
JR-Morgan committed Aug 31, 2023
commit aa46d4962067596984c7038dbd88bb6d65ff9a2f
25 changes: 12 additions & 13 deletions Assets/Extra/SendChildrenToSpeckle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
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]
Expand All @@ -23,38 +20,40 @@ void Awake()
{
sender = GetComponent<Sender>();
}

[ContextMenu(nameof(Send))]
public void Send()
{
var selected = GetComponentsInChildren<Transform>()
.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<string, int> dict)
{
Debug.Log($"progress was made", this);
}




}
Loading