Updted UI to allow for account/streambranch/commit selection

This commit is contained in:
Jedd Morgan
2023-01-03 20:41:10 +00:00
parent 771e2b6969
commit 20e9cbb5e9
51 changed files with 11912 additions and 195855 deletions
+13
View File
@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/contentModel.xml
/projectSettingsUpdater.xml
/.idea.speckle-unity-vr.iml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
File diff suppressed because one or more lines are too long
+736
View File
@@ -0,0 +1,736 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &270237656938982442
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 270237656938982443}
- component: {fileID: 270237656938982453}
- component: {fileID: 5675756031333904160}
m_Layer: 5
m_Name: View Preview Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &270237656938982443
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237656938982442}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 270237657462562156}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0, y: 35}
m_SizeDelta: {x: 160, y: -90}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &270237656938982453
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237656938982442}
m_CullTransparentMesh: 1
--- !u!114 &5675756031333904160
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237656938982442}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!1 &270237657451126620
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 270237657451126621}
- component: {fileID: 270237657451126623}
- component: {fileID: 270237657451126622}
m_Layer: 5
m_Name: View Name Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &270237657451126621
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657451126620}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 270237657462562156}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 40}
m_SizeDelta: {x: -20, y: 30}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &270237657451126623
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657451126620}
m_CullTransparentMesh: 1
--- !u!114 &270237657451126622
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657451126620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: '{streamName}
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_sharedMaterial: {fileID: 4627449628323122871, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 23.5
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 3
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &270237657462562147
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 270237657462562156}
- component: {fileID: 270237657462562158}
- component: {fileID: 270237657462562157}
- component: {fileID: 8657510586088243604}
m_Layer: 5
m_Name: Option View
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &270237657462562156
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657462562147}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 270237656938982443}
- {fileID: 270237657451126621}
- {fileID: 5722732921276847316}
- {fileID: 7205074845700003627}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &270237657462562158
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657462562147}
m_CullTransparentMesh: 1
--- !u!114 &270237657462562157
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657462562147}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &8657510586088243604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 270237657462562147}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 50fc0155509f6db45888be5bafdc391f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &693800887635377637
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7205074845700003627}
m_Layer: 5
m_Name: Hover
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &7205074845700003627
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 693800887635377637}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6372147414622481547}
m_Father: {fileID: 270237657462562156}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &4167090623464861484
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6372147414622481547}
- component: {fileID: 1902653153006586393}
- component: {fileID: 7542356010406065726}
- component: {fileID: 8814400229079707857}
m_Layer: 5
m_Name: Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6372147414622481547
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4167090623464861484}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1336617344692054626}
m_Father: {fileID: 7205074845700003627}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 175, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1902653153006586393
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4167090623464861484}
m_CullTransparentMesh: 1
--- !u!114 &7542356010406065726
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4167090623464861484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &8814400229079707857
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4167090623464861484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 7542356010406065726}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &4669182555403027836
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5722732921276847316}
- component: {fileID: 2840419684660365139}
- component: {fileID: 8868406404634642017}
m_Layer: 5
m_Name: View Description Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5722732921276847316
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4669182555403027836}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 270237657462562156}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 10}
m_SizeDelta: {x: -20, y: 20}
m_Pivot: {x: 0.5, y: 0}
--- !u!222 &2840419684660365139
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4669182555403027836}
m_CullTransparentMesh: 1
--- !u!114 &8868406404634642017
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4669182555403027836}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Updated about {time} ago
'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_sharedMaterial: {fileID: 4627449628323122871, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 15.65
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 11
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 3
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5337235408718749389
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1336617344692054626}
- component: {fileID: 7634313705501756184}
- component: {fileID: 2188142251315139483}
m_Layer: 5
m_Name: Button Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1336617344692054626
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5337235408718749389}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6372147414622481547}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7634313705501756184
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5337235408718749389}
m_CullTransparentMesh: 1
--- !u!114 &2188142251315139483
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5337235408718749389}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Select
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_sharedMaterial: {fileID: 4627449628323122871, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f6efd3ddb74ce4340af8e57b68d418f9
guid: 4ba439a0180c7c54f84bb6d8cc3abfa2
PrefabImporter:
externalObjects: {}
userData:
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 17bc05da428c7234c9d6665d6ef7e195
guid: 56f0dc2d344578e4481b7a30ab0b889c
folderAsset: yes
DefaultImporter:
externalObjects: {}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 04d52eb88b320e143850786efdd3061b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+14 -4
View File
@@ -17,27 +17,37 @@ MonoBehaviour:
description:
preview: {fileID: 0}
dependencies:
- dependency: {fileID: 2800000, guid: a7ec9e7ad8b847b7ae4510af83c5d868, type: 3}
instantiationMode: 0
- dependency: {fileID: 5872428166931294713, guid: f6efd3ddb74ce4340af8e57b68d418f9, type: 3}
- dependency: {fileID: 2800000, guid: 5dd4c01168f890c49859afd36640b0a9, type: 3}
instantiationMode: 0
- dependency: {fileID: -944628639613478452, guid: c348712bda248c246b8c49b3db54643f, type: 3}
instantiationMode: 1
- dependency: {fileID: 2800000, guid: ecb2d652f08abc34d82634be797ccf31, type: 3}
instantiationMode: 0
- dependency: {fileID: 3119055576648383682, guid: 04d52eb88b320e143850786efdd3061b, type: 3}
instantiationMode: 0
- dependency: {fileID: 12800000, guid: 32d6753bc0e21aa46bc63aa5a694fee6, type: 3}
instantiationMode: 1
- dependency: {fileID: 2800000, guid: ee2ed9d8fff3a1d4db5590491978062e, type: 3}
instantiationMode: 0
- dependency: {fileID: 2800000, guid: 2fd6421f253b4ef1a19526541f9ffc0c, type: 3}
instantiationMode: 0
- dependency: {fileID: 11400000, guid: 2e498d1c8094910479dc3e1b768306a4, type: 2}
instantiationMode: 1
- dependency: {fileID: 11400000, guid: e527c605c77b965449f3f45927d8b3cf, type: 2}
instantiationMode: 1
- dependency: {fileID: 2800000, guid: 165f717696d10fb4e82b83c3d7bc9e7c, type: 3}
instantiationMode: 0
- dependency: {fileID: 740049907039925199, guid: 4ba439a0180c7c54f84bb6d8cc3abfa2, type: 3}
instantiationMode: 0
- dependency: {fileID: 2800000, guid: 7b8bfaee8f8631c4789ac62373cbc2d4, type: 3}
instantiationMode: 0
- dependency: {fileID: 2800000, guid: ee148e281f3c41c5b4ff5f8a5afe5a6c, type: 3}
instantiationMode: 0
- dependency: {fileID: 2100000, guid: 1b3482a7631eb1b4db608377e23ef634, type: 2}
instantiationMode: 0
- dependency: {fileID: 270237657462562147, guid: 6b3e7fb9e335fc8439cdf1f76eeb8bf5, type: 3}
instantiationMode: 0
- dependency: {fileID: 5381490313809831470, guid: 47a5bfc7e34dd45428f1b7359e0d7ebc, type: 3}
- dependency: {fileID: 2800000, guid: 4e64a121cf44e1846907649ee8b15dd3, type: 3}
instantiationMode: 0
- dependency: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
instantiationMode: 1
+695 -192053
View File
File diff suppressed because one or more lines are too long
+303
View File
@@ -0,0 +1,303 @@
%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, g: 0, b: 0, 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 &521744941
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 521744943}
- component: {fileID: 521744942}
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 &521744942
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 521744941}
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 &521744943
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 521744941}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &541561878
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 541561881}
- component: {fileID: 541561880}
- component: {fileID: 541561879}
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 &541561879
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 541561878}
m_Enabled: 1
--- !u!20 &541561880
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 541561878}
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 &541561881
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 541561878}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3a14e22bb9ad9cf49a1f2ac4816419a1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f5e448e6796acaf45ade2372e1ddab50
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 045c19f92b5bfe1428f2c427da4fe64d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
using UnityEngine;
namespace VRSample.Interactions
{
public class ObjectPlacer : MonoBehaviour
{
[field: SerializeField]
public GameObject ObjectToPlace { get; set; }
[field: SerializeField]
public LayerMask Mask { get; set; }
public bool IsPlacing => ObjectToPlace != null;
public void Place()
{
ObjectToPlace = null;
}
public bool CancelPlace()
{
if (!IsPlacing) return false;
Destroy(ObjectToPlace);
return true;
}
protected void UpdateObjectLocation()
{
if (!IsPlacing) return;
if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out RaycastHit hit, Mathf.Infinity))
{
ObjectToPlace.transform.position = hit.point;
}
}
public void Update()
{
UpdateObjectLocation();
}
}
}
@@ -0,0 +1,101 @@
using System;
using Speckle.ConnectorUnity.Components;
using UnityEngine;
using VRSample.Speckle_Helpers;
using VRSample.UI.Controllers;
namespace VRSample.Interactions
{
/// <summary>
/// Behaviour for performing receive/send interactions with Speckle using <see cref="SelectionController"/>
/// </summary>
[RequireComponent(typeof(SelectionController), typeof(SpeckleReceiver), typeof(VRSender))]
public class SpeckleInteractionMenu : MonoBehaviour
{
private SelectionController uiController;
private SpeckleReceiver receiver;
private VRSender sender;
public int streamLimit = 15;
public int branchLimit = 10;
public int commitLimit = 10;
void Awake()
{
uiController = GetComponent<SelectionController>();
receiver = GetComponent<SpeckleReceiver>();
sender = GetComponent<VRSender>();
}
void OnEnable()
{
FocusStreamSelection();
receiver.Stream.StreamsLimit = streamLimit;
receiver.Branch.BranchesLimit = branchLimit;
receiver.Branch.CommitsLimit = commitLimit;
}
private void FocusAccountSelection()
{
void RefreshAction()
{
receiver.Account.RefreshOptions();
FocusAccountSelection();
}
SetupNavigation(RefreshAction, Application.Quit, "Exit");
uiController.GenerateOptions(receiver.Account, FocusStreamSelection);
}
private void FocusStreamSelection()
{
void RefreshAction()
{
receiver.Stream.RefreshOptions();
FocusStreamSelection();
}
SetupNavigation(RefreshAction, FocusAccountSelection, "Accounts");
uiController.GenerateOptions(receiver.Stream, FocusBranchSelection);
}
private void FocusBranchSelection()
{
void RefreshAction()
{
receiver.Branch.RefreshOptions();
FocusBranchSelection();
}
SetupNavigation(RefreshAction, FocusStreamSelection, "Streams");
uiController.GenerateOptions(receiver.Branch, FocusCommitSelection);
}
private void FocusCommitSelection()
{
void RefreshAction()
{
receiver.Commit.RefreshOptions();
FocusCommitSelection();
}
SetupNavigation(RefreshAction, FocusBranchSelection, "Branches");
uiController.ClearOptionViews();
uiController.CreateSendView(() =>
{
StartCoroutine(sender.ConvertAndSend(receiver.Account.Client, receiver.Stream.Selected, receiver.Branch.Selected));
});
uiController.CreateOptionViews(receiver.Commit, () =>
{
StartCoroutine(receiver.ReceiveAndConvertRoutine(receiver, "Test"));
});
}
private void SetupNavigation(Action refresh, Action back, string backText = "Back")
{
//ideally this class would not be directly interfacing TMP elements
uiController.RefreshButton.onClick.RemoveAllListeners();
uiController.RefreshButton.onClick.AddListener(refresh.Invoke);
uiController.BackButton.onClick.RemoveAllListeners();
uiController.BackButton.onClick.AddListener(back.Invoke);
uiController.BackText.text = backText;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7902d1dc0d99ef444b1dab4ff7e2f9e8
guid: 8f78af59fb7c4734294308331bee7ccf
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,20 @@
{
"name": "VRSample.Interactions",
"rootNamespace": "VRSample",
"references": [
"GUID:e6adfdc4e436206479f48eafc82f32b5",
"GUID:0974e3d3d7d81e146928149497404619",
"GUID:d274441ecc3eb3f43b093eec1503d681",
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:0f85c4b228372584c93cf3cf0ff105d4"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4d43f6160b02d8a4d8819b3033af3330
guid: c957d75b3c5cae341a5f3b22414f071e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
-43
View File
@@ -1,43 +0,0 @@
using UnityEngine;
public class ObjectPlacer : MonoBehaviour
{
[field: SerializeField]
public GameObject ObjectToPlace { get; set; }
[field: SerializeField]
public LayerMask Mask { get; set; }
public bool IsPlacing => ObjectToPlace != null;
public void Place()
{
ObjectToPlace = null;
}
public bool CancelPlace()
{
if (!IsPlacing) return false;
Destroy(ObjectToPlace);
return true;
}
protected void UpdateObjectLocation()
{
if (!IsPlacing) return;
if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out RaycastHit hit, Mathf.Infinity))
{
ObjectToPlace.transform.position = hit.point;
}
}
public void Update()
{
UpdateObjectLocation();
}
}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6b52be48890e02479bb141dd652caa1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,8 @@
{
"name": "VRSample/SpeckleUtils",
"name": "VRSample.SpeckleHelpers",
"rootNamespace": "VRSample",
"references": [
"GUID:eed1b8b83e2c0074d9e5de2348e3ff72"
"GUID:e6adfdc4e436206479f48eafc82f32b5"
],
"includePlatforms": [],
"excludePlatforms": [],
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0f85c4b228372584c93cf3cf0ff105d4
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,67 @@
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Speckle.ConnectorUnity.Components;
using Speckle.Core.Api;
using Speckle.Core.Models;
using Speckle.Core.Transports;
using UnityEngine;
namespace VRSample.Speckle_Helpers
{
/// <summary>
/// A custom speckle sender that adds sending as a coroutine
/// This functionality might be added to SpeckleSender sometime.
/// </summary>
[RequireComponent(typeof(RecursiveConverter))]
public class VRSender : MonoBehaviour
{
public GameObject environment;
private RecursiveConverter converter;
private CancellationTokenSource tokenSource;
void Awake()
{
converter = GetComponent<RecursiveConverter>();
}
public IEnumerator ConvertAndSend(Client client, Stream stream, Branch branch)
{
Base b = converter.RecursivelyConvertToSpeckle(environment, _ => true);
yield return null;
Task.Run(async () =>
{
string commitId = await SendDataAsync(b, client, stream, branch);
});
}
public async Task<string> SendDataAsync(Base data, Client client, Stream stream, Branch branch)
{
tokenSource?.Cancel();
tokenSource?.Dispose();
tokenSource = new CancellationTokenSource();
ServerTransport transport = new ServerTransport(client.Account, stream.id);
transport.CancellationToken = tokenSource.Token;
return await SpeckleSender.SendDataAsync(tokenSource.Token,
remoteTransport: transport,
data: data,
client: client,
branchName: branch.name,
createCommit: true,
onProgressAction: dict => _ = 0,
onErrorAction: (m, e) => Debug.LogError($"{m}\n{e}", this)
);
}
public void OnDestroy()
{
tokenSource?.Cancel();
tokenSource?.Dispose();
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3209d887661ff6845865e9021f5c2fce
guid: 4f6d4f4e5e440894e80603896da2c83f
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -1,83 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using GraphQL;
using Speckle.Core.Api;
using Speckle.Core.Logging;
namespace VRSample.SpeckleUtils
{
public static class APIExtensions
{
public static async Task<List<Stream>> GetStreamWithBranches(this Client client,
CancellationToken cancellationToken,
int streamLimit = 10,
int branchLimit = 10,
int commitLimit = 1)
{
List<Stream> items;
try
{
GraphQLRequest request = new()
{
Query = StreamWithBranchesQuery,
Variables = new {sLimit = streamLimit, bLimit = branchLimit, cLimit = commitLimit}
};
GraphQLResponse<UserData> graphQlResponse = await client.GQLClient
.SendMutationAsync<UserData>(request, cancellationToken).ConfigureAwait(false);
if (graphQlResponse.Errors != null)
throw new SpeckleException("Could not get streams", graphQlResponse.Errors);
items = graphQlResponse.Data.user.streams.items;
}
catch (Exception ex)
{
throw new SpeckleException(ex.Message, ex);
}
return items;
}
private const string StreamWithBranchesQuery =
@"query streamFetch($sLimit: Int!, $bLimit: Int!, $cLimit: Int!) {
user {
id
name
streams(limit: $sLimit){
items {
id
name
description
isPublic
role
createdAt
updatedAt
favoritedDate
branches(limit: $bLimit) {
totalCount
items{
id
name
description
commits(limit: $cLimit) {
totalCount
items{
id
message
branchName
authorName
authorId
createdAt
sourceApplication
referencedObject
}
}
}
}
}
}
}
}";
}
}
@@ -1,108 +0,0 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Sentry;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Kits;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Transports;
using UnityEngine;
#nullable enable
namespace VRSample.SpeckleUtils
{
public class SpeckleReceiver : IDisposable
{
protected ITransport LocalCache;
protected List<IDisposable?> activeTransports;
public SpeckleReceiver()
{
activeTransports = new List<IDisposable?>();
#if UNITY_STANDALONE
SQLiteTransport SQLiteCache = new();
LocalCache = SQLiteCache;
activeTransports.Add(SQLiteCache);
#else
LocalCache = new MemoryTransport();
#endif
}
public async Task<Base> ReceiveCommit(Client client, string streamId,
Commit commit,
CancellationToken cancellationToken,
Action<ConcurrentDictionary<string, int>>? onProgressAction = null,
Action<string, Exception>? onErrorAction = null,
Action<int>? onTotalChildrenCountKnown = null)
{
var Base = await ReceiveObject(client.Account, streamId, commit.referencedObject, cancellationToken, onProgressAction, onErrorAction, onTotalChildrenCountKnown);
try //Read receipt
{
await client.CommitReceived(cancellationToken, new CommitReceivedInput
{
streamId = streamId,
commitId = commit.id,
message = "received commit from " + VersionedHostApplications.Unity,
sourceApplication = VersionedHostApplications.Unity
});
}
catch(Exception e)
{
// Do nothing!
Debug.LogWarning(e);
}
return Base;
}
public async Task<Base> ReceiveObject(Account account, string streamId,
string objectId,
CancellationToken cancellationToken,
Action<ConcurrentDictionary<string, int>>? onProgressAction = null,
Action<string, Exception>? onErrorAction = null,
Action<int>? onTotalChildrenCountKnown = null)
{
ServerTransport? transport = new (account, streamId);
activeTransports.Add(transport);
try
{
Base @base = await Operations.Receive(
objectId,
remoteTransport: transport,
localTransport: LocalCache,
onErrorAction: onErrorAction,
onProgressAction: onProgressAction,
onTotalChildrenCountKnown: onTotalChildrenCountKnown,
cancellationToken: cancellationToken);
return @base;
}
catch (Exception e)
{
throw new SpeckleException(e.Message, e, true, SentryLevel.Error);
}
finally
{
activeTransports.Remove(transport);
transport?.Dispose();
}
}
public void Dispose()
{
foreach (IDisposable? transport in activeTransports)
{
transport?.Dispose();
}
activeTransports.Clear();
}
}
}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cc58830ac7ca59a49b26023cb50ae108
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+147
View File
@@ -0,0 +1,147 @@
fileFormatVersion: 2
guid: ecb2d652f08abc34d82634be797ccf31
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,97 @@
using System;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace VRSample.UI.Components
{
/// <summary>
/// Generic UI component for option selection.
/// </summary>
/// <seealso cref="VRSample.UI.Controllers.SelectionController"/>
public sealed class OptionViewComponent : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public RawImage Image { get; private set; }
public TMP_Text TitleText { get; private set; }
public TMP_Text DescriptionText { get; private set; }
public TMP_Text SelectButtonText { get; private set; }
public Button SelectButton { get; private set; }
private GameObject hoverGroup;
public void Initialise(string title, string description, Action onClickHandler, string selectButtonText = "Select")
{
TitleText.text = title;
DescriptionText.text = description;
SelectButtonText.text = selectButtonText;
SelectButton.onClick.AddListener(onClickHandler.Invoke);
}
// public void Initialise(Stream streamDetails, Texture previewImage, Action<string, Commit> onClickHandler)
// {
// Image.texture = previewImage;
// TitleText.text = streamDetails.name;
// var UpdatedAt = FormatTime(DateTime.Parse(streamDetails.updatedAt));
// DescriptionText.text = $"Updated {UpdatedAt} ago";
//
// List<TMP_Dropdown.OptionData> branchOptions = new(streamDetails.branches.items.Count);
// foreach (Branch b in streamDetails.branches.items)
// {
// branchOptions.Add(new TMP_Dropdown.OptionData(b.name));
// }
//
//
// SelectButton.onClick.AddListener(() =>
// {
// Debug.Log("button pressed");
//
// Branch selectedBranch = streamDetails.branches.items.FirstOrDefault(b => b.name == selectedBranchName);
// Commit selectedCommit = selectedBranch?.commits.items.FirstOrDefault();
// if (selectedCommit == null) return;
//
// onClickHandler(streamDetails.id, selectedCommit);
// });
// }
// protected static string FormatTime(DateTime updatedAt)
// {
// TimeSpan dt = DateTime.Now - updatedAt;
//
// if (dt.Days == 1) return $"{dt.Days} day";
// if (dt.Days >= 1) return $"{dt.Days} days";
// if (dt.Hours == 1) return $"{dt.Hours} hour";
// if (dt.Hours >= 1) return $"{dt.Hours} hours";
// if(dt.Minutes == 1) return $"{dt.Minutes} minute";
// if(dt.Minutes >= 1) return $"{dt.Minutes} minutes";
// return $"{dt.Seconds} seconds";
// }
void Awake()
{
//TODO: update
SelectButton = GetComponentsInChildren<Button>(true).First(c => c.name == "Button");
SelectButtonText = GetComponentsInChildren<TMP_Text>(true).First(c => c.name == "Button Text");
TitleText = GetComponentsInChildren<TMP_Text>(true).First(c => c.name == "View Name Text");
DescriptionText = GetComponentsInChildren<TMP_Text>(true).First(c => c.name == "View Description Text");
Image = GetComponentsInChildren<RawImage>(true).First(c => c.name == "View Preview Image");
hoverGroup = GetComponentsInChildren<Transform>(true).First(c => c.name == "Hover").gameObject;
hoverGroup.SetActive(false);
}
public void OnPointerEnter(PointerEventData eventData)
{
hoverGroup.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
hoverGroup.SetActive(false);
}
}
}
@@ -1,86 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Speckle.Core.Api;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace VRSample.UI.Components
{
public class StreamViewComponent : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public RawImage PreviewImage { get; protected set; }
public TMP_Text TitleText { get; protected set; }
public TMP_Dropdown BranchSelection { get; protected set; }
public TMP_Text UpdatedAtText { get; protected set; }
public Button Button { get; protected set; }
private GameObject hoverGroup;
public void Initialise(Stream streamDetails, Texture previewImage, Action<string, Commit> onClickHandler)
{
PreviewImage.texture = previewImage;
TitleText.text = streamDetails.name;
var UpdatedAt = FormatTime(DateTime.Parse(streamDetails.updatedAt));
UpdatedAtText.text = $"Updated {UpdatedAt} ago";
List<TMP_Dropdown.OptionData> branchOptions = new(streamDetails.branches.items.Count);
foreach (Branch b in streamDetails.branches.items)
{
branchOptions.Add(new TMP_Dropdown.OptionData(b.name));
}
BranchSelection.options = branchOptions;
if(branchOptions.Count > 0) BranchSelection.value = 0;
Button.onClick.AddListener(() =>
{
Debug.Log("button pressed");
string selectedBranchName = BranchSelection.options[BranchSelection.value].text;
Branch selectedBranch = streamDetails.branches.items.FirstOrDefault(b => b.name == selectedBranchName);
Commit selectedCommit = selectedBranch?.commits.items.FirstOrDefault();
if (selectedCommit == null) return;
onClickHandler(streamDetails.id, selectedCommit);
});
}
protected static string FormatTime(DateTime updatedAt)
{
TimeSpan dt = DateTime.Now - updatedAt;
if (dt.Days == 1) return $"{dt.Days} day";
if (dt.Days >= 1) return $"{dt.Days} days";
if (dt.Hours == 1) return $"{dt.Hours} hour";
if (dt.Hours >= 1) return $"{dt.Hours} hours";
if(dt.Minutes == 1) return $"{dt.Minutes} minute";
if(dt.Minutes >= 1) return $"{dt.Minutes} minutes";
return $"{dt.Seconds} seconds";
}
void Awake()
{
Button = GetComponentsInChildren<Button>(true).First(c => c.name == "Receive Button");;
TitleText = GetComponentsInChildren<TMP_Text>(true).First(c => c.name == "Stream Name Text");
UpdatedAtText = GetComponentsInChildren<TMP_Text>(true).First(c => c.name == "Stream Updated Text");
PreviewImage = GetComponentsInChildren<RawImage>(true).First(c => c.name == "Stream Preview Image");
BranchSelection = GetComponentsInChildren<TMP_Dropdown>(true).First(c => c.name == "Branch Selection Dropdown");
hoverGroup = GetComponentsInChildren<Transform>(true).First(c => c.name == "Hover").gameObject;
hoverGroup.SetActive(false);
}
public void OnPointerEnter(PointerEventData eventData)
{
hoverGroup.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
hoverGroup.SetActive(false);
}
}
}
@@ -0,0 +1,215 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Speckle.ConnectorUnity.Utils;
using Speckle.ConnectorUnity.Wrappers.Selection;
using Speckle.Core.Credentials;
using UnityEngine;
using UnityEngine.UI;
using VRSample.UI.Components;
using Text = TMPro.TMP_Text;
namespace VRSample.UI.Controllers
{
/// <summary>
/// Reusable UI Controller for selecting account/stream/branch/commit options
/// </summary>
/// <seealso cref="OptionSelection{TOption}"/>
[DisallowMultipleComponent]
public class SelectionController : MonoBehaviour
{
[field: SerializeField]
public Transform ContentTarget { get; set; }
[field: SerializeField]
public OptionViewComponent OptionViewPrefab { get; set; }
[field: SerializeField]
public Texture SendIcon { get; set; }
public Button BackButton { get; private set; }
public Text BackText { get; private set; }
public Button RefreshButton { get; private set; }
public void GenerateOptions<T>(OptionSelection<T> optionSelection, Action onSelect) where T : class
{
ClearOptionViews();
CreateOptionViews(optionSelection, onSelect);
}
public OptionViewComponent CreateSendView(Action onSelect)
{
string title = "Create new commit";
string description = "Send current scene as a new commit";
OptionViewComponent optionElement = Instantiate(OptionViewPrefab, ContentTarget);
optionElement.Initialise(title, description, () =>
{
onSelect.Invoke();
}, "Send");
SetImage(optionElement, SendIcon);
return optionElement;
}
public List<OptionViewComponent> CreateOptionViews<T>(OptionSelection<T> optionSelection, Action callback) where T : class
{
List<OptionViewComponent> views = new List<OptionViewComponent>(optionSelection.Options.Length);
for (int i = 0; i < optionSelection.Options.Length; i++)
{
//TODO not the cleanest solution, but for now it's ok
var view = optionSelection switch
{
AccountSelection a => CreateAccountView(a, i, callback),
StreamSelection s => CreateStreamView(s, i, callback),
BranchSelection b => CreateBranchView(b, i, callback),
CommitSelection c => CreateCommitView(c, i, callback),
_ => throw new ArgumentException($"Argument of unexpected type: {optionSelection.GetType()}",
nameof(optionSelection))
};
views.Add(view);
}
return views;
}
public void ClearOptionViews()
{
foreach (var child in ContentTarget.GetComponentsInChildren<OptionViewComponent>())
{
Destroy(child.gameObject);
}
}
private static void SetImage(OptionViewComponent optionElement, Texture image)
{
optionElement.Image.texture = image;
var rect = optionElement.Image.rectTransform;
var width = (40 * 4) * ((float)image.width / image.height);
var height = rect.sizeDelta.y;
rect.sizeDelta = new Vector2(width, height);
}
private OptionViewComponent CreateAccountView(AccountSelection selection, int index, Action onSelect)
{
Account a = selection.Options[index];
var serverInfo = a.serverInfo;
var userInfo = a.userInfo;
string title = $"{serverInfo.name} | {serverInfo.url}";
string description = $"{userInfo.name} | {userInfo.email}";
Texture2D avatar = new Texture2D (1, 1);
avatar.LoadImage(Convert.FromBase64String(userInfo.avatar.Split(',')[^1]));
avatar.Apply();
OptionViewComponent optionElement = Instantiate(OptionViewPrefab, ContentTarget);
optionElement.Initialise(title, description, () =>
{
selection.SelectedIndex = index;
onSelect.Invoke();
});
SetImage(optionElement, avatar);
return optionElement;
}
private OptionViewComponent CreateStreamView(StreamSelection selection, int index, Action onSelect)
{
var s = selection.Options[index];
string title = $"{s.name} | {s.id}";
string description = $"Updated {FormatTime(s.updatedAt)} ago : {s.description}";
string imageurl = $"{selection.Client.ServerUrl}/preview/{s.id}";
OptionViewComponent optionElement = Instantiate(OptionViewPrefab, ContentTarget);
optionElement.Initialise(title, description, () =>
{
selection.SelectedIndex = index;
onSelect.Invoke();
});
StartCoroutine(Utils.GetImageRoutine(imageurl,
selection.Client.ApiToken,
t => SetImage(optionElement, t))
);
return optionElement;
}
private OptionViewComponent CreateBranchView(BranchSelection selection, int index, Action onSelect)
{
var stream = selection.StreamSelection.Selected;
var b = selection.Options[index];
string title = b.name;
string description = b.description;
string imageurl = $"{selection.Client.ServerUrl}/preview/{stream.id}/branches/{b.name}";
OptionViewComponent optionElement = Instantiate(OptionViewPrefab, ContentTarget);
optionElement.Initialise(title, description, () =>
{
selection.SelectedIndex = index;
onSelect.Invoke();
});
StartCoroutine(Utils.GetImageRoutine(imageurl,
selection.Client.ApiToken,
t => SetImage(optionElement, t))
);
return optionElement;
}
private OptionViewComponent CreateCommitView(CommitSelection selection, int index, Action onSelect)
{
var stream = selection.BranchSelection.StreamSelection.Selected;
var c = selection.Options[index];
string title = $"{c.message} | {c.id}";
string description = $"{c.sourceApplication} - {FormatTime(DateTime.Parse(c.createdAt))} ago";
string imageurl = $"{selection.Client.ServerUrl}/preview/{stream.id}/commits/{c.id}";
OptionViewComponent optionElement = Instantiate(OptionViewPrefab, ContentTarget);
optionElement.Initialise(title, description, () =>
{
selection.SelectedIndex = index;
onSelect.Invoke();
}, "Receive");
StartCoroutine(Utils.GetImageRoutine(imageurl,
selection.Client.ApiToken,
t => SetImage(optionElement, t))
);
return optionElement;
}
void Awake()
{
var buttons = GetComponentsInChildren<Button>();
RefreshButton = buttons.First(b => b.name == "Refresh Button");
BackButton = buttons.First(b => b.name == "Back Button");
BackText = BackButton.GetComponentInChildren<Text>();
}
void OnDisable()
{
ClearOptionViews();
}
public static string FormatTime(string time)
{
return FormatTime(DateTime.Parse(time));
}
public static string FormatTime(DateTime updatedAt)
{
TimeSpan dt = DateTime.Now - updatedAt;
if (dt.Days >= 2) return $"{dt.Days} days";
if (dt.Hours == 1) return $"{dt.Hours} hour";
if (dt.Hours >= 1) return $"{dt.Hours} hours";
if (dt.Minutes == 1) return $"{dt.Minutes} minute";
if (dt.Minutes >= 1) return $"{dt.Minutes} minutes";
return $"{dt.Seconds} seconds";
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 693e29cb1817d6248947db7b5924a3b5
guid: 323556ae874f1704b98c3ef8b8be3efa
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -1,162 +0,0 @@
using System.Threading;
using System.Threading.Tasks;
using Speckle.ConnectorUnity;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Models;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.XR.Interaction.Toolkit;
using VRSample.SpeckleUtils;
using VRSample.UI.Components;
using Text = TMPro.TMP_Text;
namespace VRSample.UI.Controllers
{
[DisallowMultipleComponent, RequireComponent(typeof(SpeckleReceiver), typeof(RecursiveConverter))]
public class StreamSelectionMenu : MonoBehaviour
{
[field: SerializeField, Range(1, 100)]
public int NumberOfStreams { get; set; } = 10;
[field: SerializeField]
public Transform ContentTarget { get; set; }
[field: SerializeField]
public StreamViewComponent StreamViewPrefab { get; set; }
[field: SerializeField]
public GameObject GeometryInteractorPrefab { get; set; }
public XRInteractionManager XRInteractionManager;
public bool SendMode;
public SpeckleReceiver Receiver { get; private set; }
protected Client speckleClient;
protected CancellationTokenSource cancellationTokenSource;
private RecursiveConverter rc;
protected virtual void Awake()
{
rc = GetComponent<RecursiveConverter>();
Receiver = new SpeckleReceiver();
Account acc = AccountManager.GetDefaultAccount();
Debug.Assert(acc != null, "No Speckle account found!", this);
Debug.Assert(StreamViewPrefab != null, $"{nameof(StreamViewPrefab)} must be set set!", this);
speckleClient = new Client(acc);
}
protected async Task GenerateOptions()
{
var streams = speckleClient.GetStreamWithBranches(cancellationTokenSource.Token, NumberOfStreams);
ClearOptions();
foreach (var stream in await streams)
{
Texture previewImage = await GetImage($"{speckleClient.Account.serverInfo.url}/preview/{stream.id}", speckleClient.Account.token, cancellationTokenSource.Token);
StreamViewComponent streamElement = Instantiate(StreamViewPrefab, ContentTarget);
streamElement.Initialise(stream, previewImage, OnClick);
}
}
protected void OnClick(string streamId, Commit commit)
{
if (SendMode) Send(streamId);
else Receive(streamId, commit);
}
protected void Receive(string streamId, Commit commit)
{
Task.Run(async () =>
{
Base commitObject = await Receiver.ReceiveCommit(speckleClient, streamId, commit, cancellationTokenSource.Token);
Dispatcher.Instance().Enqueue(() =>
{
//Create parent
var parent = Instantiate(GeometryInteractorPrefab);
var interactable = parent.GetComponent<XRGrabInteractable>();
XRInteractionManager.RegisterInteractable((IXRInteractable)interactable);
//convert to native
rc.RecursivelyConvertToNative(commitObject, parent.transform);
// Add colliders
foreach (MeshFilter mesh in parent.GetComponentsInChildren<MeshFilter>())
{
var col = mesh.gameObject.AddComponent<BoxCollider>();
interactable.colliders.Add(col);
}
//todo remove old
});
});
}
protected static async Task<Texture2D> GetImage(string url, string authToken, CancellationToken cancellationToken)
{
using UnityWebRequest www = UnityWebRequestTexture.GetTexture(url);
www.SetRequestHeader("Authorization", $"Bearer {authToken}");
UnityWebRequestAsyncOperation request = www.SendWebRequest();
while (!request.isDone)
{
if (cancellationToken.IsCancellationRequested) return null;
await Task.Delay(100);
}
if(www.result != UnityWebRequest.Result.Success )
{
Debug.Log( $"Error fetching image from {www.url}: {www.error}" );
return null;
}
return DownloadHandlerTexture.GetContent(www);
}
protected void ClearOptions()
{
foreach (var child in ContentTarget.GetComponentsInChildren<StreamViewComponent>())
{
Destroy(child.gameObject);
}
}
protected async void OnEnable()
{
cancellationTokenSource = new CancellationTokenSource();
await GenerateOptions();
}
protected void OnDisable()
{
cancellationTokenSource.Cancel();
ClearOptions();
}
public void Send(string streamId)
{
rc.RecursivelyConvertToSpeckle(SceneManager.GetActiveScene().GetRootGameObjects(),
o => true);
//todo send.
}
public void Exit()
{
Application.Quit();
}
}
}
+5 -3
View File
@@ -2,11 +2,13 @@
"name": "VRSample.UI",
"rootNamespace": "VRSample",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:eed1b8b83e2c0074d9e5de2348e3ff72",
"GUID:4d43f6160b02d8a4d8819b3033af3330",
"GUID:e6adfdc4e436206479f48eafc82f32b5",
"GUID:d274441ecc3eb3f43b093eec1503d681",
"GUID:50d889142fdf9de4b8501c6eaa4b3225",
"GUID:2bafac87e7f4b9b418d9448d219b01ab",
"GUID:fe685ec1767f73d42b749ea8045bfe43"
"GUID:fe685ec1767f73d42b749ea8045bfe43",
"GUID:6055be8ebefd69e48b49212b09b47b2f"
],
"includePlatforms": [],
"excludePlatforms": [],
@@ -199,6 +199,29 @@ MonoBehaviour:
company: Unity
priority: 0
required: 0
targetQuest: 1
targetQuest2: 1
--- !u!114 &-1286505800156943340
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: 7de993716e042c6499d0c18eed3a773c, type: 3}
m_Name: MockRuntime Android
m_EditorClassIdentifier:
m_enabled: 0
nameUi: Mock Runtime
version: 0.0.2
featureIdInternal: com.unity.openxr.feature.mockruntime
openxrExtensionStrings: XR_UNITY_null_gfx XR_UNITY_android_present
company: Unity
priority: 0
required: 0
ignoreValidationErrors: 0
--- !u!114 &-495261751149285054
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -397,7 +420,7 @@ MonoBehaviour:
nameUi: Mock Runtime
version: 0.0.2
featureIdInternal: com.unity.openxr.feature.mockruntime
openxrExtensionStrings: XR_UNITY_null_gfx
openxrExtensionStrings: XR_UNITY_null_gfx XR_UNITY_android_present
company: Unity
priority: 0
required: 0
@@ -419,6 +442,7 @@ MonoBehaviour:
- {fileID: 4914851518704656994}
- {fileID: 5334558063051258675}
- {fileID: -6685596103840964779}
- {fileID: -1286505800156943340}
- {fileID: -1732360690052733040}
- {fileID: -3465257370404214830}
- {fileID: -2131481153726147014}
+7 -8
View File
@@ -1,20 +1,19 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.15.18",
"com.unity.ide.rider": "3.0.15",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.rider": "3.0.17",
"com.unity.ide.visualstudio": "2.0.17",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.31",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.2",
"com.unity.ui": "2.0.0",
"com.unity.visualscripting": "1.7.8",
"com.unity.xr.interaction.toolkit": "2.0.2",
"com.unity.xr.interaction.toolkit": "2.0.4",
"com.unity.xr.management": "4.2.1",
"com.unity.xr.oculus": "3.0.2",
"com.unity.xr.openxr": "1.4.2",
"systems.speckle.speckle-unity": "https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity#unity-to-bim",
"com.unity.xr.oculus": "3.2.2",
"com.unity.xr.openxr": "1.5.3",
"systems.speckle.speckle-unity": "https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
+12 -39
View File
@@ -1,14 +1,5 @@
{
"dependencies": {
"com.unity.collab-proxy": {
"version": "1.15.18",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
@@ -17,7 +8,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.15",
"version": "3.0.17",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -26,7 +17,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.16",
"version": "2.0.17",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -42,7 +33,7 @@
"url": "https://packages.unity.com"
},
"com.unity.inputsystem": {
"version": "1.3.0",
"version": "1.4.4",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -50,24 +41,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.4.0",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.subsystemregistration": {
"version": "1.1.0",
"depth": 1,
@@ -94,7 +67,7 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.31",
"version": "1.1.33",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -170,11 +143,11 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.interaction.toolkit": {
"version": "2.0.2",
"version": "2.0.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.inputsystem": "1.2.0",
"com.unity.inputsystem": "1.3.0",
"com.unity.ugui": "1.0.0",
"com.unity.xr.core-utils": "2.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.8",
@@ -185,7 +158,7 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.9",
"version": "2.1.10",
"depth": 1,
"source": "registry",
"dependencies": {
@@ -208,7 +181,7 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.oculus": {
"version": "3.0.2",
"version": "3.2.2",
"depth": 0,
"source": "registry",
"dependencies": {
@@ -217,22 +190,22 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.openxr": {
"version": "1.4.2",
"version": "1.5.3",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.xr.management": "4.0.1",
"com.unity.xr.legacyinputhelpers": "2.1.2",
"com.unity.inputsystem": "1.3.0"
"com.unity.inputsystem": "1.4.2"
},
"url": "https://packages.unity.com"
},
"systems.speckle.speckle-unity": {
"version": "https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity#unity-to-bim",
"version": "https://github.com/specklesystems/speckle-unity.git?path=/Packages/systems.speckle.speckle-unity",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "de1e154065b6b01d210118a32b2f462b7fe3f25d"
"hash": "d1a0a6663981194d8df9b201e3ca5422fe4c8278"
},
"com.unity.modules.ai": {
"version": "1.0.0",
+6
View File
@@ -380,6 +380,7 @@ PlayerSettings:
- m_BuildTarget: WebGL
m_StaticBatching: 0
m_DynamicBatching: 0
m_BuildTargetShaderSettings: []
m_BuildTargetGraphicsJobs:
- m_BuildTarget: MacStandaloneSupport
m_GraphicsJobs: 0
@@ -431,6 +432,8 @@ PlayerSettings:
m_Devices:
- Oculus
- OpenVR
m_DefaultShaderChunkSizeInMB: 16
m_DefaultShaderChunkCount: 0
openGLRequireES31: 0
openGLRequireES31AEP: 0
openGLRequireES32: 0
@@ -690,6 +693,7 @@ PlayerSettings:
webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
webGLPowerPreference: 2
scriptingDefineSymbols: {}
additionalCompilerArguments: {}
platformArchitecture: {}
@@ -701,6 +705,7 @@ PlayerSettings:
allowUnsafeCode: 0
useDeterministicCompilation: 1
enableRoslynAnalyzers: 1
selectedPlatform: 0
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
@@ -779,6 +784,7 @@ PlayerSettings:
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 1
windowsGamepadBackendHint: 0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
+2 -2
View File
@@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.5f1
m_EditorVersionWithRevision: 2021.3.5f1 (40eb3a945986)
m_EditorVersion: 2021.3.14f1
m_EditorVersionWithRevision: 2021.3.14f1 (eee1884e7226)