Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
顺
顺职VR迷宫游戏教学
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨泽宇
顺职VR迷宫游戏教学
Commits
33a8cba7
Commit
33a8cba7
authored
Mar 09, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
783ce838
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
184 additions
and
3 deletions
+184
-3
1_Maze1.unity
Assets/_Scenes/1_Maze1.unity
+124
-3
BaseXRManager.cs
Assets/_Scripts/VR人物设置/BaseXRManager.cs
+48
-0
BaseXRManager.cs.meta
Assets/_Scripts/VR人物设置/BaseXRManager.cs.meta
+11
-0
GameSystem.cs
Assets/_Scripts/游戏管理器/GameSystem.cs
+1
-0
No files found.
Assets/_Scenes/1_Maze1.unity
View file @
33a8cba7
...
...
@@ -1169,7 +1169,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 826245306}
m_RootOrder:
1
m_RootOrder:
2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &50129959
PrefabInstance:
...
...
@@ -17738,7 +17738,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 826245306}
m_RootOrder:
2
m_RootOrder:
3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &771713725
MonoBehaviour:
...
...
@@ -18478,6 +18478,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1716671398}
- {fileID: 2145635462}
- {fileID: 37086099}
- {fileID: 771713724}
...
...
@@ -19497,6 +19498,68 @@ Transform:
m_CorrespondingSourceObject: {fileID: 483478, guid: ce1b1c89cc01b594b97ffd660fb7409e, type: 3}
m_PrefabInstance: {fileID: 916441928}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &922103119
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1125154553}
m_Modifications:
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6598815579406187037, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
propertyPath: m_Name
value: XR Device Simulator
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
--- !u!4 &922103120 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6598815579406187027, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
m_PrefabInstance: {fileID: 922103119}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &923620911
PrefabInstance:
m_ObjectHideFlags: 0
...
...
@@ -24479,6 +24542,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2038476289}
- {fileID: 922103120}
m_Father: {fileID: 1262256188}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
...
...
@@ -39404,6 +39468,52 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6428958236838832073, guid: 78920bcd10d957b4fa051c95992c4c21, type: 3}
m_PrefabInstance: {fileID: 1714794463}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1716671397
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1716671398}
- component: {fileID: 1716671399}
m_Layer: 0
m_Name: XRBaseManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1716671398
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1716671397}
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: 826245306}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1716671399
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1716671397}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 239ada0215154964b9d97c1e171306da, type: 3}
m_Name:
m_EditorClassIdentifier:
_simulator: {fileID: 2137546374}
VR_Player: {fileID: 1125154550}
--- !u!1001 &1718475794
PrefabInstance:
m_ObjectHideFlags: 0
...
...
@@ -49601,6 +49711,17 @@ Transform:
m_CorrespondingSourceObject: {fileID: 497674, guid: 4cca7528b2dd17349ba3af63e9a4e9bd, type: 3}
m_PrefabInstance: {fileID: 2125108700}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2137546374 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6598815579406187026, guid: 18ddb545287c546e19cc77dc9fbb2189, type: 3}
m_PrefabInstance: {fileID: 922103119}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5b34befe5d0cbb642bb5d09104a47160, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &2142190207
PrefabInstance:
m_ObjectHideFlags: 0
...
...
@@ -49695,7 +49816,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 826245306}
m_RootOrder:
0
m_RootOrder:
1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2147352350
PrefabInstance:
Assets/_Scripts/VR人物设置/BaseXRManager.cs
0 → 100644
View file @
33a8cba7
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.XR.Interaction.Toolkit.Inputs.Simulation
;
using
UnityEngine.XR
;
using
UnityEngine.XR.Management
;
public
class
BaseXRManager
:
MonoBehaviour
{
[
SerializeField
]
private
XRDeviceSimulator
_simulator
;
private
void
Start
()
{
if
(
_simulator
)
{
_simulator
.
gameObject
.
SetActive
(
false
);
}
EnableVR
();
}
private
void
EnableVR
()
{
StartCoroutine
(
StartXRCoroutine
());
}
public
IEnumerator
StartXRCoroutine
()
{
if
(
XRGeneralSettings
.
Instance
!=
null
&&
XRGeneralSettings
.
Instance
.
Manager
!=
null
)
{
yield
return
XRGeneralSettings
.
Instance
.
Manager
.
InitializeLoader
();
if
(
XRGeneralSettings
.
Instance
.
Manager
.
activeLoader
==
null
)
{
if
(
Application
.
isEditor
)
{
_simulator
.
gameObject
.
SetActive
(
true
);
gameObject
.
SetActive
(
false
);
}
}
else
{
XRGeneralSettings
.
Instance
.
Manager
.
StartSubsystems
();
gameObject
.
SetActive
(
false
);
}
}
}
}
Assets/_Scripts/VR人物设置/BaseXRManager.cs.meta
0 → 100644
View file @
33a8cba7
fileFormatVersion: 2
guid: 239ada0215154964b9d97c1e171306da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Scripts/游戏管理器/GameSystem.cs
View file @
33a8cba7
...
...
@@ -5,6 +5,7 @@ using UnityEngine.Events;
using
UnityEngine.UI
;
using
TMPro
;
using
UnityEngine.InputSystem
;
using
UnityEngine.XR.Interaction.Toolkit
;
public
class
GameSystem
:
SingletonBase
<
GameSystem
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment