Skip to content

Commit

Permalink
reformat code; add toggle swtich to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
syKevinPeng committed Apr 29, 2024
1 parent 492c34a commit e679773
Show file tree
Hide file tree
Showing 50 changed files with 6,013 additions and 60 deletions.
226 changes: 213 additions & 13 deletions Assets/Scenes/IllusionStationaryScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ MonoBehaviour:
Slider: {fileID: 1277576637}
UpButton: {fileID: 0}
DownButton: {fileID: 0}
IllusionCanvas: {fileID: 0}
--- !u!114 &26335393
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -532,6 +533,102 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 0}
--- !u!1 &267370132
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 267370133}
- component: {fileID: 267370137}
- component: {fileID: 267370136}
- component: {fileID: 267370135}
- component: {fileID: 267370134}
m_Layer: 0
m_Name: Surface
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &267370133
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 267370132}
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: 1658623783}
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 &267370134
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 267370132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4bd1f1e23a51a7d428dd152466736b7a, type: 3}
m_Name:
m_EditorClassIdentifier:
_boundsClipper: {fileID: 267370135}
--- !u!114 &267370135
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 267370132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e08ab46e8fb05dc46b34e54466dc11e3, type: 3}
m_Name:
m_EditorClassIdentifier:
_position: {x: 0, y: 0, z: 0}
_size: {x: 8000, y: 3000, z: 0.01}
--- !u!114 &267370136
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 267370132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: efd927768041afd4d90e5d822283f0f4, type: 3}
m_Name:
m_EditorClassIdentifier:
_planeSurface: {fileID: 267370137}
_clippers:
- {fileID: 267370135}
--- !u!114 &267370137
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 267370132}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9cf2a74d69b1c1e41916d2a7afdff5be, type: 3}
m_Name:
m_EditorClassIdentifier:
_facing: 0
_doubleSided: 0
--- !u!1 &284573318
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1630,6 +1727,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5343f8c38f918834397311e61ab51713, type: 3}
m_Name:
m_EditorClassIdentifier:
LController: 1
RController: 2
RawImage: {fileID: 0}
UpButton: {fileID: 0}
DownButton: {fileID: 0}
MenuCanvas: {fileID: 0}
--- !u!1 &1331094998
GameObject:
Expand Down Expand Up @@ -2177,6 +2279,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1570219036}
- component: {fileID: 1570219037}
m_Layer: 0
m_Name: Menu
m_TagString: Untagged
Expand All @@ -2200,6 +2303,18 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1570219037
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1570219035}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2e3a46a4f40f40745928d4f3047439af, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1580629634
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -2212,7 +2327,6 @@ GameObject:
- component: {fileID: 1580629639}
- component: {fileID: 1580629638}
- component: {fileID: 1580629637}
- component: {fileID: 1580629636}
m_Layer: 0
m_Name: MenuCanvas
m_TagString: Untagged
Expand All @@ -2235,6 +2349,7 @@ RectTransform:
- {fileID: 1054974522}
- {fileID: 1443060712}
- {fileID: 1026126675}
- {fileID: 1658623783}
m_Father: {fileID: 1570219036}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -2243,18 +2358,6 @@ RectTransform:
m_AnchoredPosition: {x: 132.3, y: 116}
m_SizeDelta: {x: 8000, y: 3000}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1580629636
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1580629634}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2e3a46a4f40f40745928d4f3047439af, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1580629637
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2317,6 +2420,103 @@ Canvas:
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!1 &1658623782
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1658623783}
- component: {fileID: 1658623786}
- component: {fileID: 1658623785}
- component: {fileID: 1658623784}
m_Layer: 0
m_Name: ISDK_RayInteraction
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1658623783
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1658623782}
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: 267370133}
m_Father: {fileID: 1580629635}
m_RootOrder: 3
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 &1658623784
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1658623782}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &1658623785
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1658623782}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3ffe41fe81087fa41a2062cc69b99615, type: 3}
m_Name:
m_EditorClassIdentifier:
_transferOnSecondSelection: 0
_addNewPointsToFront: 0
_forwardElement: {fileID: 0}
_canvas: {fileID: 1580629639}
--- !u!114 &1658623786
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1658623782}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bb86ba9d4c5126e48bfef9b0c9550e9d, type: 3}
m_Name:
m_EditorClassIdentifier:
_interactorFilters: []
_maxInteractors: -1
_maxSelectingInteractors: -1
_data: {fileID: 0}
_pointableElement: {fileID: 1658623785}
_surface: {fileID: 267370136}
_selectSurface: {fileID: 267370137}
_movementProvider: {fileID: 0}
_tiebreakerScore: 0
--- !u!1 &1730757802
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class Controller : MonoBehaviour
private GameObject UpButton;
private GameObject DownButton;

public GameObject MenuCanvas;
// Start is called before the first frame update
void GetIncreaseButtonPressed()
{
Expand Down Expand Up @@ -47,32 +46,14 @@ void GetDecreaseButtonPressed()
}
}

void GetMenuButtonPressed()
{
if (OVRInput.GetUp(OVRInput.Button.Start, LController) || OVRInput.GetUp(OVRInput.Button.One, LController) || OVRInput.GetUp(OVRInput.Button.Two, LController))
{
// show the menu. Call EnableMenu() in MenuController.cs
MenuCanvas.GetComponent<MenuController>().EnableMenu();
}
}

void GetMenuButtonReleased()
{
if (OVRInput.GetUp(OVRInput.Button.Start, LController) || OVRInput.GetUp(OVRInput.Button.One, LController) || OVRInput.GetUp(OVRInput.Button.Two, LController))
{
// hide the menu. Call DisableMenu() in MenuController.cs
MenuCanvas.GetComponent<MenuController>().DisableMenu();
}
}


void Start()
{
RawImage = GameObject.Find("RawImage");
UpButton = GameObject.Find("UpButton");
DownButton = GameObject.Find("DownButton");
MenuCanvas = GameObject.Find("MenuCanvas");
// Debug.LogError("MenuCanvas: " + MenuCanvas);
}

// Update is called once per frame
Expand All @@ -83,15 +64,6 @@ void Update()
GetIncreaseButtonPressed();
GetDecreaseButtonPressed();
}
if (!MenuCanvas.activeSelf)
{
GetMenuButtonPressed();
}
else if (MenuCanvas.activeSelf)
{
GetMenuButtonReleased();
}


}
}
File renamed without changes.
Loading

0 comments on commit e679773

Please sign in to comment.