Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ea383c70e | |||
| 6db3fbf37c | |||
| 6da38a7f93 | |||
| 799ca6228c | |||
| 5fa0416bf9 | |||
| fd4d515004 | |||
| b701b4d1f6 | |||
| ab00f1911b | |||
| ef21c7d885 | |||
| b2f08d6ff0 | |||
| 9a2d042b75 |
@@ -71,3 +71,6 @@ crashlytics-build.properties
|
||||
/[Aa]ssets/[Ss]treamingAssets/aa/*
|
||||
.idea/
|
||||
*.meta
|
||||
|
||||
# Unity Plugins
|
||||
/[Aa]ssets/[Pp]lugins/
|
||||
@@ -59,7 +59,7 @@ namespace Speckle.ConnectorUnity
|
||||
onProgressAction: (dict) =>
|
||||
{
|
||||
//Run on a dispatcher as GOs can only be retrieved on the main thread
|
||||
Dispatcher.Instance().Enqueue(() =>
|
||||
Dispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
var val = dict.Values.Average() / receiver.TotalChildrenCount;
|
||||
receiveProgress.gameObject.SetActive(true);
|
||||
@@ -143,7 +143,7 @@ namespace Speckle.ConnectorUnity
|
||||
onProgressAction: (dict) =>
|
||||
{
|
||||
//Run on a dispatcher as GOs can only be retrieved on the main thread
|
||||
Dispatcher.Instance().Enqueue(() =>
|
||||
Dispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
var val = dict.Values.Average() / objs.Count;
|
||||
sendProgress.gameObject.SetActive(true);
|
||||
@@ -152,7 +152,7 @@ namespace Speckle.ConnectorUnity
|
||||
},
|
||||
onDataSentAction: (commitId) =>
|
||||
{
|
||||
Dispatcher.Instance().Enqueue(() =>
|
||||
Dispatcher.Instance.Enqueue(() =>
|
||||
{
|
||||
MakeButtonsInteractable(true);
|
||||
statusText.text = $"Sent {commitId}";
|
||||
|
||||
@@ -14,110 +14,133 @@ limitations under the License.
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Speckle.Core.Kits;
|
||||
using Speckle.Core.Logging;
|
||||
using Unity.EditorCoroutines.Editor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Speckle.ConnectorUnity
|
||||
{
|
||||
/// Author: Pim de Witte (pimdewitte.com) and contributors, https://github.com/PimDeWitte/UnityMainThreadDispatcher
|
||||
/// <summary>
|
||||
/// A thread-safe class which holds a queue with actions to execute on the next Update() method. It can be used to make calls to the main thread for
|
||||
/// things such as UI Manipulation in Unity. It was developed for use in combination with the Firebase Unity plugin, which uses separate threads for event handling
|
||||
/// </summary>
|
||||
public class Dispatcher : MonoBehaviour {
|
||||
namespace Speckle.ConnectorUnity {
|
||||
/// Author: Pim de Witte (pimdewitte.com) and contributors, https://github.com/PimDeWitte/UnityMainThreadDispatcher
|
||||
/// <summary>
|
||||
/// A thread-safe class which holds a queue with actions to execute on the next Update() method. It can be used to make calls to the main thread for
|
||||
/// things such as UI Manipulation in Unity. It was developed for use in combination with the Firebase Unity plugin, which uses separate threads for event handling
|
||||
/// </summary>
|
||||
///
|
||||
[ExecuteAlways]
|
||||
public class Dispatcher : MonoBehaviour {
|
||||
|
||||
private static readonly Queue<Action> _executionQueue = new Queue<Action>();
|
||||
private static readonly Queue<Action> _executionQueue = new Queue<Action>( );
|
||||
|
||||
public void Update() {
|
||||
lock(_executionQueue) {
|
||||
while (_executionQueue.Count > 0) {
|
||||
_executionQueue.Dequeue().Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
private static Dispatcher _instance;
|
||||
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the IEnumerator to the queue
|
||||
/// </summary>
|
||||
/// <param name="action">IEnumerator function that will be executed from the main thread.</param>
|
||||
public void Enqueue(IEnumerator action) {
|
||||
lock (_executionQueue) {
|
||||
_executionQueue.Enqueue (() => {
|
||||
StartCoroutine (action);
|
||||
});
|
||||
}
|
||||
}
|
||||
EditorCoroutine m_LoggerCoroutine;
|
||||
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the Action to the queue
|
||||
/// </summary>
|
||||
/// <param name="action">function that will be executed from the main thread.</param>
|
||||
public void Enqueue(Action action)
|
||||
{
|
||||
Enqueue(ActionWrapper(action));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the Action to the queue, returning a Task which is completed when the action completes
|
||||
/// </summary>
|
||||
/// <param name="action">function that will be executed from the main thread.</param>
|
||||
/// <returns>A Task that can be awaited until the action completes</returns>
|
||||
public Task EnqueueAsync(Action action)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
public static bool Ownerless { get; set; }
|
||||
|
||||
void WrappedAction() {
|
||||
try
|
||||
{
|
||||
action();
|
||||
tcs.TrySetResult(true);
|
||||
} catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
}
|
||||
public static Dispatcher Instance { get; set; }
|
||||
// public static Dispatcher Instance {
|
||||
// get {
|
||||
// if ( _instance == null )
|
||||
// throw new Exception( "Could not find the Dispatcher object. Please ensure you have added a Dispatcher object with this script to your scene." );
|
||||
//
|
||||
// return _instance;
|
||||
// }
|
||||
// set => _instance = value;
|
||||
// }
|
||||
|
||||
Enqueue(ActionWrapper(WrappedAction));
|
||||
return tcs.Task;
|
||||
}
|
||||
private void OnEnable( )
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
|
||||
IEnumerator ActionWrapper(Action a)
|
||||
{
|
||||
a();
|
||||
yield return null;
|
||||
}
|
||||
void Awake( )
|
||||
{
|
||||
Instance = this;
|
||||
Setup.Init( Applications.Unity );
|
||||
|
||||
if ( _instance == null ) {
|
||||
_instance = this;
|
||||
if ( Application.isPlaying )
|
||||
DontDestroyOnLoad( this.gameObject );
|
||||
}
|
||||
}
|
||||
|
||||
private static Dispatcher _instance = null;
|
||||
void OnDestroy( )
|
||||
{
|
||||
_instance = null;
|
||||
}
|
||||
|
||||
public static bool Exists() {
|
||||
return _instance != null;
|
||||
}
|
||||
public void Update( )
|
||||
{
|
||||
lock ( _executionQueue ) {
|
||||
while ( _executionQueue.Count > 0 ) {
|
||||
_executionQueue.Dequeue( ).Invoke( );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Dispatcher Instance() {
|
||||
if (!Exists ()) {
|
||||
throw new Exception ("Could not find the Dispatcher object. Please ensure you have added a Dispatcher object with this script to your scene.");
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the IEnumerator to the queue
|
||||
/// </summary>
|
||||
/// <param name="action">IEnumerator function that will be executed from the main thread.</param>
|
||||
public void Enqueue( IEnumerator action )
|
||||
{
|
||||
lock ( _executionQueue ) {
|
||||
if ( Application.isEditor ) {
|
||||
Debug.Log( "Calling from Editor" );
|
||||
_executionQueue.Enqueue( ( ) => {
|
||||
if ( Ownerless )
|
||||
EditorCoroutineUtility.StartCoroutineOwnerless( action );
|
||||
else
|
||||
EditorCoroutineUtility.StartCoroutine( action, this );
|
||||
} );
|
||||
} else {
|
||||
Debug.Log( "Calling from Play" );
|
||||
_executionQueue.Enqueue( ( ) => { StartCoroutine( action ); } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the Action to the queue
|
||||
/// </summary>
|
||||
/// <param name="action">function that will be executed from the main thread.</param>
|
||||
public void Enqueue( Action action )
|
||||
{
|
||||
Enqueue( ActionWrapper( action ) );
|
||||
}
|
||||
|
||||
void Awake() {
|
||||
Setup.Init(Applications.Unity);
|
||||
|
||||
if (_instance == null) {
|
||||
_instance = this;
|
||||
DontDestroyOnLoad(this.gameObject);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Locks the queue and adds the Action to the queue, returning a Task which is completed when the action completes
|
||||
/// </summary>
|
||||
/// <param name="action">function that will be executed from the main thread.</param>
|
||||
/// <returns>A Task that can be awaited until the action completes</returns>
|
||||
public Task EnqueueAsync( Action action )
|
||||
{
|
||||
var tcs = new TaskCompletionSource<bool>( );
|
||||
|
||||
void OnDestroy() {
|
||||
_instance = null;
|
||||
}
|
||||
void WrappedAction( )
|
||||
{
|
||||
try {
|
||||
action( );
|
||||
tcs.TrySetResult( true );
|
||||
}
|
||||
catch ( Exception ex ) {
|
||||
tcs.TrySetException( ex );
|
||||
}
|
||||
}
|
||||
|
||||
Enqueue( ActionWrapper( WrappedAction ) );
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
}
|
||||
IEnumerator ActionWrapper( Action a )
|
||||
{
|
||||
a( );
|
||||
yield return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,317 +15,294 @@ using Sentry;
|
||||
using Sentry.Protocol;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Speckle.ConnectorUnity
|
||||
{
|
||||
/// <summary>
|
||||
/// A Speckle Receiver, it's a wrapper around a basic Speckle Client
|
||||
/// that handles conversions and subscriptions for you
|
||||
/// </summary>
|
||||
public class Receiver : MonoBehaviour
|
||||
{
|
||||
public string StreamId;
|
||||
public string BranchName = "main";
|
||||
public Stream Stream;
|
||||
public int TotalChildrenCount = 0;
|
||||
public GameObject ReceivedData;
|
||||
|
||||
private bool AutoReceive;
|
||||
private bool DeleteOld;
|
||||
private Action<ConcurrentDictionary<string, int>> OnProgressAction;
|
||||
private Action<string, Exception> OnErrorAction;
|
||||
private Action<int> OnTotalChildrenCountKnown;
|
||||
private Action<GameObject> OnDataReceivedAction;
|
||||
|
||||
|
||||
private ConverterUnity _converter = new ConverterUnity();
|
||||
private Client Client { get; set; }
|
||||
|
||||
|
||||
public Receiver()
|
||||
{
|
||||
}
|
||||
|
||||
namespace Speckle.ConnectorUnity {
|
||||
/// <summary>
|
||||
/// Initializes the Receiver manually
|
||||
/// A Speckle Receiver, it's a wrapper around a basic Speckle Client
|
||||
/// that handles conversions and subscriptions for you
|
||||
/// </summary>
|
||||
/// <param name="streamId">Id of the stream to receive</param>
|
||||
/// <param name="autoReceive">If true, it will automatically receive updates sent to this stream</param>
|
||||
/// <param name="deleteOld">If true, it will delete previously received objects when new one are received</param>
|
||||
/// <param name="account">Account to use, if null the default account will be used</param>
|
||||
/// <param name="onDataReceivedAction">Action to run after new data has been received and converted</param>
|
||||
/// <param name="onProgressAction">Action to run when there is download/conversion progress</param>
|
||||
/// <param name="onErrorAction">Action to run on error</param>
|
||||
/// <param name="onTotalChildrenCountKnown">Action to run when the TotalChildrenCount is known</param>
|
||||
public void Init(string streamId, bool autoReceive = false, bool deleteOld = true, Account account = null,
|
||||
Action<GameObject> onDataReceivedAction = null, Action<ConcurrentDictionary<string, int>> onProgressAction = null,
|
||||
Action<string, Exception> onErrorAction = null, Action<int> onTotalChildrenCountKnown = null)
|
||||
{
|
||||
StreamId = streamId;
|
||||
AutoReceive = autoReceive;
|
||||
DeleteOld = deleteOld;
|
||||
OnDataReceivedAction = onDataReceivedAction;
|
||||
OnErrorAction = onErrorAction;
|
||||
OnProgressAction = onProgressAction;
|
||||
OnTotalChildrenCountKnown = onTotalChildrenCountKnown;
|
||||
[ExecuteAlways]
|
||||
public class Receiver : MonoBehaviour {
|
||||
|
||||
Client = new Client(account ?? AccountManager.GetDefaultAccount());
|
||||
|
||||
//using the ApplicationPlaceholderObject to pass materials
|
||||
//available in Assets/Materials to the converters
|
||||
var materials = Resources.LoadAll("Materials", typeof(Material)).Cast<Material>()
|
||||
.Select(x => new ApplicationPlaceholderObject {NativeObject = x}).ToList();
|
||||
_converter.SetContextObjects(materials);
|
||||
public string StreamId;
|
||||
public string BranchName = "main";
|
||||
public Stream Stream;
|
||||
public int TotalChildrenCount = 0;
|
||||
public GameObject ReceivedData;
|
||||
|
||||
if (AutoReceive)
|
||||
{
|
||||
Client.SubscribeCommitCreated(StreamId);
|
||||
Client.OnCommitCreated += Client_OnCommitCreated;
|
||||
}
|
||||
}
|
||||
private bool AutoReceive;
|
||||
private bool DeleteOld;
|
||||
public Action ReceiveCompleteAction;
|
||||
|
||||
private Action<ConcurrentDictionary<string, int>> OnProgressAction;
|
||||
private Action<string, Exception> OnErrorAction;
|
||||
private Action<int> OnTotalChildrenCountKnown;
|
||||
private Action<GameObject> OnDataReceivedAction;
|
||||
|
||||
|
||||
private ConverterUnity _converter = new ConverterUnity( );
|
||||
private Client Client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets and converts the data of the last commit on the Stream
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void Receive()
|
||||
{
|
||||
if (Client == null || string.IsNullOrEmpty(StreamId))
|
||||
throw new Exception("Receiver has not been initialized. Please call Init().");
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var mainBranch = await Client.BranchGet(StreamId, BranchName, 1);
|
||||
if (!mainBranch.commits.items.Any())
|
||||
throw new Exception("This branch has no commits");
|
||||
var commit = mainBranch.commits.items[0];
|
||||
GetAndConvertObject(commit.referencedObject, commit.id);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SpeckleException(e.Message, e, true, SentryLevel.Error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#region private methods
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a new commit is created on this stream
|
||||
/// It receives and converts the objects and then executes the user defined _onCommitCreated action.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected virtual void Client_OnCommitCreated(object sender, CommitInfo e)
|
||||
{
|
||||
if (e.branchName == BranchName)
|
||||
{
|
||||
Debug.Log("New commit created");
|
||||
GetAndConvertObject(e.objectId, e.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void GetAndConvertObject(string objectId, string commitId)
|
||||
{
|
||||
try
|
||||
{
|
||||
Tracker.TrackPageview(Tracker.RECEIVE);
|
||||
|
||||
var transport = new ServerTransport(Client.Account, StreamId);
|
||||
var @base = await Operations.Receive(
|
||||
objectId,
|
||||
remoteTransport: transport,
|
||||
onErrorAction: OnErrorAction,
|
||||
onProgressAction: OnProgressAction,
|
||||
onTotalChildrenCountKnown: OnTotalChildrenCountKnown
|
||||
);
|
||||
Dispatcher.Instance().Enqueue(() =>
|
||||
{
|
||||
var go = ConvertRecursivelyToNative(@base, commitId);
|
||||
//remove previously received object
|
||||
if (DeleteOld && ReceivedData != null)
|
||||
Destroy(ReceivedData);
|
||||
ReceivedData = go;
|
||||
OnDataReceivedAction?.Invoke(go);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SpeckleException(e.Message, e, true, SentryLevel.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Base object to a GameObject Recursively
|
||||
/// </summary>
|
||||
/// <param name="base"></param>
|
||||
/// <returns></returns>
|
||||
private GameObject ConvertRecursivelyToNative(Base @base, string name)
|
||||
{
|
||||
// case 1: it's an item that has a direct conversion method, eg a point
|
||||
if (_converter.CanConvertToNative(@base))
|
||||
{
|
||||
var go = TryConvertItemToNative(@base);
|
||||
return go;
|
||||
}
|
||||
|
||||
// case 2: it's a wrapper Base
|
||||
// 2a: if there's only one member unpack it
|
||||
// 2b: otherwise return dictionary of unpacked members
|
||||
var members = @base.GetMemberNames().ToList();
|
||||
if (members.Count() == 1)
|
||||
{
|
||||
var go = RecurseTreeToNative(@base[members.First()]);
|
||||
go.name = members.First();
|
||||
return go;
|
||||
}
|
||||
else
|
||||
{
|
||||
//empty game object with the commit id as name, used to contain all the rest
|
||||
var go = new GameObject();
|
||||
go.name = name;
|
||||
foreach (var member in members)
|
||||
{
|
||||
var goo = RecurseTreeToNative(@base[member]);
|
||||
if (goo != null)
|
||||
{
|
||||
goo.name = member;
|
||||
goo.transform.parent = go.transform;
|
||||
}
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Converts an object recursively to a list of GameObjects
|
||||
/// </summary>
|
||||
/// <param name="object"></param>
|
||||
/// <returns></returns>
|
||||
private GameObject RecurseTreeToNative(object @object)
|
||||
{
|
||||
if (IsList(@object))
|
||||
{
|
||||
var list = ((IEnumerable) @object).Cast<object>();
|
||||
var objects = list.Select(x => RecurseTreeToNative(x)).Where(x => x != null).ToList();
|
||||
if (objects.Any())
|
||||
{
|
||||
var go = new GameObject();
|
||||
go.name = "List";
|
||||
objects.ForEach(x => x.transform.parent = go.transform);
|
||||
return go;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return TryConvertItemToNative(@object);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private GameObject TryConvertItemToNative(object value)
|
||||
{
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
//it's a simple type or not a Base
|
||||
if (value.GetType().IsSimpleType() || !(value is Base))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var @base = (Base) value;
|
||||
|
||||
//it's an unsupported Base, go through each of its property and try convert that
|
||||
if (!_converter.CanConvertToNative(@base))
|
||||
{
|
||||
var members = @base.GetMemberNames().ToList();
|
||||
|
||||
//empty game object with the commit id as name, used to contain all the rest
|
||||
var go = new GameObject();
|
||||
go.name = @base.speckle_type;
|
||||
var goos = new List<GameObject>();
|
||||
foreach (var member in members)
|
||||
{
|
||||
var goo = RecurseTreeToNative(@base[member]);
|
||||
if (goo != null)
|
||||
{
|
||||
goo.name = member;
|
||||
goo.transform.parent = go.transform;
|
||||
goos.Add(goo);
|
||||
}
|
||||
}
|
||||
|
||||
//if no children is valid, return null
|
||||
if (!goos.Any())
|
||||
{
|
||||
Destroy(go);
|
||||
return null;
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var go = _converter.ConvertToNative(@base) as GameObject;
|
||||
// Some revit elements have nested elements in a "elements" property
|
||||
// for instance hosted families on a wall
|
||||
if (go != null && @base["elements"] is List<Base> l && l.Any())
|
||||
{
|
||||
var goo = RecurseTreeToNative(l);
|
||||
if (goo != null)
|
||||
/// <summary>
|
||||
/// Initializes the Receiver manually
|
||||
/// </summary>
|
||||
/// <param name="streamId">Id of the stream to receive</param>
|
||||
/// <param name="autoReceive">If true, it will automatically receive updates sent to this stream</param>
|
||||
/// <param name="deleteOld">If true, it will delete previously received objects when new one are received</param>
|
||||
/// <param name="account">Account to use, if null the default account will be used</param>
|
||||
/// <param name="onDataReceivedAction">Action to run after new data has been received and converted</param>
|
||||
/// <param name="onProgressAction">Action to run when there is download/conversion progress</param>
|
||||
/// <param name="onErrorAction">Action to run on error</param>
|
||||
/// <param name="onTotalChildrenCountKnown">Action to run when the TotalChildrenCount is known</param>
|
||||
public void Init( string streamId, bool autoReceive = false, bool deleteOld = true, Account account = null,
|
||||
Action<GameObject> onDataReceivedAction = null, Action<ConcurrentDictionary<string, int>> onProgressAction = null,
|
||||
Action<string, Exception> onErrorAction = null, Action<int> onTotalChildrenCountKnown = null )
|
||||
{
|
||||
goo.name = "elements";
|
||||
goo.transform.parent = go.transform;
|
||||
StreamId = streamId;
|
||||
AutoReceive = autoReceive;
|
||||
DeleteOld = deleteOld;
|
||||
OnDataReceivedAction = onDataReceivedAction;
|
||||
OnErrorAction = onErrorAction;
|
||||
OnProgressAction = onProgressAction;
|
||||
OnTotalChildrenCountKnown = onTotalChildrenCountKnown;
|
||||
|
||||
Client = new Client( account ?? AccountManager.GetDefaultAccount( ) );
|
||||
|
||||
//using the ApplicationPlaceholderObject to pass materials
|
||||
//available in Assets/Materials to the converters
|
||||
var materials = Resources.LoadAll( "Materials", typeof( Material ) ).Cast<Material>( )
|
||||
.Select( x => new ApplicationPlaceholderObject {NativeObject = x} ).ToList( );
|
||||
_converter.SetContextObjects( materials );
|
||||
|
||||
if ( AutoReceive ) {
|
||||
Client.SubscribeCommitCreated( StreamId );
|
||||
Client.OnCommitCreated += Client_OnCommitCreated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SpeckleException(e.Message, e, true, SentryLevel.Error);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets and converts the data of the last commit on the Stream
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void Receive( string branchName = "" )
|
||||
{
|
||||
if ( Client == null || string.IsNullOrEmpty( StreamId ) )
|
||||
throw new Exception( "Receiver has not been initialized. Please call Init()." );
|
||||
|
||||
if ( !string.IsNullOrEmpty( branchName ) )
|
||||
BranchName = branchName;
|
||||
|
||||
Task.Run( async ( ) => {
|
||||
try {
|
||||
Debug.Log( $"Trying for Branch: {BranchName} on Stream: {StreamId} " );
|
||||
var mainBranch = await Client.BranchGet( StreamId, BranchName, 1 );
|
||||
|
||||
if ( !mainBranch.commits.items.Any( ) )
|
||||
throw new Exception( "This branch has no commits" );
|
||||
|
||||
var commit = mainBranch.commits.items[ 0 ];
|
||||
// TODO send info for what objects are being converted
|
||||
GetAndConvertObject( commit.referencedObject, commit.id );
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new SpeckleException( e.Message, e, true, SentryLevel.Error );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
#region private methods
|
||||
/// <summary>
|
||||
/// Fired when a new commit is created on this stream
|
||||
/// It receives and converts the objects and then executes the user defined _onCommitCreated action.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected virtual void Client_OnCommitCreated( object sender, CommitInfo e )
|
||||
{
|
||||
if ( e.branchName == BranchName ) {
|
||||
Debug.Log( "New commit created" );
|
||||
GetAndConvertObject( e.objectId, e.id );
|
||||
}
|
||||
}
|
||||
|
||||
private async void GetAndConvertObject( string objectId, string commitId )
|
||||
{
|
||||
Debug.Log( "Converting new objects" );
|
||||
try {
|
||||
Tracker.TrackPageview( Tracker.RECEIVE );
|
||||
|
||||
var transport = new ServerTransport( Client.Account, StreamId );
|
||||
var @base = await Operations.Receive(
|
||||
objectId,
|
||||
remoteTransport: transport,
|
||||
onErrorAction: OnErrorAction,
|
||||
onProgressAction: OnProgressAction,
|
||||
onTotalChildrenCountKnown: OnTotalChildrenCountKnown
|
||||
);
|
||||
|
||||
Dispatcher.Instance.Enqueue( ( ) => {
|
||||
var go = ConvertRecursivelyToNative( @base, commitId );
|
||||
//remove previously received object
|
||||
if ( DeleteOld && ReceivedData != null ) {
|
||||
if ( Application.isPlaying )
|
||||
Destroy( ReceivedData );
|
||||
else {
|
||||
DestroyImmediate( ReceivedData );
|
||||
}
|
||||
}
|
||||
ReceivedData = go;
|
||||
OnDataReceivedAction?.Invoke( go );
|
||||
} );
|
||||
Debug.Log( "Try State Done" );
|
||||
ReceiveCompleteAction?.Invoke( );
|
||||
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new SpeckleException( e.Message, e, true, SentryLevel.Error );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a Base object to a GameObject Recursively
|
||||
/// </summary>
|
||||
/// <param name="base"></param>
|
||||
/// <returns></returns>
|
||||
private GameObject ConvertRecursivelyToNative( Base @base, string name )
|
||||
{
|
||||
// case 1: it's an item that has a direct conversion method, eg a point
|
||||
if ( _converter.CanConvertToNative( @base ) ) {
|
||||
var go = TryConvertItemToNative( @base );
|
||||
return go;
|
||||
}
|
||||
|
||||
// case 2: it's a wrapper Base
|
||||
// 2a: if there's only one member unpack it
|
||||
// 2b: otherwise return dictionary of unpacked members
|
||||
var members = @base.GetMemberNames( ).ToList( );
|
||||
if ( members.Count( ) == 1 ) {
|
||||
var go = RecurseTreeToNative( @base[ members.First( ) ] );
|
||||
go.name = members.First( );
|
||||
return go;
|
||||
} else {
|
||||
//empty game object with the commit id as name, used to contain all the rest
|
||||
var go = new GameObject {name = name};
|
||||
foreach ( var member in members ) {
|
||||
var goo = RecurseTreeToNative( @base[ member ] );
|
||||
if ( goo != null ) {
|
||||
goo.name = member;
|
||||
goo.transform.parent = go.transform;
|
||||
}
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an object recursively to a list of GameObjects
|
||||
/// </summary>
|
||||
/// <param name="object"></param>
|
||||
/// <returns></returns>
|
||||
private GameObject RecurseTreeToNative( object @object )
|
||||
{
|
||||
if ( IsList( @object ) ) {
|
||||
var list = ( (IEnumerable) @object ).Cast<object>( );
|
||||
var objects = list.Select( x => RecurseTreeToNative( x ) ).Where( x => x != null ).ToList( );
|
||||
if ( objects.Any( ) ) {
|
||||
var go = new GameObject( );
|
||||
go.name = "List";
|
||||
objects.ForEach( x => x.transform.parent = go.transform );
|
||||
return go;
|
||||
}
|
||||
} else {
|
||||
return TryConvertItemToNative( @object );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private GameObject TryConvertItemToNative( object value )
|
||||
{
|
||||
if ( value == null )
|
||||
return null;
|
||||
|
||||
//it's a simple type or not a Base
|
||||
if ( value.GetType( ).IsSimpleType( ) || !( value is Base ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var @base = (Base) value;
|
||||
|
||||
//it's an unsupported Base, go through each of its property and try convert that
|
||||
if ( !_converter.CanConvertToNative( @base ) ) {
|
||||
var members = @base.GetMemberNames( ).ToList( );
|
||||
|
||||
//empty game object with the commit id as name, used to contain all the rest
|
||||
var go = new GameObject( );
|
||||
go.name = @base.speckle_type;
|
||||
var goos = new List<GameObject>( );
|
||||
foreach ( var member in members ) {
|
||||
var goo = RecurseTreeToNative( @base[ member ] );
|
||||
if ( goo != null ) {
|
||||
goo.name = member;
|
||||
goo.transform.parent = go.transform;
|
||||
goos.Add( goo );
|
||||
}
|
||||
}
|
||||
|
||||
//if no children is valid, return null
|
||||
if ( !goos.Any( ) ) {
|
||||
Destroy( go );
|
||||
return null;
|
||||
}
|
||||
|
||||
return go;
|
||||
} else {
|
||||
try {
|
||||
var go = _converter.ConvertToNative( @base ) as GameObject;
|
||||
// Some revit elements have nested elements in a "elements" property
|
||||
// for instance hosted families on a wall
|
||||
if ( go != null && @base[ "elements" ] is List<Base> l && l.Any( ) ) {
|
||||
var goo = RecurseTreeToNative( l );
|
||||
if ( goo != null ) {
|
||||
goo.name = "elements";
|
||||
goo.transform.parent = go.transform;
|
||||
}
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
throw new SpeckleException( e.Message, e, true, SentryLevel.Error );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool IsList( object @object )
|
||||
{
|
||||
if ( @object == null )
|
||||
return false;
|
||||
|
||||
var type = @object.GetType( );
|
||||
return ( typeof( IEnumerable ).IsAssignableFrom( type ) && !typeof( IDictionary ).IsAssignableFrom( type ) &&
|
||||
type != typeof( string ) );
|
||||
}
|
||||
|
||||
private static bool IsDictionary( object @object )
|
||||
{
|
||||
if ( @object == null )
|
||||
return false;
|
||||
|
||||
Type type = @object.GetType( );
|
||||
return type.IsGenericType && type.GetGenericTypeDefinition( ) == typeof( Dictionary<,> );
|
||||
}
|
||||
|
||||
private void OnDestroy( )
|
||||
{
|
||||
Client?.CommitCreatedSubscription?.Dispose( );
|
||||
}
|
||||
#endregion
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static bool IsList(object @object)
|
||||
{
|
||||
if (@object == null)
|
||||
return false;
|
||||
|
||||
var type = @object.GetType();
|
||||
return (typeof(IEnumerable).IsAssignableFrom(type) && !typeof(IDictionary).IsAssignableFrom(type) &&
|
||||
type != typeof(string));
|
||||
}
|
||||
|
||||
private static bool IsDictionary(object @object)
|
||||
{
|
||||
if (@object == null)
|
||||
return false;
|
||||
|
||||
Type type = @object.GetType();
|
||||
return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Client.CommitCreatedSubscription.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Speckle.ConnectorUnity {
|
||||
//https://forum.unity.com/threads/async-await-in-editor-script.481276/
|
||||
//https://forum.unity.com/threads/follow-up-async-methods-continue-to-execute-when-you-stop-the-game-in-the-editor-potentially-dange.949671/
|
||||
|
||||
[CustomEditor( typeof( BabyStreamManager ) )]
|
||||
[CanEditMultipleObjects]
|
||||
public class BabyStreamManagerEditor : Editor {
|
||||
|
||||
private int _listValue = 10;
|
||||
private bool _auto,_foldOutAccount, _foldOutStreams;
|
||||
private string[ ] _streamNames,_accountNames;
|
||||
private int _selectedStreamIndex, _selectedBranchIndex, _selectedCommitIndex, _selectedAccountIndex, _selectedServerIndex;
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void Initialize( ) => EditorApplication.update += Ayuda.ExecuteContinuations;
|
||||
|
||||
private void OnEnable( )
|
||||
{
|
||||
BabyStreamManager script = (BabyStreamManager) target;
|
||||
_accountNames = script.Fetch.Accounts.GetNames( ).ToArray( );
|
||||
script.GetSpeckleAccountData( );
|
||||
}
|
||||
|
||||
public override async void OnInspectorGUI( )
|
||||
{
|
||||
DrawDefaultInspector( );
|
||||
serializedObject.Update( );
|
||||
|
||||
BabyStreamManager script = (BabyStreamManager) target;
|
||||
|
||||
#region Account GUI
|
||||
EditorGUILayout.BeginHorizontal( );
|
||||
|
||||
_selectedAccountIndex = EditorGUILayout.Popup( "Accounts", _selectedAccountIndex, _accountNames, GUILayout.ExpandWidth( true ), GUILayout.Height( 20 ) );
|
||||
|
||||
if ( GUILayout.Button( "Load", GUILayout.Width( 60 ), GUILayout.Height( 20 ) ) || _accountNames == null ) {
|
||||
await Task.Run( ( ) => script.GetSpeckleAccountData( ) );
|
||||
_accountNames = script.Fetch.Accounts.GetNames( ).ToArray( );
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal( );
|
||||
|
||||
#region Speckle Account Info
|
||||
_foldOutAccount = EditorGUILayout.BeginFoldoutHeaderGroup( _foldOutAccount, "Account Info" );
|
||||
|
||||
if ( _foldOutAccount ) {
|
||||
EditorGUI.BeginDisabledGroup( true );
|
||||
|
||||
EditorGUILayout.TextField( "Name", script.Fetch.AccountName,
|
||||
GUILayout.Height( 20 ),
|
||||
GUILayout.ExpandWidth( true ) );
|
||||
|
||||
EditorGUILayout.TextField( "Server", script.Fetch.ServerName,
|
||||
GUILayout.Height( 20 ),
|
||||
GUILayout.ExpandWidth( true ) );
|
||||
|
||||
EditorGUILayout.TextField( "URL", script.Fetch.ServerURL,
|
||||
GUILayout.Height( 20 ),
|
||||
GUILayout.ExpandWidth( true ) );
|
||||
|
||||
EditorGUI.EndDisabledGroup( );
|
||||
}
|
||||
|
||||
EditorGUILayout.EndFoldoutHeaderGroup( );
|
||||
#endregion
|
||||
|
||||
#region Stream Limit
|
||||
EditorGUILayout.Separator( );
|
||||
|
||||
_listValue = EditorGUILayout.IntSlider( "Limit", _listValue, 1, 10, GUILayout.ExpandWidth( true ) );
|
||||
script.ListLimit = _listValue;
|
||||
#endregion
|
||||
|
||||
EditorGUILayout.Separator( );
|
||||
#endregion
|
||||
|
||||
#region Stream List
|
||||
var items = script.Fetch.StreamsByName.ToArray( );
|
||||
|
||||
EditorGUILayout.BeginHorizontal( );
|
||||
|
||||
_selectedStreamIndex = EditorGUILayout.Popup( "Streams",
|
||||
_selectedStreamIndex, items, GUILayout.Height( 20 ), GUILayout.ExpandWidth( true ) );
|
||||
|
||||
if ( GUILayout.Button( "Load", GUILayout.Width( 60 ), GUILayout.Height( 20 ) ) ) {
|
||||
Debug.Log( "Loading stream " );
|
||||
await Task.Run( ( ) => script.SelectStreamFromList( _selectedStreamIndex ) );
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal( );
|
||||
#endregion
|
||||
|
||||
#region Stream Branch GUI
|
||||
var streamStatus = script.StreamReady && script.Fetch.SelectedStreamIndex == _selectedStreamIndex;
|
||||
items = streamStatus ? script.Fetch.BranchesByName.ToArray( ) : new[ ] {"stream is not loaded"};
|
||||
|
||||
// branch selection
|
||||
_selectedBranchIndex = EditorGUILayout.Popup( "Branches",
|
||||
_selectedBranchIndex, items, GUILayout.Height( 20 ), GUILayout.ExpandWidth( true ) );
|
||||
script.SetSelectedBranch = _selectedStreamIndex;
|
||||
|
||||
// commit selection
|
||||
items = streamStatus ? script.Fetch.CommitsById.ToArray( ) : new[ ] {"stream is not loaded"};
|
||||
_selectedCommitIndex = EditorGUILayout.Popup( "Commits",
|
||||
_selectedCommitIndex, items, GUILayout.Height( 20 ), GUILayout.ExpandWidth( true ) );
|
||||
|
||||
script.SetSelectedCommit = _selectedCommitIndex;
|
||||
#endregion
|
||||
|
||||
GUILayout.BeginHorizontal( );
|
||||
|
||||
var auto = GUILayout.Toggle( _auto, "AutoLoad", GUILayout.ExpandWidth( false ) );
|
||||
if ( auto != _auto ) {
|
||||
_auto = auto;
|
||||
script.AutoUpdate = _auto;
|
||||
}
|
||||
GUILayout.Space( 50 );
|
||||
|
||||
var ready = script.IsReady && script.InProcess == false;
|
||||
|
||||
EditorGUI.BeginDisabledGroup( !ready );
|
||||
|
||||
if ( GUILayout.Button( !ready ? "Loading... " : "Load Stream" ) ) {
|
||||
if ( ready )
|
||||
script.LoadStream( );
|
||||
}
|
||||
EditorGUI.EndDisabledGroup( );
|
||||
|
||||
GUILayout.EndHorizontal( );
|
||||
|
||||
serializedObject.ApplyModifiedProperties( );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Speckle.Core.Api;
|
||||
using Speckle.Core.Credentials;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Speckle.ConnectorUnity.GUI {
|
||||
public class FunBatch {
|
||||
|
||||
public Action<bool> MightHaveWork;
|
||||
public async void Init( )
|
||||
{
|
||||
var speckleAccount = AccountManager.GetAccounts( ).FirstOrDefault( );
|
||||
|
||||
if ( speckleAccount == null ) {
|
||||
Debug.Log( "Please set a default account in SpeckleManager" );
|
||||
return;
|
||||
}
|
||||
var client = new Client( speckleAccount );
|
||||
|
||||
var streams = await client.StreamsGet( 10 );
|
||||
var stream = streams.FirstOrDefault( s => s.name.Equals( "WhiteDoe" ) );
|
||||
|
||||
var instance = new GameObject( stream.name ).AddComponent<Receiver>( );
|
||||
|
||||
instance.Init( stream.id, false, false, speckleAccount,
|
||||
onDataReceivedAction: go => { go.transform.SetParent( instance.transform ); },
|
||||
onTotalChildrenCountKnown: count => { instance.TotalChildrenCount = count; },
|
||||
onProgressAction: dict => { Dispatcher.Instance.Enqueue( ( ) => { Debug.Log( dict.Values.Average( ) / instance.TotalChildrenCount ); } ); } );
|
||||
|
||||
instance.ReceiveCompleteAction += ( ) => {
|
||||
MightHaveWork?.Invoke( true );
|
||||
Debug.Log( "Receive Complete" );
|
||||
};
|
||||
instance.Receive( "main" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[CustomEditor( typeof( Dispatcher ) )]
|
||||
public class DispatcherEditor : Editor {
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void Initialize( ) => EditorApplication.update += Ayuda.ExecuteContinuations;
|
||||
|
||||
|
||||
public override async void OnInspectorGUI( )
|
||||
{
|
||||
DrawDefaultInspector( );
|
||||
serializedObject.Update( );
|
||||
|
||||
Dispatcher script = (Dispatcher) target;
|
||||
|
||||
GUILayout.BeginHorizontal( );
|
||||
|
||||
if ( GUILayout.Button( "Owner Batch" ) ) {
|
||||
Dispatcher.Ownerless = false;
|
||||
// await Task.Run(script.EnqueueAsync( DoTimeConsumingStuff ) );
|
||||
Ayuda.SyncCall( _ => script.Enqueue( DoTimeConsumingStuff ) );
|
||||
}
|
||||
|
||||
if ( GUILayout.Button( "Ownerless Batch" ) ) {
|
||||
Dispatcher.Ownerless = true;
|
||||
Ayuda.SyncCall( _ => script.Enqueue( DoTimeConsumingStuff ) );
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal( );
|
||||
|
||||
// GUILayout.BeginHorizontal( );
|
||||
//
|
||||
// if ( GUILayout.Button( "Async Owner Batch" ) ) {
|
||||
// if ( !_doingThings ) {
|
||||
// Dispatcher.Ownerless = false;
|
||||
// await script.EnqueueAsync( DoTimeConsumingStuff );
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Debug.Log( "Doing Things!" );
|
||||
// }
|
||||
//
|
||||
// if ( GUILayout.Button( "Async Ownerless Batch" ) ) {
|
||||
// if ( !_doingThings ) {
|
||||
// Dispatcher.Ownerless = true;
|
||||
// await script.EnqueueAsync( DoTimeConsumingStuff );
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// Debug.Log( "Doing Things!" );
|
||||
// }
|
||||
//
|
||||
// GUILayout.EndHorizontal( );
|
||||
|
||||
serializedObject.ApplyModifiedProperties( );
|
||||
}
|
||||
|
||||
private void DoTimeConsumingStuff( )
|
||||
{
|
||||
Debug.Log( "doing..." );
|
||||
Thread.Sleep( 200 );
|
||||
Debug.Log( "done: " + Thread.CurrentThread.ManagedThreadId );
|
||||
// force refresh
|
||||
Repaint( );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4c2110f382384646afeb0ebe0b2109f0, type: 3}
|
||||
m_Name: SpeckleStream
|
||||
m_EditorClassIdentifier:
|
||||
streamId:
|
||||
streamName:
|
||||
@@ -0,0 +1,358 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &323147531
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 323147534}
|
||||
- component: {fileID: 323147533}
|
||||
- component: {fileID: 323147532}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &323147532
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &323147533
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &323147534
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1013213356
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1013213358}
|
||||
- component: {fileID: 1013213357}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1013213357
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1013213356}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1013213358
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1013213356}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &1987772512
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1987772514}
|
||||
- component: {fileID: 1987772515}
|
||||
- component: {fileID: 1987772513}
|
||||
m_Layer: 0
|
||||
m_Name: StreamManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1987772513
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1987772512}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 27492dda437de4643b9f10552c3aab1f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
streamObj: {fileID: 0}
|
||||
--- !u!4 &1987772514
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1987772512}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1987772515
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1987772512}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 446eb2de03584f959b5aaf9427734028, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
@@ -0,0 +1,400 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &323147531
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 323147534}
|
||||
- component: {fileID: 323147533}
|
||||
- component: {fileID: 323147532}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &323147532
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &323147533
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &323147534
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 323147531}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &458225217
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 458225219}
|
||||
- component: {fileID: 458225218}
|
||||
m_Layer: 0
|
||||
m_Name: RainbowHierarchyRuleset
|
||||
m_TagString: EditorOnly
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &458225218
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 458225217}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 366663908, guid: ebe26e22332665d4c8332b2a624e5e8b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Rules:
|
||||
- Type: 0
|
||||
Name:
|
||||
GameObject: {fileID: 1987772512}
|
||||
Ordinal: 0
|
||||
Priority: 0
|
||||
IconType: 2740
|
||||
IconTexture: {fileID: 0}
|
||||
IsIconRecursive: 0
|
||||
BackgroundType: 100
|
||||
BackgroundTexture: {fileID: 0}
|
||||
IsBackgroundRecursive: 0
|
||||
IsHidden: 0
|
||||
--- !u!4 &458225219
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 458225217}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1013213356
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1013213358}
|
||||
- component: {fileID: 1013213357}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1013213357
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1013213356}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1013213358
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1013213356}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &1987772512
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1987772514}
|
||||
- component: {fileID: 1987772515}
|
||||
m_Layer: 0
|
||||
m_Name: FunBatcher
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1987772514
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1987772512}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1987772515
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1987772512}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 446eb2de03584f959b5aaf9427734028, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
@@ -0,0 +1,68 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using Speckle.Core.Api;
|
||||
using Speckle.Core.Credentials;
|
||||
|
||||
namespace Speckle.ConnectorUnity {
|
||||
public readonly struct SpeckleSimpleInfo {
|
||||
|
||||
public SpeckleSimpleInfo( string name )
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public string name { get; }
|
||||
|
||||
}
|
||||
|
||||
public static class Ayuda {
|
||||
|
||||
public static void SyncCall( SendOrPostCallback post ) => SynchronizationContext.Current.Post( post, null );
|
||||
|
||||
public static void ExecuteContinuations( )
|
||||
{
|
||||
var context = SynchronizationContext.Current;
|
||||
var execMethod = context.GetType( ).GetMethod( "Exec", BindingFlags.NonPublic | BindingFlags.Instance );
|
||||
execMethod.Invoke( context, null );
|
||||
}
|
||||
|
||||
public static List<SpeckleSimpleInfo> GetInfo( this IEnumerable<Stream> input )
|
||||
{
|
||||
return (
|
||||
from i in input
|
||||
where i != null
|
||||
select new SpeckleSimpleInfo( i.name ) ).ToList( );
|
||||
}
|
||||
|
||||
public static List<SpeckleSimpleInfo> GetInfo( this IEnumerable<Branch> input )
|
||||
{
|
||||
return (
|
||||
from i in input
|
||||
where i != null
|
||||
select new SpeckleSimpleInfo( i.name ) ).ToList( );
|
||||
}
|
||||
|
||||
public static List<SpeckleSimpleInfo> GetInfo( this IEnumerable<Commit> input )
|
||||
{
|
||||
return (
|
||||
from i in input
|
||||
where i != null
|
||||
select new SpeckleSimpleInfo( i.id ) ).ToList( );
|
||||
}
|
||||
public static IEnumerable<string> GetNames( this IEnumerable<Account> accounts )
|
||||
{
|
||||
List<string> names = new List<string>( );
|
||||
if ( accounts != null ) {
|
||||
names.AddRange(
|
||||
from account in accounts
|
||||
where account != null
|
||||
select account.userInfo.name
|
||||
);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Speckle.Core.Api;
|
||||
using Speckle.Core.Credentials;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Speckle_Connector.dmo;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Speckle.ConnectorUnity {
|
||||
[ExecuteAlways]
|
||||
[RequireComponent( typeof( Dispatcher ) )]
|
||||
public class BabyStreamManager : MonoBehaviour {
|
||||
|
||||
[Header( "|| Speckle Account Stuff ||" )]
|
||||
[Tooltip( "WIP - If working from Editor use a scriptable object to import streams" ),
|
||||
SerializeField] private StreamSO streamObj;
|
||||
|
||||
private List<Receiver> ActiveReceivers;
|
||||
private UnityEvent<GameObject> StreamObjectLoadedEvent;
|
||||
|
||||
public int ListLimit { get; set; }
|
||||
|
||||
public Account Account {
|
||||
get => Stash.Account;
|
||||
set => Stash.Account = value;
|
||||
}
|
||||
|
||||
public Stream SelectedStream {
|
||||
get => Stash.SelectedStream;
|
||||
set => Stash.SelectedStream = value;
|
||||
}
|
||||
|
||||
public List<Stream> Streams {
|
||||
get => Stash.Streams;
|
||||
set => Stash.Streams = value;
|
||||
}
|
||||
|
||||
public List<Branch> Branches {
|
||||
get => Stash.Branches;
|
||||
set => Stash.Branches = value;
|
||||
}
|
||||
|
||||
public List<Commit> Commits {
|
||||
get => Stash.Commits;
|
||||
set => Stash.Commits = value;
|
||||
}
|
||||
|
||||
private Fetcher _fetcher;
|
||||
public Fetcher Fetch {
|
||||
get {
|
||||
_fetcher ??= new Fetcher( this );
|
||||
return _fetcher;
|
||||
}
|
||||
}
|
||||
|
||||
public bool AutoUpdate { get; set; }
|
||||
public bool InProcess { get; set; }
|
||||
|
||||
public bool StreamReady => SelectedStream != null;
|
||||
|
||||
public bool IsReady => Account != null && Streams?.Count > 0 && Branches?.Count > 0;
|
||||
|
||||
private Dispatcher Dispatcher {
|
||||
get {
|
||||
// NOTE required for converting and setting up files
|
||||
if ( Dispatcher.Instance == null && gameObject.GetComponent<Dispatcher>( ) == null )
|
||||
gameObject.AddComponent<Dispatcher>( );
|
||||
|
||||
return Dispatcher.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
private int _selectedStreamIndex, _selectedBranchIndex, _selectedCommitIndex;
|
||||
|
||||
public int SetSelectedBranch {
|
||||
set {
|
||||
if ( Branches != null )
|
||||
_selectedBranchIndex = SetIndex( value, Fetch.BranchesByName );
|
||||
}
|
||||
}
|
||||
|
||||
public int SetSelectedCommit {
|
||||
set {
|
||||
if ( Commits != null )
|
||||
_selectedCommitIndex = SetIndex( value, Fetch.CommitsById );
|
||||
}
|
||||
}
|
||||
|
||||
public async void SelectStreamFromList( int value )
|
||||
{
|
||||
if ( Streams == null ) return;
|
||||
|
||||
ClearSelectedStreamData( );
|
||||
|
||||
_selectedStreamIndex = SetIndex( value, Fetch.StreamsByName );
|
||||
|
||||
var selectedStream = Streams[ _selectedStreamIndex ];
|
||||
|
||||
if ( Account == null ) {
|
||||
Debug.Log( "No account set to pull from :(" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( selectedStream == null ) {
|
||||
Debug.Log( "No Stream to Select from ya fool!" );
|
||||
return;
|
||||
}
|
||||
|
||||
var client = new Client( Account );
|
||||
|
||||
var branches = await client.StreamGetBranches( selectedStream.id );
|
||||
Branches = branches;
|
||||
|
||||
var commits = await client.StreamGetCommits( selectedStream.id );
|
||||
Commits = commits;
|
||||
|
||||
SelectedStream = selectedStream;
|
||||
}
|
||||
|
||||
private static int SetIndex( int index, ICollection objects )
|
||||
{
|
||||
if ( objects != null ) {
|
||||
if ( index >= objects.Count )
|
||||
index = objects.Count - 1;
|
||||
else if ( index < 0 )
|
||||
index = 0;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
internal static class Stash {
|
||||
|
||||
public static Account Account { get; internal set; }
|
||||
|
||||
public static Stream SelectedStream { get; internal set; }
|
||||
|
||||
public static List<Stream> Streams { get; internal set; }
|
||||
|
||||
public static List<Branch> Branches { get; internal set; }
|
||||
|
||||
public static List<Commit> Commits { get; internal set; }
|
||||
|
||||
}
|
||||
|
||||
public class Fetcher {
|
||||
|
||||
public Fetcher( BabyStreamManager manager )
|
||||
{
|
||||
Manager = manager;
|
||||
}
|
||||
|
||||
public string AccountName {
|
||||
get {
|
||||
var value = "nada";
|
||||
if ( Manager?.Account != null )
|
||||
value = Manager.Account.userInfo.name;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public string ServerName {
|
||||
get {
|
||||
var value = "nada";
|
||||
if ( Manager?.Account != null )
|
||||
value = Manager.Account.serverInfo.name;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public string ServerURL {
|
||||
get {
|
||||
var value = "nada";
|
||||
if ( Manager?.Account != null )
|
||||
value = Manager.Account.serverInfo.url;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Account> Accounts => AccountManager.GetAccounts( );
|
||||
|
||||
public List<string> BranchesByName => GetByName( Manager?.Branches.GetInfo( ) );
|
||||
|
||||
public List<string> StreamsByName => GetByName( Manager?.Streams.GetInfo( ) );
|
||||
|
||||
public List<string> CommitsById => GetByName( Manager?.Commits.GetInfo( ) );
|
||||
|
||||
private static List<string> GetByName( IReadOnlyCollection<SpeckleSimpleInfo> list )
|
||||
{
|
||||
var names = new List<string>( );
|
||||
|
||||
if ( list != null && list.Count > 0 )
|
||||
names = ( from i in list select i.name ).ToList( );
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
private BabyStreamManager Manager { get; }
|
||||
|
||||
private bool DispatcherActive => Manager?.Dispatcher != null;
|
||||
|
||||
public int SelectedStreamIndex => Manager == null ? 0 : Manager._selectedStreamIndex;
|
||||
|
||||
}
|
||||
|
||||
public async void GetSpeckleAccountData( )
|
||||
{
|
||||
InProcess = false;
|
||||
var speckleAccount = AccountManager.GetAccounts( ).FirstOrDefault( );
|
||||
|
||||
if ( speckleAccount == null ) {
|
||||
Debug.Log( "Please set a default account in SpeckleManager" );
|
||||
return;
|
||||
}
|
||||
|
||||
Account = speckleAccount;
|
||||
|
||||
ClearData( true );
|
||||
var client = new Client( Account );
|
||||
|
||||
var streams = await client.StreamsGet( ListLimit );
|
||||
|
||||
Streams = streams;
|
||||
}
|
||||
|
||||
private void ClearData( bool BranchesAndStreams )
|
||||
{
|
||||
Streams = new List<Stream>( );
|
||||
if ( !BranchesAndStreams ) return;
|
||||
|
||||
ClearSelectedStreamData( );
|
||||
}
|
||||
|
||||
private void ClearSelectedStreamData( )
|
||||
{
|
||||
SelectedStream = null;
|
||||
Branches = new List<Branch>( );
|
||||
Commits = new List<Commit>( );
|
||||
}
|
||||
|
||||
public void LoadStream( )
|
||||
{
|
||||
if ( Account == null ) {
|
||||
Debug.Log( "No account set to pull from :(" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( SelectedStream == null ) {
|
||||
Debug.Log( "No Stream to Select from ya fool!" );
|
||||
return;
|
||||
}
|
||||
|
||||
var branchName = Fetch.BranchesByName[ _selectedBranchIndex ];
|
||||
|
||||
var instance = new GameObject( $"{branchName} Receiver" ).AddComponent<Receiver>( );
|
||||
|
||||
instance.Init( SelectedStream.id, AutoUpdate, false, Account,
|
||||
onDataReceivedAction: go => {
|
||||
go.transform.SetParent( instance.transform );
|
||||
StreamObjectLoadedEvent?.Invoke( go );
|
||||
},
|
||||
onTotalChildrenCountKnown: count => { instance.TotalChildrenCount = count; },
|
||||
onProgressAction: dict => { Dispatcher.Enqueue( ( ) => { Debug.Log( dict.Values.Average( ) / instance.TotalChildrenCount ); } ); } );
|
||||
|
||||
instance.ReceiveCompleteAction += ( ) => { Debug.Log( "Receive Complete" ); };
|
||||
|
||||
instance.Receive( branchName );
|
||||
|
||||
ActiveReceivers ??= new List<Receiver>( );
|
||||
ActiveReceivers.Add( instance );
|
||||
InProcess = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Speckle.ConnectorUnity {
|
||||
public abstract class SpeckleUnityEventArgs : EventArgs { }
|
||||
|
||||
public class StreamSelectedArgs : EventArgs {
|
||||
|
||||
public StreamSelectedArgs( List<string> branchNames, List<string> commitIds )
|
||||
{
|
||||
BranchNames = branchNames;
|
||||
CommitIds = commitIds;
|
||||
}
|
||||
|
||||
public List<string> BranchNames { get; }
|
||||
public List<string> CommitIds { get; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
#endif
|
||||
|
||||
[CustomPropertyDrawer( typeof( ReadOnlyAttribute ) )]
|
||||
public class ReadOnlyDrawer : PropertyDrawer {
|
||||
|
||||
public override void OnGUI( Rect position,
|
||||
SerializedProperty property,
|
||||
GUIContent label )
|
||||
{
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField( position, property, label, true );
|
||||
GUI.enabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ReadOnlyAttribute : PropertyAttribute { }
|
||||
@@ -0,0 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
[CreateAssetMenu( fileName = "SpeckleStream", menuName = "Speckle2/Stream Scriptable Object", order = 0 )]
|
||||
public class AccountSO : ScriptableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Speckle_Connector.dmo {
|
||||
[CreateAssetMenu( fileName = "SpeckleStream", menuName = "Speckle2/Stream Scriptable Object", order = 0 )]
|
||||
|
||||
public class StreamSO : ScriptableObject {
|
||||
|
||||
public string streamId;
|
||||
public string streamName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4c2110f382384646afeb0ebe0b2109f0, type: 3}
|
||||
m_Name: SpeckleStream
|
||||
m_EditorClassIdentifier:
|
||||
streamId:
|
||||
streamName:
|
||||
@@ -2,12 +2,13 @@
|
||||
"dependencies": {
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.collab-proxy": "1.3.9",
|
||||
"com.unity.editorcoroutines": "1.0.0",
|
||||
"com.unity.ide.rider": "2.0.7",
|
||||
"com.unity.ide.visualstudio": "2.0.5",
|
||||
"com.unity.ide.visualstudio": "2.0.7",
|
||||
"com.unity.ide.vscode": "1.2.3",
|
||||
"com.unity.test-framework": "1.1.19",
|
||||
"com.unity.test-framework": "1.1.22",
|
||||
"com.unity.textmeshpro": "3.0.1",
|
||||
"com.unity.timeline": "1.4.4",
|
||||
"com.unity.timeline": "1.4.6",
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.modules.ai": "1.0.0",
|
||||
"com.unity.modules.androidjni": "1.0.0",
|
||||
|
||||
@@ -13,8 +13,15 @@
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.editorcoroutines": {
|
||||
"version": "1.0.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ext.nunit": {
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
@@ -30,10 +37,12 @@
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.visualstudio": {
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.7",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.9"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.vscode": {
|
||||
@@ -44,11 +53,11 @@
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.test-framework": {
|
||||
"version": "1.1.19",
|
||||
"version": "1.1.22",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.ext.nunit": "1.0.5",
|
||||
"com.unity.ext.nunit": "1.0.6",
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
@@ -64,7 +73,7 @@
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.timeline": {
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.6",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
|
||||
@@ -12,11 +12,11 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EnablePreviewPackages: 0
|
||||
m_EnablePreviewPackages: 1
|
||||
m_EnablePackageDependencies: 0
|
||||
m_AdvancedSettingsExpanded: 1
|
||||
m_ScopedRegistriesSettingsExpanded: 1
|
||||
oneTimeWarningShown: 0
|
||||
oneTimeWarningShown: 1
|
||||
m_Registries:
|
||||
- m_Id: main
|
||||
m_Name:
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2020.2.1f1
|
||||
m_EditorVersionWithRevision: 2020.2.1f1 (270dd8c3da1c)
|
||||
m_EditorVersion: 2020.3.1f1
|
||||
m_EditorVersionWithRevision: 2020.3.1f1 (77a89f25062f)
|
||||
|
||||
Reference in New Issue
Block a user