Skip to content

Commit

Permalink
Update pattern controller
Browse files Browse the repository at this point in the history
  • Loading branch information
syKevinPeng committed Apr 17, 2024
1 parent 1656912 commit 12bffa5
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 34 deletions.
13 changes: 7 additions & 6 deletions Assets/Materials/New Material.mat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: New Material
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_ValidKeywords:
- _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
Expand Down Expand Up @@ -62,19 +63,19 @@ Material:
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossMapScale: 0
- _Glossiness: 1
- _GlossyReflections: 1
- _Metallic: 0
- _Metallic: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SmoothnessTextureChannel: 1
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.21960786, g: 0.21960786, b: 0.21960786, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
6 changes: 3 additions & 3 deletions Assets/Oculus/OculusProjectConfig.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ MonoBehaviour:
handTrackingSupport: 0
handTrackingFrequency: 0
handTrackingVersion: 0
anchorSupport: 0
anchorSupport: 1
sharedAnchorSupport: 0
renderModelSupport: 0
renderModelSupport: 1
trackedKeyboardSupport: 0
bodyTrackingSupport: 0
faceTrackingSupport: 0
eyeTrackingSupport: 0
virtualKeyboardSupport: 0
sceneSupport: 0
sceneSupport: 2
disableBackups: 1
enableNSCConfig: 1
securityXmlPath:
Expand Down
171 changes: 159 additions & 12 deletions Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,13 @@ Light:
m_GameObject: {fileID: 711683826}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.5
m_Range: 10
m_SpotAngle: 19.4
m_InnerSpotAngle: 19.4
m_Intensity: 5
m_Range: 7
m_SpotAngle: 40
m_InnerSpotAngle: 4
m_CookieSize: 10
m_Shadows:
m_Type: 0
Expand Down Expand Up @@ -290,7 +290,7 @@ Light:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_Lightmapping: 2
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
Expand All @@ -308,14 +308,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 711683826}
m_LocalRotation: {x: 0.06975647, y: 0, z: 0, w: 0.9975641}
m_LocalPosition: {x: 0, y: 1.49, z: -5}
m_LocalRotation: {x: 0.1367044, y: 0.0055323746, z: 0.0007634797, w: 0.9905962}
m_LocalPosition: {x: -7.212718e-10, y: 1.49, z: -5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 8, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: 15.714, y: 0.665, z: 0.18}
--- !u!1 &758907210
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -350,9 +350,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
displayPlane: {fileID: 758907210}
material: {fileID: 2100000, guid: aabf485777cb02d448f101c03e01533a, type: 2}
PatternHeight: 8
PatternWidth: 64
radius: 100
--- !u!64 &758907212
MeshCollider:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -499,6 +496,11 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 126d619cf4daa52469682f85c1378b4a, type: 3}
--- !u!4 &990268520 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4593680705043960, guid: 126d619cf4daa52469682f85c1378b4a, type: 3}
m_PrefabInstance: {fileID: 938174245}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1211520898
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -530,6 +532,67 @@ Transform:
m_Father: {fileID: 864835256}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1224660038
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 990268520}
m_Modifications:
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1892613689412401362, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_controller
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4473535996617709080, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_Name
value: OVRRuntimeControllerPrefab
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
--- !u!1 &1293739109
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -562,6 +625,29 @@ Transform:
m_Father: {fileID: 830939339}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &1459768126 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4484591312116288, guid: 126d619cf4daa52469682f85c1378b4a, type: 3}
m_PrefabInstance: {fileID: 938174245}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1476154623 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4473535996617709080, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
m_PrefabInstance: {fileID: 1224660038}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1476154626
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1476154623}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5343f8c38f918834397311e61ab51713, type: 3}
m_Name:
m_EditorClassIdentifier:
Quad: {fileID: 758907210}
--- !u!1 &1867766543
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -593,3 +679,64 @@ Transform:
m_Father: {fileID: 1293739110}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1911286186
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1459768126}
m_Modifications:
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1662430601901559469, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1892613689412401362, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_controller
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4473535996617709080, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
propertyPath: m_Name
value: OVRRuntimeControllerPrefab
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d0abdd77712724b409bdd185b622ac7c, type: 3}
48 changes: 48 additions & 0 deletions Assets/Scripts/Controller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// This class is used to manage the controller of your VR equipment


public class Controller : MonoBehaviour
{
private OVRInput.Controller LController = OVRInput.Controller.LTouch;
private OVRInput.Controller RController = OVRInput.Controller.RTouch;
// raise exception if Quad is not found
public GameObject Quad;
// Start is called before the first frame update
void GetIncreaseButtonPressed()
{
if (OVRInput.Get(OVRInput.Button.One, LController))
{
Debug.Log(" ===== Button One is pressed =====");
// increase the ratio of the pattern. Call IncreasePatternRatio() in ouchi.cs
Quad.GetComponent<ouchi>().IncreasePatternRatio();
}
}

void GetDecreaseButtonPressed()
{
if (OVRInput.Get(OVRInput.Button.Two, LController))
{
Debug.Log(" ===== Button Two is pressed =====");
// decrease the ratio of the pattern. Call DecreasePatternRatio() in ouchi.cs
Quad.GetComponent<ouchi>().DecreasePatternRatio();
}
}


void Start()
{

}

// Update is called once per frame
void Update()
{
GetIncreaseButtonPressed();
GetDecreaseButtonPressed();

}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Controller.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 12bffa5

Please sign in to comment.