Skip to content

Commit

Permalink
Merge pull request #20 from tverona1/misc
Browse files Browse the repository at this point in the history
Fix icon aspect ratio, fix Go controller scrolling.
  • Loading branch information
tverona1 authored Sep 1, 2019
2 parents e7bca70 + 333d17c commit 69bee1e
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 16 deletions.
5 changes: 4 additions & 1 deletion Assets/OVRInputSelection/InputSystem/OVRPointerVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class OVRPointerVisualizer : MonoBehaviour {
[Tooltip("Show gaze pointer as ray pointer.")]
public bool showRayPointer = true;

// Start ray draw distance
private const float StartRayDrawDistance = 0.032f;

[HideInInspector]
public OVRInput.Controller activeController = OVRInput.Controller.None;

Expand Down Expand Up @@ -73,7 +76,7 @@ public void SetPointer(Ray ray) {
}

if (linePointer != null) {
linePointer.SetPosition(0, ray.origin);
linePointer.SetPosition(0, ray.origin + ray.direction * StartRayDrawDistance);
linePointer.SetPosition(1, ray.origin + ray.direction * hitRayDrawDistance);
}

Expand Down
102 changes: 97 additions & 5 deletions Assets/Prefabs/AppEntry.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ RectTransform:
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_Children:
- {fileID: 270483903320688520}
m_Father: {fileID: 2187993270055489575}
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: 36}
m_SizeDelta: {x: 834, y: 460}
m_SizeDelta: {x: 834, y: 469}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8250312052813223195
CanvasRenderer:
Expand All @@ -58,7 +59,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0, g: 0, b: 0, a: 0}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -232,6 +233,96 @@ MonoBehaviour:
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4032891918720229799
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 270483903320688520}
- component: {fileID: 531682556823569209}
- component: {fileID: 8091170928783170726}
- component: {fileID: 2431431278619055510}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &270483903320688520
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4032891918720229799}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.001}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7191631915371959719}
m_RootOrder: 0
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: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &531682556823569209
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4032891918720229799}
m_CullTransparentMesh: 0
--- !u!114 &8091170928783170726
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4032891918720229799}
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: 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!114 &2431431278619055510
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4032891918720229799}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AspectMode: 3
m_AspectRatio: 1.7777777
--- !u!1 &4824380111246446992
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -271,7 +362,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: 834, y: 547}
m_SizeDelta: {x: 834, y: 556}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4582160310205455797
CanvasRenderer:
Expand Down Expand Up @@ -306,6 +397,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 53f2e028e4291b741960616a445cf2ba, type: 3}
m_Name:
m_EditorClassIdentifier:
sprite: {fileID: 4032891918720229799}
packageId:
appName:
--- !u!1 &5252017818009209086
Expand Down Expand Up @@ -343,7 +435,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: 834, y: 560}
m_SizeDelta: {x: 834, y: 570}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &165040609097649856
CanvasRenderer:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Prefabs/Scroll View.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ MonoBehaviour:
m_ChildAlignment: 0
m_StartCorner: 0
m_StartAxis: 0
m_CellSize: {x: 834, y: 548}
m_Spacing: {x: 75, y: 75}
m_CellSize: {x: 834, y: 557}
m_Spacing: {x: 70, y: 70}
m_Constraint: 0
m_ConstraintCount: 3
--- !u!114 &1038337479447180675
Expand Down
8 changes: 4 additions & 4 deletions Assets/Scenes/QuestAppLauncher.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ PrefabInstance:
type: 3}
propertyPath: m_modelOculusGoController
value:
objectReference: {fileID: 0}
objectReference: {fileID: 407379521}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5c706126fee98a74ea509233e2a32a7f, type: 3}
--- !u!4 &174121772 stripped
Expand Down Expand Up @@ -2791,7 +2791,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &407379522
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11872,7 +11872,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1644749161
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -14895,7 +14895,7 @@ PrefabInstance:
type: 3}
propertyPath: m_modelOculusGoController
value:
objectReference: {fileID: 0}
objectReference: {fileID: 1644749160}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 411c0b99f954d1d4884fa0d6256933cf, type: 3}
--- !u!1 &2057963232
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/AppEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

public class AppEntry : MonoBehaviour
{
public GameObject sprite;

public string packageId;
public string appName;

Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class DownloadRepo
public string sortMode = Sort_AZ;

// Whether to show 2D apps
public bool show2D = false;
public bool show2D = true;

// Auto Category: Apps are automatically categorized into 3 tabs - Quest, Go/GearVr, 2D
public string autoCategory = Category_Top;
Expand Down
8 changes: 6 additions & 2 deletions Assets/Scripts/GridPopulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,17 @@ private async Task AddCellToGridAsync(ProcessedApp app, Transform transform)
// Set the icon image
if (null != bytesIcon)
{
var image = newObj.transform.Find("AppIcon").GetComponentInChildren<Image>();
var texture = new Texture2D(2, 2, TextureFormat.RGB24, false);
var texture = new Texture2D(2, 2, TextureFormat.RGBA32, false);
texture.filterMode = FilterMode.Trilinear;
texture.anisoLevel = 16;
texture.LoadImage(bytesIcon);
var rect = new Rect(0, 0, texture.width, texture.height);
var image = appEntry.sprite.GetComponent<Image>();
image.sprite = Sprite.Create(texture, rect, new Vector2(0.5f, 0.5f));

// Preserve icon's aspect ratio
var aspectRatioFitter = appEntry.sprite.GetComponent<AspectRatioFitter>();
aspectRatioFitter.aspectRatio = (float)texture.width / (float)texture.height;
}

// Set app name in text
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/ScrollRectOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ void Update()
{
moveVector = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);
}
if (moveVector.x == 0 && moveVector.y == 0)
{
moveVector = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
}
if (moveVector.x == 0 && moveVector.y == 0)
{
moveVector = OVRInput.Get(OVRInput.Axis2D.SecondaryTouchpad);
}

if (moveVector.y == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.9
bundleVersion: 0.9.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down

0 comments on commit 69bee1e

Please sign in to comment.