Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 73ef71f4fd | |||
| 6a07ecfd5b | |||
| e512df9c82 | |||
| 59221e89ba | |||
| 32533ddb21 |
@@ -163,9 +163,10 @@ namespace Speckle.ConnectorUnity.Components.Editor
|
||||
|
||||
try
|
||||
{
|
||||
Commit selectedCommit = Branches[SelectedBranchIndex].commits.items[SelectedCommitIndex];
|
||||
// Receive Speckle Objects
|
||||
var @base = await Operations.Receive(
|
||||
Branches[SelectedBranchIndex].commits.items[SelectedCommitIndex].referencedObject,
|
||||
selectedCommit.referencedObject,
|
||||
remoteTransport: transport,
|
||||
onProgressAction: dict =>
|
||||
{
|
||||
@@ -179,8 +180,15 @@ namespace Speckle.ConnectorUnity.Components.Editor
|
||||
);
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
|
||||
Analytics.TrackEvent(SelectedAccount, Analytics.Events.Receive);
|
||||
|
||||
Analytics.TrackEvent(SelectedAccount, Analytics.Events.Receive, new Dictionary<string, object>()
|
||||
{
|
||||
{"mode", nameof(StreamManagerEditor)},
|
||||
{"sourceHostApp", HostApplications.GetHostAppFromString(selectedCommit.sourceApplication).Slug},
|
||||
{"sourceHostAppVersion", selectedCommit.sourceApplication ?? ""},
|
||||
{"hostPlatform", Application.platform.ToString()},
|
||||
{"isMultiplayer", selectedCommit.authorId != SelectedAccount.userInfo.id},
|
||||
});
|
||||
|
||||
//Convert Speckle Objects
|
||||
int childrenConverted = 0;
|
||||
|
||||
+3
-3
@@ -46,8 +46,8 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection.Editor
|
||||
("Description", s => s.description),
|
||||
("Is Public", s => s.isPublic.ToString()),
|
||||
("Role", s => s.role),
|
||||
("Created at", s => s.createdAt),
|
||||
("Updated at", s => s.updatedAt),
|
||||
("Created at", s => s.createdAt.ToString()),
|
||||
("Updated at", s => s.updatedAt.ToString()),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection.Editor
|
||||
{
|
||||
("Commit Id", s => s.id),
|
||||
("Author Name", s => s.authorName),
|
||||
("Created At", s => s.createdAt),
|
||||
("Created At", s => s.createdAt.ToString()),
|
||||
("Source Application", s => s.sourceApplication),
|
||||
("Reference Object Id", s => s.referencedObject),
|
||||
};
|
||||
|
||||
@@ -5,8 +5,10 @@ using Speckle.Core.Logging;
|
||||
using Speckle.Core.Transports;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Sentry;
|
||||
using Speckle.ConnectorUnity.Components;
|
||||
using Speckle.Core.Kits;
|
||||
@@ -93,7 +95,7 @@ namespace Speckle.ConnectorUnity
|
||||
if (!mainBranch.commits.items.Any())
|
||||
throw new Exception("This branch has no commits");
|
||||
var commit = mainBranch.commits.items[0];
|
||||
GetAndConvertObject(commit.referencedObject, commit.id);
|
||||
GetAndConvertObject(commit.referencedObject, commit.id, commit.sourceApplication, commit.authorId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -116,12 +118,12 @@ namespace Speckle.ConnectorUnity
|
||||
if (e.branchName == BranchName)
|
||||
{
|
||||
Debug.Log("New commit created");
|
||||
GetAndConvertObject(e.objectId, e.id);
|
||||
GetAndConvertObject(e.objectId, e.id, e.sourceApplication, e.authorId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void GetAndConvertObject(string objectId, string commitId)
|
||||
private async void GetAndConvertObject(string objectId, string commitId, string sourceApplication, string authorId)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -136,7 +138,14 @@ namespace Speckle.ConnectorUnity
|
||||
disposeTransports: true
|
||||
);
|
||||
|
||||
Analytics.TrackEvent(Client.Account, Analytics.Events.Receive);
|
||||
Analytics.TrackEvent(Client.Account, Analytics.Events.Receive, new Dictionary<string, object>()
|
||||
{
|
||||
{"mode", nameof(Receiver)},
|
||||
{"sourceHostApp", HostApplications.GetHostAppFromString(sourceApplication).Slug},
|
||||
{"sourceHostAppVersion", sourceApplication ?? ""},
|
||||
{"hostPlatform", Application.platform.ToString()},
|
||||
{"isMultiplayer", authorId != null && authorId != Client.Account.userInfo.id},
|
||||
});
|
||||
|
||||
Dispatcher.Instance().Enqueue(() =>
|
||||
{
|
||||
@@ -186,4 +195,4 @@ namespace Speckle.ConnectorUnity
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
@@ -86,7 +87,7 @@ namespace Speckle.ConnectorUnity.Components
|
||||
client: client,
|
||||
streamId: stream.id,
|
||||
objectId: commit.referencedObject,
|
||||
commitId: commit.id,
|
||||
commit: commit,
|
||||
onProgressAction: dict => OnReceiveProgressAction.Invoke(dict),
|
||||
onErrorAction: (m, e) => OnErrorAction.Invoke(m, e),
|
||||
onTotalChildrenCountKnown: c => OnTotalChildrenCountKnown.Invoke(c)
|
||||
@@ -100,7 +101,7 @@ namespace Speckle.ConnectorUnity.Components
|
||||
/// <param name="client"></param>
|
||||
/// <param name="streamId"></param>
|
||||
/// <param name="objectId"></param>
|
||||
/// <param name="commitId"></param>
|
||||
/// <param name="commit"></param>
|
||||
/// <param name="onProgressAction"></param>
|
||||
/// <param name="onErrorAction"></param>
|
||||
/// <param name="onTotalChildrenCountKnown"></param>
|
||||
@@ -109,7 +110,7 @@ namespace Speckle.ConnectorUnity.Components
|
||||
Client client,
|
||||
string streamId,
|
||||
string objectId,
|
||||
string? commitId,
|
||||
Commit? commit,
|
||||
Action<ConcurrentDictionary<string, int>>? onProgressAction = null,
|
||||
Action<string, Exception>? onErrorAction = null,
|
||||
Action<int>? onTotalChildrenCountKnown = null)
|
||||
@@ -134,7 +135,14 @@ namespace Speckle.ConnectorUnity.Components
|
||||
disposeTransports: false
|
||||
).ConfigureAwait(false);
|
||||
|
||||
Analytics.TrackEvent(client.Account, Analytics.Events.Receive);
|
||||
Analytics.TrackEvent(client.Account, Analytics.Events.Receive, new Dictionary<string, object>()
|
||||
{
|
||||
{"mode", nameof(SpeckleReceiver)},
|
||||
{"sourceHostApp", HostApplications.GetHostAppFromString(commit?.sourceApplication).Slug},
|
||||
{"sourceHostAppVersion", commit?.sourceApplication ?? ""},
|
||||
{"hostPlatform", Application.platform.ToString()},
|
||||
{"isMultiplayer", commit != null && commit.authorId != client.Account.userInfo.id},
|
||||
});
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -144,7 +152,7 @@ namespace Speckle.ConnectorUnity.Components
|
||||
await client.CommitReceived(token, new CommitReceivedInput
|
||||
{
|
||||
streamId = streamId,
|
||||
commitId = commitId,
|
||||
commitId = commit?.id,
|
||||
message = $"received commit from {Application.unityVersion}",
|
||||
sourceApplication = HostApplications.Unity.GetVersion(CoreUtils.GetHostAppVersion())
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
@@ -84,7 +84,11 @@ namespace Speckle.ConnectorUnity.Components
|
||||
onErrorAction: onErrorAction
|
||||
);
|
||||
|
||||
Analytics.TrackEvent(client.Account, Analytics.Events.Send);
|
||||
Analytics.TrackEvent(client.Account, Analytics.Events.Send, new Dictionary<string, object>()
|
||||
{
|
||||
{"mode", nameof(SpeckleSender)},
|
||||
{"hostPlatform", Application.platform.ToString()},
|
||||
});
|
||||
|
||||
if (createCommit && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
|
||||
+1
-1
@@ -354,4 +354,4 @@ namespace Objects.Converter.Unity
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -7,10 +7,10 @@
|
||||
"targets": {
|
||||
".NETStandard,Version=v2.0": {},
|
||||
".NETStandard,Version=v2.0/": {
|
||||
"Objects/2.1.1": {
|
||||
"Objects/2.0.999-local": {
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "2.0.3",
|
||||
"Speckle.Core": "2.1.0"
|
||||
"Speckle.Core": "2.0.999-local"
|
||||
},
|
||||
"runtime": {
|
||||
"Objects.dll": {}
|
||||
@@ -541,7 +541,7 @@
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Objects/2.1.1": {
|
||||
"Objects/2.0.999-local": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "systems.speckle.speckle-unity",
|
||||
"version": "2.13.0",
|
||||
"version": "2.14.2",
|
||||
"displayName": "Speckle Unity Connector",
|
||||
"description": "AEC Interoperability for Unity through Speckle",
|
||||
"unity": "2018.4",
|
||||
|
||||
Reference in New Issue
Block a user