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

Merge upstream changes #101

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.5",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.2",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.4",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
12 changes: 6 additions & 6 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "2.0.3",
"version": "2.0.5",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.2",
"version": "2.0.4",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.3"
"com.unity.sysroot": "2.0.5"
},
"url": "https://packages.unity.com"
},
Expand Down Expand Up @@ -94,12 +94,12 @@
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.2",
"version": "2.0.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.3",
"com.unity.sysroot.linux-x86_64": "2.0.2"
"com.unity.sysroot": "2.0.5",
"com.unity.sysroot.linux-x86_64": "2.0.4"
},
"url": "https://packages.unity.com"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using Objects.Geometry;
using Speckle.Core.Models;
using Objects.BuiltElements.Revit;
using UnityEditor;
using UnityEngine;
using Mesh = Objects.Geometry.Mesh;
Expand All @@ -22,6 +23,7 @@ public class SpecklePropertiesEditor : UnityEditor.Editor
private static HashSet<string> ArrayFoldoutState = new();
private static bool instancePropFoldoutState = true;
private static bool dynamicPropFoldoutState = true;
private static bool instanceParamsFoldoutState = true;
private static bool isEditMode = false;

static SpecklePropertiesEditor()
Expand Down Expand Up @@ -81,11 +83,40 @@ public override void OnInspectorGUI()
foreach (var propName in InstancePropertyNames)
{
if (!properties.Data.TryGetValue(propName, out object? existingValue)) continue;

var newValue = CreateField(existingValue, propName, propLayoutOptions);
if(newValue != existingValue)
properties.Data[propName] = newValue;

if (propName == "parameters")
{
//Get all the values in this dictionary
instanceParamsFoldoutState = EditorGUILayout.Foldout(instanceParamsFoldoutState, "Parameters: ", EditorStyles.foldoutHeader);
if (instanceParamsFoldoutState)
{
var _base = (Base)properties.Data[propName];
var mems = _base.GetMembers();
foreach (var mb in mems)
{

if (mb.Value.GetType() == typeof(Parameter))
{
Parameter par = (Parameter)mb.Value;
var paramValue = CreateField(par.value, par.name, propLayoutOptions);
}
else
{
var paramValue = CreateField(mb.Value, mb.Key, propLayoutOptions);
}

}
}


}
else
{

if (newValue != existingValue)
properties.Data[propName] = newValue;
}

}
}

Expand All @@ -106,6 +137,8 @@ public override void OnInspectorGUI()
GUILayout.Space(10);
}
}


}

private object? CreateField(object? v, string propName, params GUILayoutOption[] options)
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.22f1
m_EditorVersionWithRevision: 2021.3.22f1 (b6c551784ba3)
m_EditorVersion: 2021.3.25f1
m_EditorVersionWithRevision: 2021.3.25f1 (68ef2c4f8861)
34 changes: 5 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

## Installation


# Connector Unity

Expand Down Expand Up @@ -45,39 +47,13 @@ git clone https://github.com/specklesystems/speckle-unity.git

## Installation (Package)


To install the connector into your own Unity project (rather than using the sample project), open the Package Manager (`Windows -> Package Manager`)
and select **Add Package from git URL**. (requires [git](https://git-scm.com/downloads) installed)

<p align="center"><img src="https://github.com/specklesystems/speckle-docs/blob/main/user/img-unity/unity_install_git.png" width="25%" /></p>

Paste in the following URL
```
https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity
```

Checkout [our docs for getting started instructions](https://speckle.guide/user/unity.html#getting-started)
---

We encourage everyone interested to hack / contribute / debug / give feedback to this project.


### Requirements

- Unity 2021 or greater
- Have created an account on [speckle.xyz](https://speckle.xyz) (or your own server)
- Installed [Speckle Manager](https://speckle.guide/user/manager.html) (recommended, otherwise you'll need to implement your own authentication system in Unity)

### Dependencies

All dependencies to Speckle Core have been included; compiled in `systems.speckle.speckle-unity` package.


## Contributing

Please make sure you read the [contribution guidelines](https://github.com/specklesystems/speckle-sharp/blob/main/.github/CONTRIBUTING.md) for an overview of the best practices we try to follow.


## License

Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via [email](mailto:[email protected]).

https://github.com/constructobot/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity
```