From 7fb1053be70c9b73efd970ce5cc9f2d2099858c5 Mon Sep 17 00:00:00 2001 From: tverona1 Date: Sun, 21 Jul 2019 18:56:25 -0700 Subject: [PATCH] Added custom grid size support in config.json - Added support for config.json - Added custom grid size support in config.json (see readme for instructions) --- Assets/Oculus/VR/Scenes.meta | 8 + Assets/Scenes/QuestAppLauncher.unity | 1311 +++++++++++++++++++++++++- Assets/Scripts/Config.cs | 79 ++ Assets/Scripts/Config.cs.meta | 11 + Assets/Scripts/GridPopulation.cs | 71 ++ Assets/Scripts/OnInteraction.cs | 111 +-- Assets/Scripts/ScrollRectOverride.cs | 93 +- Assets/Scripts/SettingsHandler.cs | 64 +- README.md | 25 +- 9 files changed, 1624 insertions(+), 149 deletions(-) create mode 100644 Assets/Oculus/VR/Scenes.meta create mode 100644 Assets/Scripts/Config.cs create mode 100644 Assets/Scripts/Config.cs.meta diff --git a/Assets/Oculus/VR/Scenes.meta b/Assets/Oculus/VR/Scenes.meta new file mode 100644 index 0000000..d36956a --- /dev/null +++ b/Assets/Oculus/VR/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6269b6df21455a244a60057eaa3ff7af +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/QuestAppLauncher.unity b/Assets/Scenes/QuestAppLauncher.unity index 1fddc22..7a695fd 100644 --- a/Assets/Scenes/QuestAppLauncher.unity +++ b/Assets/Scenes/QuestAppLauncher.unity @@ -120,6 +120,96 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &12585780 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 12585781} + - component: {fileID: 12585784} + - component: {fileID: 12585783} + - component: {fileID: 12585782} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &12585781 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12585780} + 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: + - {fileID: 1791228287} + m_Father: {fileID: 636120851} + 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: -797, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &12585782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12585780} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10917, 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!222 &12585783 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12585780} + m_CullTransparentMesh: 0 +--- !u!114 &12585784 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 12585780} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 --- !u!1 &61603938 GameObject: m_ObjectHideFlags: 0 @@ -243,9 +333,9 @@ RectTransform: m_Father: {fileID: 1113839879} m_RootOrder: 1 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: 1043} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 43} m_SizeDelta: {x: 200, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &129491543 @@ -441,7 +531,7 @@ MonoBehaviour: m_StartAxis: 0 m_CellSize: {x: 834, y: 548} m_Spacing: {x: 75, y: 75} - m_Constraint: 1 + m_Constraint: 0 m_ConstraintCount: 3 --- !u!1001 &174121771 PrefabInstance: @@ -520,6 +610,238 @@ Transform: type: 3} m_PrefabInstance: {fileID: 174121771} m_PrefabAsset: {fileID: 0} +--- !u!1 &264112577 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 264112578} + - component: {fileID: 264112580} + - component: {fileID: 264112579} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &264112578 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 264112577} + 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: 1181276210} + 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: -7.5, y: -0.5} + m_SizeDelta: {x: -35, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &264112579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 264112577} + 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_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_text: 3x2 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 86 + m_fontSizeBase: 86 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_textAlignment: 514 + 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: 0 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_textInfo: + textComponent: {fileID: 264112579} + characterCount: 3 + spriteCount: 0 + spaceCount: 0 + wordCount: 1 + linkCount: 0 + lineCount: 1 + pageCount: 1 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &264112580 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 264112577} + m_CullTransparentMesh: 0 +--- !u!1 &310743548 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 310743549} + - component: {fileID: 310743551} + - component: {fileID: 310743550} + m_Layer: 5 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &310743549 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 310743548} + 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: 1181276210} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -100, y: 0} + m_SizeDelta: {x: 200, y: 200} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &310743550 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 310743548} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10915, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + 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!222 &310743551 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 310743548} + m_CullTransparentMesh: 0 --- !u!1 &340813588 GameObject: m_ObjectHideFlags: 0 @@ -741,6 +1063,116 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &636120850 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 636120851} + - component: {fileID: 636120854} + - component: {fileID: 636120853} + - component: {fileID: 636120852} + m_Layer: 5 + m_Name: Template + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &636120851 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 636120850} + 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: + - {fileID: 12585781} + - {fileID: 1528747460} + m_Father: {fileID: 1181276210} + 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: 2} + m_SizeDelta: {x: 0, y: 900} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &636120852 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 636120850} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 1791228287} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 12585781} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 1528747461} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &636120853 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 636120850} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, 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!222 &636120854 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 636120850} + m_CullTransparentMesh: 0 --- !u!1 &647218110 GameObject: m_ObjectHideFlags: 0 @@ -875,9 +1307,9 @@ RectTransform: m_Father: {fileID: 1113839879} 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: -1600, y: 930} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: -210, y: -90} m_SizeDelta: {x: 200, y: 180} m_Pivot: {x: 0.5, y: 0.5} --- !u!65 &684313058 @@ -1044,13 +1476,14 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1106898771} + - {fileID: 1181276210} m_Father: {fileID: 1113839879} m_RootOrder: 4 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: 2800, y: 2000} + m_SizeDelta: {x: 2802, y: 2000} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &883330325 MonoBehaviour: @@ -1131,6 +1564,313 @@ MonoBehaviour: openSettingsButton: {fileID: 2124784239} closeSettingsButton: {fileID: 684313056} settingsView: {fileID: 883330323} +--- !u!1 &895284435 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 895284436} + - component: {fileID: 895284438} + - component: {fileID: 895284437} + m_Layer: 5 + m_Name: Item Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &895284436 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 895284435} + 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: 2082488556} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 5, y: -0.5} + m_SizeDelta: {x: -30, y: -3} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &895284437 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 895284435} + 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_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_text: Option A + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 86 + m_fontSizeBase: 86 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_textAlignment: 514 + 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_firstOverflowCharacterIndex: 1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_textInfo: + textComponent: {fileID: 895284437} + characterCount: 8 + spriteCount: 0 + spaceCount: 1 + wordCount: 2 + linkCount: 0 + lineCount: 7 + pageCount: 1 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &895284438 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 895284435} + m_CullTransparentMesh: 0 +--- !u!1 &917792833 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 917792834} + - component: {fileID: 917792836} + - component: {fileID: 917792835} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &917792834 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 917792833} + 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: 1860770149} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0.9999996} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &917792835 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 917792833} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, 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!222 &917792836 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 917792833} + m_CullTransparentMesh: 0 +--- !u!1 &981659072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 981659073} + - component: {fileID: 981659075} + - component: {fileID: 981659074} + m_Layer: 5 + m_Name: Item Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &981659073 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 981659072} + 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: 2082488556} + 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!114 &981659074 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 981659072} + 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.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + 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!222 &981659075 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 981659072} + m_CullTransparentMesh: 0 --- !u!1 &985952871 GameObject: m_ObjectHideFlags: 0 @@ -1207,6 +1947,81 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1011454787 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1011454788} + - component: {fileID: 1011454790} + - component: {fileID: 1011454789} + m_Layer: 5 + m_Name: Item Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1011454788 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011454787} + 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: 2082488556} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 10, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1011454789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011454787} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + 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!222 &1011454790 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011454787} + m_CullTransparentMesh: 0 --- !u!1 &1086705924 GameObject: m_ObjectHideFlags: 0 @@ -1570,9 +2385,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 2.8} - m_SizeDelta: {x: 2800, y: 2000} - m_Pivot: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2802, y: 2000} + m_Pivot: {x: 0.5, y: 0} --- !u!114 &1113839881 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1721,6 +2536,181 @@ MonoBehaviour: m_TypeName: ControllerSelection.OVRRawRaycaster+SelectionCallback, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null activeController: 0 +--- !u!1 &1181276209 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1181276210} + - component: {fileID: 1181276213} + - component: {fileID: 1181276212} + - component: {fileID: 1181276211} + - component: {fileID: 1181276214} + m_Layer: 5 + m_Name: Dropdown_GridSize + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1181276210 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1181276209} + 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: + - {fileID: 264112578} + - {fileID: 310743549} + - {fileID: 636120851} + m_Father: {fileID: 883330324} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 500, y: -425} + m_SizeDelta: {x: 800, y: 150} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1181276211 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1181276209} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + 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: 1181276212} + m_Template: {fileID: 636120851} + m_CaptionText: {fileID: 264112579} + m_CaptionImage: {fileID: 0} + m_ItemText: {fileID: 895284437} + m_ItemImage: {fileID: 0} + m_Value: 0 + m_Options: + m_Options: + - m_Text: 3x2 + m_Image: {fileID: 0} + - m_Text: 3x3 + m_Image: {fileID: 0} + - m_Text: 3x4 + m_Image: {fileID: 0} + - m_Text: 4x2 + m_Image: {fileID: 0} + - m_Text: 4x3 + m_Image: {fileID: 0} + - m_Text: 4x4 + m_Image: {fileID: 0} + - m_Text: 5x2 + m_Image: {fileID: 0} + - m_Text: 5x3 + m_Image: {fileID: 0} + - m_Text: 5x4 + m_Image: {fileID: 0} + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 883330328} + m_MethodName: ResizeGrid + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: TMPro.TMP_Dropdown+DropdownEvent, Unity.TextMeshPro, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1181276212 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1181276209} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, 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!222 &1181276213 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1181276209} + m_CullTransparentMesh: 0 +--- !u!65 &1181276214 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1181276209} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 800, y: 150, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!4 &1192133537 stripped Transform: m_CorrespondingSourceObject: {fileID: 487254, guid: 126d619cf4daa52469682f85c1378b4a, @@ -1824,6 +2814,133 @@ Transform: type: 3} m_PrefabInstance: {fileID: 2047659140} m_PrefabAsset: {fileID: 0} +--- !u!1 &1528747459 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1528747460} + - component: {fileID: 1528747463} + - component: {fileID: 1528747462} + - component: {fileID: 1528747461} + m_Layer: 5 + m_Name: Scrollbar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1528747460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528747459} + 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: + - {fileID: 1860770149} + m_Father: {fileID: 636120851} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 800, y: 0} + m_Pivot: {x: 1, y: 1} +--- !u!114 &1528747461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528747459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + 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: 917792835} + m_HandleRect: {fileID: 917792834} + m_Direction: 2 + m_Value: 0 + m_Size: 1 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Scrollbar+ScrollEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1528747462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528747459} + 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: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + 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!222 &1528747463 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528747459} + m_CullTransparentMesh: 0 --- !u!1 &1684574658 GameObject: m_ObjectHideFlags: 0 @@ -1863,7 +2980,7 @@ RectTransform: 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: 2800, y: 2000} + m_SizeDelta: {x: 2802, y: 2000} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1684574660 MonoBehaviour: @@ -1946,7 +3063,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 2800, y: 2000, z: 0} + m_Size: {x: 2802, y: 2000, z: 0} m_Center: {x: 0, y: 0, z: 0} --- !u!114 &1684574664 MonoBehaviour: @@ -1980,6 +3097,42 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null +--- !u!1 &1791228286 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1791228287} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1791228287 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791228286} + 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: + - {fileID: 2082488556} + m_Father: {fileID: 12585781} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 150} + m_Pivot: {x: 0.5, y: 1} --- !u!1 &1810226044 stripped GameObject: m_CorrespondingSourceObject: {fileID: 100004, guid: 126d619cf4daa52469682f85c1378b4a, @@ -2055,6 +3208,42 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 126d619cf4daa52469682f85c1378b4a, type: 3} +--- !u!1 &1860770148 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1860770149} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1860770149 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1860770148} + 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: + - {fileID: 917792834} + m_Father: {fileID: 1528747460} + 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: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1860838374 GameObject: m_ObjectHideFlags: 0 @@ -2084,6 +3273,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0d75ad87b4f70d345becda5841f29b7a, type: 3} m_Name: m_EditorClassIdentifier: + canvas: {fileID: 1113839878} + scrollView: {fileID: 1684574658} gridContent: {fileID: 159978199} prefab: {fileID: 4824380111246446992, guid: 8767e935b90413e48ae368ff87547352, type: 3} --- !u!4 &1860838376 @@ -2718,6 +3909,94 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 411c0b99f954d1d4884fa0d6256933cf, type: 3} +--- !u!1 &2082488555 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2082488556} + - component: {fileID: 2082488557} + m_Layer: 5 + m_Name: Item + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2082488556 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082488555} + 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: + - {fileID: 981659073} + - {fileID: 1011454788} + - {fileID: 895284436} + m_Father: {fileID: 1791228287} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 150} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2082488557 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082488555} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + 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: 981659074} + toggleTransition: 1 + graphic: {fileID: 1011454789} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 1 --- !u!1 &2108958130 GameObject: m_ObjectHideFlags: 0 @@ -2831,9 +4110,9 @@ RectTransform: m_Father: {fileID: 1113839879} m_RootOrder: 2 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: -1600, y: 930} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: -210, y: -90} m_SizeDelta: {x: 200, y: 180} m_Pivot: {x: 0.5, y: 0.5} --- !u!65 &2124784241 diff --git a/Assets/Scripts/Config.cs b/Assets/Scripts/Config.cs new file mode 100644 index 0000000..e803a75 --- /dev/null +++ b/Assets/Scripts/Config.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEngine; + +namespace QuestAppLauncher +{ + /// + /// Root config object + /// + [Serializable] + public class Config + { + /// + /// Grid size + /// + [Serializable] + public class GridSize + { + public int rows; + public int cols; + } + + public GridSize gridSize; + } + + /// + /// Class responsible for loading / saving config into a config.json file. + /// + public class ConfigPersistence + { + // File name of app name overrides + const string ConfigFileName = "config.json"; + + /// + /// Load config from file + /// + /// Config object that will be overwritten + static public void LoadConfig(Config config) + { + var configFilePath = Path.Combine(UnityEngine.Application.persistentDataPath, ConfigFileName); + if (File.Exists(configFilePath)) + { + Debug.Log("Found config file: " + configFilePath); + var jsonConfig = File.ReadAllText(configFilePath); + + try + { + JsonUtility.FromJsonOverwrite(jsonConfig, config); + } + catch (Exception e) + { + Debug.Log(string.Format("Failed to read config: {0}", e.Message)); + } + } + } + + /// + /// Save config to a file + /// + /// + static public void SaveConfig(Config config) + { + var configFilePath = Path.Combine(UnityEngine.Application.persistentDataPath, ConfigFileName); + Debug.Log("Saving config file: " + configFilePath); + + try + { + File.WriteAllText(configFilePath, JsonUtility.ToJson(config, true)); + } + catch (Exception e) + { + Debug.Log(string.Format("Failed to read config: {0}", e.Message)); + } + + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Config.cs.meta b/Assets/Scripts/Config.cs.meta new file mode 100644 index 0000000..37e6fc7 --- /dev/null +++ b/Assets/Scripts/Config.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6884476ef6b801242904ff090df0fb84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GridPopulation.cs b/Assets/Scripts/GridPopulation.cs index 7ab35f6..76faf9e 100644 --- a/Assets/Scripts/GridPopulation.cs +++ b/Assets/Scripts/GridPopulation.cs @@ -25,12 +25,21 @@ namespace QuestAppLauncher // Extension search for icon overrides const string IconOverrideExtSearch = "*.jpg"; + // Canvas game object + public GameObject canvas; + + // Scroll view game object + public GameObject scrollView; + // Grid content game object public GameObject gridContent; // App info GameObject (a cell in the grid content) public GameObject prefab; + // Configuration + private Config config = new Config(); + #region MonoBehaviour handler void Start() @@ -41,6 +50,9 @@ namespace QuestAppLauncher // Initialize the core platform Core.AsyncInitialize(); + // Load configuration + StartCoroutine(ProcessConfig()); + // Populate the grid StartCoroutine(Populate()); } @@ -117,6 +129,65 @@ namespace QuestAppLauncher SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } + /// + /// Loads & processes config + /// + /// + IEnumerator ProcessConfig() + { + // Load config + ConfigPersistence.LoadConfig(this.config); + + ProcessGridSize(); + + yield return null; + } + + private void ProcessGridSize() + { + // Make sure grid size have sane value + if (0 == this.config.gridSize.cols && 0 == this.config.gridSize.rows) + { + // If not initialized, default to 3x3 + this.config.gridSize.cols = 3; + this.config.gridSize.rows = 3; + } + this.config.gridSize.cols = Math.Min(this.config.gridSize.cols, 10); + this.config.gridSize.cols = Math.Max(this.config.gridSize.cols, 1); + this.config.gridSize.rows = Math.Min(this.config.gridSize.rows, 50); + this.config.gridSize.rows = Math.Max(this.config.gridSize.rows, 1); + + // Get cell size, spacing & padding from the grid layout + var gridLayoutGroup = this.gridContent.GetComponent(); + var cellHeight = gridLayoutGroup.cellSize.y; + var cellWidth = gridLayoutGroup.cellSize.x; + var paddingX = gridLayoutGroup.padding.horizontal; + var paddingY = gridLayoutGroup.padding.vertical; + var spaceX = gridLayoutGroup.spacing.x; + var spaceY = gridLayoutGroup.spacing.y; + + // Width = horizontal padding + # cols * cell width + (# cols - 1) * horizontal spacing + var width = paddingX + this.config.gridSize.cols * cellWidth + (this.config.gridSize.cols - 1) * spaceX; + + // Height = vertical padding + # rows * cell height + (# rows - 1) * veritcal spacing + a bit more to show there are more elements + var height = paddingY + this.config.gridSize.rows * cellHeight + (this.config.gridSize.rows - 1) * spaceY + 120; + + Debug.Log(string.Format("Setting grid size to {0} x {1} cells", this.config.gridSize.cols, this.config.gridSize.rows)); + Debug.Log(string.Format("Grid size calculated width x height: {0} x {1}", width, height)); + + // Adjust canvas rect transform + var canvasRectTransform = this.canvas.GetComponent(); + canvasRectTransform.sizeDelta = new Vector2(width, height); + + // Adjust scroll view rect transform + var scrollViewRectTransform = this.scrollView.GetComponent(); + scrollViewRectTransform.sizeDelta = new Vector2(width, height); + + // Adjust scroll view box collider + var scrollViewBoxCollider = this.scrollView.GetComponent(); + scrollViewBoxCollider.size = new Vector3(width, height, 0); + } + /// /// Populate the grid from installed apps /// diff --git a/Assets/Scripts/OnInteraction.cs b/Assets/Scripts/OnInteraction.cs index 3503954..28469fb 100644 --- a/Assets/Scripts/OnInteraction.cs +++ b/Assets/Scripts/OnInteraction.cs @@ -2,62 +2,65 @@ using UnityEngine.SceneManagement; using UnityEngine.UI; -public class OnInteraction : MonoBehaviour +namespace QuestAppLauncher { - protected Material oldHoverMat; - public Material yellowMat; - public Material backIdle; - public Material backACtive; - public UnityEngine.UI.Text outText; - - public void OnHoverEnter(Transform t) + public class OnInteraction : MonoBehaviour { - var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; - if (null != appEntry) + protected Material oldHoverMat; + public Material yellowMat; + public Material backIdle; + public Material backACtive; + public UnityEngine.UI.Text outText; + + public void OnHoverEnter(Transform t) { - // Enable border - EnableBorder(t, true); + var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; + if (null != appEntry) + { + // Enable border + EnableBorder(t, true); + } + } + + public void OnHoverExit(Transform t) + { + var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; + if (null != appEntry) + { + // Disable border + EnableBorder(t, false); + } + } + + public void OnSelected(Transform t) + { + var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; + if (null != appEntry) + { + // Launch app + Debug.Log("Launching: " + appEntry.appName + " (package id: " + appEntry.packageId + ")"); + QuestAppLauncher.GridPopulation.LaunchApp(appEntry.packageId); + } + } + + public void OnSelectedPressedBorY(Transform t) + { + var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; + if (null != appEntry) + { + // Add package name to excluded file + Debug.Log("Hiding: " + appEntry.appName + " (package id: " + appEntry.packageId + ")"); + QuestAppLauncher.GridPopulation.AddAppToExcludedFile(appEntry.packageId); + + // Remove ourselves from the gridview + Destroy(t.gameObject); + } + } + + void EnableBorder(Transform t, bool enable) + { + var border = t.Find("Border"); + border?.gameObject.SetActive(enable); } } - - public void OnHoverExit(Transform t) - { - var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; - if (null != appEntry) - { - // Disable border - EnableBorder(t, false); - } - } - - public void OnSelected(Transform t) - { - var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; - if (null != appEntry) - { - // Launch app - Debug.Log("Launching: " + appEntry.appName + " (package id: " + appEntry.packageId + ")"); - QuestAppLauncher.GridPopulation.LaunchApp(appEntry.packageId); - } - } - - public void OnSelectedPressedBorY(Transform t) - { - var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry; - if (null != appEntry) - { - // Add package name to excluded file - Debug.Log("Hiding: " + appEntry.appName + " (package id: " + appEntry.packageId + ")"); - QuestAppLauncher.GridPopulation.AddAppToExcludedFile(appEntry.packageId); - - // Remove ourselves from the gridview - Destroy(t.gameObject); - } - } - - void EnableBorder(Transform t, bool enable) - { - var border = t.Find("Border"); - border?.gameObject.SetActive(enable); - } -} +} \ No newline at end of file diff --git a/Assets/Scripts/ScrollRectOverride.cs b/Assets/Scripts/ScrollRectOverride.cs index 2b0c6f8..704f37f 100644 --- a/Assets/Scripts/ScrollRectOverride.cs +++ b/Assets/Scripts/ScrollRectOverride.cs @@ -3,62 +3,65 @@ using System.Collections; using UnityEngine.UI; using UnityEngine.EventSystems; -public class ScrollRectOverride : ScrollRect, IMoveHandler, IPointerClickHandler, IScrollHandler +namespace QuestAppLauncher { - private const float speedMultiplier = 15f; - private float cellHeight = 0f; - - void Start() + public class ScrollRectOverride : ScrollRect, IMoveHandler, IPointerClickHandler, IScrollHandler { - this.cellHeight = this.transform.GetComponentInChildren().cellSize.y; - } + private const float speedMultiplier = 15f; + private float cellHeight = 0f; - void Update() - { - // Get vector from either left or right thumbstick - var moveVector = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick); - if (moveVector.x == 0 && moveVector.y == 0) + void Start() { - moveVector = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick); + this.cellHeight = this.transform.GetComponentInChildren().cellSize.y; } - // Scroll by a fixed amount proportional to thumbstick position on each frame - // and map this to a fraction of the total viewport size: - // moveVector.y: The thumbstick vertical position normalized to [-1,1]. - // Time.deltaTime: The time delta since last frame - // speedMultiplier: Just a multiplier to get a good scrolling speed. - // So, moveVector.y * Time.deltaTime * speedMultiplier = the amount to scroll in "units" - // proportional to thumbstick position since last frame. - // this.cellHeight / this.content.sizeDelta.y = cell height / total content height. - float verticalIncrement = moveVector.y * Time.deltaTime * speedMultiplier * this.cellHeight / this.content.sizeDelta.y; - this.verticalNormalizedPosition = Mathf.Clamp01(this.verticalNormalizedPosition + verticalIncrement); - } + void Update() + { + // Get vector from either left or right thumbstick + var moveVector = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick); + if (moveVector.x == 0 && moveVector.y == 0) + { + moveVector = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick); + } - public void OnPointerClick(PointerEventData e) - { - } + // Scroll by a fixed amount proportional to thumbstick position on each frame + // and map this to a fraction of the total viewport size: + // moveVector.y: The thumbstick vertical position normalized to [-1,1]. + // Time.deltaTime: The time delta since last frame + // speedMultiplier: Just a multiplier to get a good scrolling speed. + // So, moveVector.y * Time.deltaTime * speedMultiplier = the amount to scroll in "units" + // proportional to thumbstick position since last frame. + // this.cellHeight / this.content.sizeDelta.y = cell height / total content height. + float verticalIncrement = moveVector.y * Time.deltaTime * speedMultiplier * this.cellHeight / this.content.sizeDelta.y; + this.verticalNormalizedPosition = Mathf.Clamp01(this.verticalNormalizedPosition + verticalIncrement); + } - public override void OnBeginDrag(PointerEventData eventData) - { - } + public void OnPointerClick(PointerEventData e) + { + } - void IMoveHandler.OnMove(AxisEventData e) - { - } + public override void OnBeginDrag(PointerEventData eventData) + { + } - void IScrollHandler.OnScroll(PointerEventData eventData) - { - } + void IMoveHandler.OnMove(AxisEventData e) + { + } - void OnMouseDrag() - { - } + void IScrollHandler.OnScroll(PointerEventData eventData) + { + } - void OnMouseUp() - { - } + void OnMouseDrag() + { + } - void OnMouseDown() - { + void OnMouseUp() + { + } + + void OnMouseDown() + { + } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/SettingsHandler.cs b/Assets/Scripts/SettingsHandler.cs index bae79ca..9c982ba 100644 --- a/Assets/Scripts/SettingsHandler.cs +++ b/Assets/Scripts/SettingsHandler.cs @@ -3,40 +3,42 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; -public class SettingsHandler : MonoBehaviour +namespace QuestAppLauncher { - public GameObject scrollView; - public GameObject openSettingsButton; - public GameObject closeSettingsButton; - public GameObject settingsView; - - public void OpenSettings() + public class SettingsHandler : MonoBehaviour { - Debug.Log("Open Settings"); - scrollView.SetActive(false); - openSettingsButton.SetActive(false); - closeSettingsButton.SetActive(true); - settingsView.SetActive(true); - } + public GameObject scrollView; + public GameObject openSettingsButton; + public GameObject closeSettingsButton; + public GameObject settingsView; - public void CloseSettings() - { - Debug.Log("Close Settings"); - scrollView.SetActive(true); - openSettingsButton.SetActive(true); - closeSettingsButton.SetActive(false); - settingsView.SetActive(false); - } + public void OpenSettings() + { + Debug.Log("Open Settings"); + scrollView.SetActive(false); + openSettingsButton.SetActive(false); + closeSettingsButton.SetActive(true); + settingsView.SetActive(true); + } - public void RefreshScene() - { - Debug.Log("Scene refreshed"); - SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); - } + public void CloseSettings() + { + Debug.Log("Close Settings"); + scrollView.SetActive(true); + openSettingsButton.SetActive(true); + closeSettingsButton.SetActive(false); + settingsView.SetActive(false); + } - public void DeleteExcludedApksFile() - { - Debug.Log("Delete Excluded Apk List"); - QuestAppLauncher.GridPopulation.DeleteExcludedApksFile(); + public void ResizeGrid(int selection) + { + Debug.Log("Resize grid: " + selection); + } + + public void DeleteExcludedApksFile() + { + Debug.Log("Delete Excluded Apk List"); + QuestAppLauncher.GridPopulation.DeleteExcludedApksFile(); + } } -} +} \ No newline at end of file diff --git a/README.md b/README.md index abddc33..f777610 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,36 @@ An app launcher for Quest implemented in Unity. ## Overriding app icons and names For each installed app, we extract the default app name (PackageManager.getApplicationLabel()) and default app icon (PackageManager.getApplicationIcon()). Sometimes, however, these do not map to the actual app name and icon in the Oculus Store. In order to override this, do the following: -1) Override app names: Create a file called appnames.txt. Add a line per app with comma-separated package-id and desired name. Example: +# Override app names +Create a file called **appnames.txt**. Add a line per app with comma-separated package-id and desired name. Example: appnames.txt: com.mycompany.myapp,My Application com.othercompany.otherapp,Other application -2) Override app icons: Create a jpg file per app with the package-id as the filename. Example: +Copy this file (appnames.txt) to the following location on your Quest: Android/data/aaa.QuestAppLauncher.App/files + +# Override app icons +Create a jpg file per app with the package-id as the filename. Example: com.mycompany.myapp.jpg com.thirdcompany.yetanotherapp.jpg +Copy these files to the following location on your Quest: Android/data/aaa.QuestAppLauncher.App/files -3) Copy the above contents (appnames.txt + jpg files) to the following location on your Quest: Android/data/aaa.QuestAppLauncher.App/files +## Configuration +The app can be customized by creating a **config.json** file and copying it to the following location on your Quest: Android/data/aaa.QuestAppLauncher.App/files. + +The following options are supported: +# Setting Grid Size +The default grid size is 3x3 cells. The grid size can be customer by specifying grid rows and columns as in the following example: + +``` +{ + "gridSize": { + "rows": 2, + "cols": 4 + } +} +``` ## Source structure: - Assets/Scenes/QuestAppLauncher.unity: The main scene