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
953327e7
Commit
953327e7
authored
Mar 02, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
28afdb63
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3582 additions
and
447 deletions
+3582
-447
Main Camera (1) Profile.asset
...Scenes/Demo/Scene1_Profiles/Main Camera (1) Profile.asset
+1
-1
2_Maze2.unity
Assets/_Scenes/2_Maze2.unity
+3299
-350
OpenDoor.cs
Assets/_Scripts/OpenDoor.cs
+69
-0
OpenDoor.cs.meta
Assets/_Scripts/OpenDoor.cs.meta
+1
-1
OperationSettings.cs
Assets/_Scripts/OperationSettings.cs
+0
-21
SlidingVerification.cs
Assets/_Scripts/SlidingVerification.cs
+48
-2
锁.prefab
Assets/_美术资源/1_模型/道具/锁.prefab
+164
-72
No files found.
Assets/Scenes/Demo/Scene1_Profiles/Main Camera (1) Profile.asset
View file @
953327e7
...
@@ -18,7 +18,7 @@ MonoBehaviour:
...
@@ -18,7 +18,7 @@ MonoBehaviour:
value
:
1
value
:
1
intensity
:
intensity
:
overrideState
:
1
overrideState
:
1
value
:
3
value
:
0
threshold
:
threshold
:
overrideState
:
1
overrideState
:
1
value
:
0.95
value
:
0.95
...
...
Assets/_Scenes/2_Maze2.unity
View file @
953327e7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Assets/_Scripts/OpenDoor.cs
0 → 100644
View file @
953327e7
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.Events
;
using
UnityEngine.XR.Interaction.Toolkit
;
/// <summary>
/// 打开带锁的门
/// </summary>
public
class
OpenDoor
:
MonoBehaviour
{
[
SerializeField
]
[
Tooltip
(
"锁上旋转的钥匙"
)]
private
GameObject
KeyKnob
;
[
SerializeField
]
[
Tooltip
(
"钥匙转到什么程度才打开锁"
)]
private
float
KeyLockValue
=
0.9f
;
[
SerializeField
]
[
Tooltip
(
"钥匙转到什么程度才打开锁"
)]
private
float
KeyUnLockValue
=
0.1f
;
[
SerializeField
]
[
Tooltip
(
"打开锁的事件"
)]
private
UnityEvent
OnLock
=
new
UnityEvent
();
[
SerializeField
]
[
Tooltip
(
"关闭锁的事件"
)]
private
UnityEvent
OnUnLock
=
new
UnityEvent
();
public
UnityEvent
onlock
=>
OnLock
;
public
UnityEvent
onUnLock
=>
OnUnLock
;
private
bool
Locked
;
private
GameObject
KeySocket
;
private
IXRSelectInteractable
Key
;
/// <summary>
/// 旋转插在锁上的钥匙
/// </summary>
/// <param name="keyValue"></param>
public
void
KeyUpdate
(
float
keyValue
)
{
if
(!
Locked
&&
keyValue
>
KeyLockValue
)
{
Locked
=
true
;
OnLock
.
Invoke
();
}
if
(
Locked
&&
keyValue
<
KeyUnLockValue
)
{
Locked
=
false
;
OnUnLock
.
Invoke
();
}
}
/// <summary>
/// 插上锁
/// </summary>
/// <param name="args"></param>
public
void
KeyDropUpdate
(
SelectEnterEventArgs
args
)
{
KeySocket
=
args
.
interactableObject
.
transform
.
gameObject
;
Key
=
args
.
interactableObject
;
KeySocket
.
SetActive
(
false
);
Key
.
transform
.
gameObject
.
SetActive
(
false
);
KeyKnob
.
SetActive
(
true
);
}
}
Assets/_Scripts/Ope
rationSettings
.cs.meta
→
Assets/_Scripts/Ope
nDoor
.cs.meta
View file @
953327e7
fileFormatVersion: 2
fileFormatVersion: 2
guid:
969b4a0716e4c4840b61d674bee89b00
guid:
50613e38b83295d459f204c69dea578a
MonoImporter:
MonoImporter:
externalObjects: {}
externalObjects: {}
serializedVersion: 2
serializedVersion: 2
...
...
Assets/_Scripts/OperationSettings.cs
deleted
100644 → 0
View file @
28afdb63
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
/// <summary>
/// 操作设置
/// </summary>
public
class
OperationSettings
:
MonoBehaviour
{
// Start is called before the first frame update
void
Start
()
{
}
// Update is called once per frame
void
Update
()
{
}
}
Assets/_Scripts/SlidingVerification.cs
View file @
953327e7
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.Events
;
/// <summary>
/// 滑动验证
/// </summary>
public
class
SlidingVerification
:
MonoBehaviour
public
class
SlidingVerification
:
MonoBehaviour
{
{
[
Tooltip
(
"滑动条"
)]
public
Slider
slider
;
[
Tooltip
(
"验证中心点位置"
)]
public
float
triggerPosition
;
[
Tooltip
(
"验证前后范围"
)]
public
float
triggerThreshold
=
0.5f
;
public
UnityEvent
SuccessEvent
;
[
Tooltip
(
"正确反馈UI"
)]
public
GameObject
SuccessUI
;
private
bool
isDragging
=
false
;
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
{
{
if
(
slider
==
null
)
{
Debug
.
LogError
(
"没有设置Slider"
);
enabled
=
false
;
}
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
void
Update
()
{
{
if
(
isDragging
)
{
return
;
}
else
{
if
(
slider
.
value
>=
triggerPosition
-
triggerThreshold
&&
slider
.
value
<=
triggerPosition
+
triggerThreshold
)
{
SuccessUI
.
SetActive
(
true
);
SuccessEvent
.
Invoke
();
}
}
}
public
void
OnSliderDragStart
()
{
isDragging
=
true
;
}
public
void
OnSliderDragEnd
()
{
isDragging
=
false
;
}
}
}
}
Assets/_美术资源/1_模型/道具/锁.prefab
View file @
953327e7
%YAML
1.1
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&578415115649997568
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1694275472537445433
}
-
component
:
{
fileID
:
4305635457561600624
}
-
component
:
{
fileID
:
1490669002827043585
}
m_Layer
:
0
m_Name
:
Padlock_Staple_Low
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1694275472537445433
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
578415115649997568
}
m_LocalRotation
:
{
x
:
-0.018403066
,
y
:
-0.016262664
,
z
:
0.018340888
,
w
:
0.9995302
}
m_LocalPosition
:
{
x
:
0.0058405064
,
y
:
-0.50429296
,
z
:
-0.22788346
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_ConstrainProportionsScale
:
0
m_Children
:
[]
m_Father
:
{
fileID
:
2531817920521988976
}
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&4305635457561600624
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
578415115649997568
}
m_Mesh
:
{
fileID
:
-3661043223376423830
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
---
!u!23
&1490669002827043585
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
578415115649997568
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_StaticShadowCaster
:
0
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RayTraceProcedural
:
0
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
70e0ae1acb048cf4a861e66d2a5fced3
,
type
:
2
}
m_StaticBatchInfo
:
firstSubMesh
:
0
subMeshCount
:
0
m_StaticBatchRoot
:
{
fileID
:
0
}
m_ProbeAnchor
:
{
fileID
:
0
}
m_LightProbeVolumeOverride
:
{
fileID
:
0
}
m_ScaleInLightmap
:
1
m_ReceiveGI
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
1
m_SelectedEditorRenderState
:
3
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
m_AdditionalVertexStreams
:
{
fileID
:
0
}
---
!u!1
&4572582368877290084
---
!u!1
&4572582368877290084
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -29,81 +112,90 @@ Transform:
...
@@ -29,81 +112,90 @@ Transform:
m_ConstrainProportionsScale
:
0
m_ConstrainProportionsScale
:
0
m_Children
:
m_Children
:
-
{
fileID
:
4779189824251022905
}
-
{
fileID
:
4779189824251022905
}
-
{
fileID
:
1694275472537445433
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
001
&5033246127656905170
---
!u!1
&5267179110170662019
PrefabInstance
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_Modification
:
m_PrefabInstance
:
{
fileID
:
0
}
m_TransformParent
:
{
fileID
:
2531817920521988976
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Modifications
:
serializedVersion
:
6
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
m_Component
:
type
:
3
}
-
component
:
{
fileID
:
4779189824251022905
}
propertyPath
:
m_RootOrder
-
component
:
{
fileID
:
8501894804746781084
}
value
:
0
-
component
:
{
fileID
:
5915543042952738134
}
objectReference
:
{
fileID
:
0
}
m_Layer
:
0
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
m_Name
:
"
\u9501
"
type
:
3
}
m_TagString
:
Untagged
propertyPath
:
m_LocalPosition.x
m_Icon
:
{
fileID
:
0
}
value
:
0
m_NavMeshLayer
:
0
objectReference
:
{
fileID
:
0
}
m_StaticEditorFlags
:
0
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
m_IsActive
:
1
type
:
3
}
---
!u!4
&4779189824251022905
propertyPath
:
m_LocalPosition.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalRotation.x
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalRotation.y
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalRotation.z
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
-7.238
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
919132149155446097
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
propertyPath
:
m_Name
value
:
"
\u9501
"
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
---
!u!4
&4779189824251022905
stripped
Transform
:
Transform
:
m_CorrespondingSourceObject
:
{
fileID
:
-8679921383154817045
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
m_ObjectHideFlags
:
0
type
:
3
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
5033246127656905170
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5267179110170662019
}
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
:
2531817920521988976
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
-7.238
}
---
!u!33
&8501894804746781084
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5267179110170662019
}
m_Mesh
:
{
fileID
:
2409366728859566087
,
guid
:
cdad411ef88c1d643ab23351905dd11e
,
type
:
3
}
---
!u!23
&5915543042952738134
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5267179110170662019
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_StaticShadowCaster
:
0
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RayTraceProcedural
:
0
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
70e0ae1acb048cf4a861e66d2a5fced3
,
type
:
2
}
m_StaticBatchInfo
:
firstSubMesh
:
0
subMeshCount
:
0
m_StaticBatchRoot
:
{
fileID
:
0
}
m_ProbeAnchor
:
{
fileID
:
0
}
m_LightProbeVolumeOverride
:
{
fileID
:
0
}
m_ScaleInLightmap
:
1
m_ReceiveGI
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
1
m_SelectedEditorRenderState
:
3
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
m_AdditionalVertexStreams
:
{
fileID
:
0
}
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