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
a4349d42
Commit
a4349d42
authored
Mar 05, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
00cab958
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
697 additions
and
1811 deletions
+697
-1811
XRI Default Input Actions.inputactions
...3.2/Starter Assets/XRI Default Input Actions.inputactions
+20
-0
1_Maze1.unity
Assets/_Scenes/1_Maze1.unity
+531
-1803
GameSystem.cs
Assets/_Scripts/GameSystem.cs
+35
-0
SlidingVerification.cs
Assets/_Scripts/SlidingVerification.cs
+47
-2
操作台 (1).controller
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/操作台 (1).controller
+31
-2
操作台1.controller
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/操作台1.controller
+31
-2
收起操作台1.anim
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/收起操作台1.anim
+1
-1
收起操作台第一关.anim
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/收起操作台第一关.anim
+1
-1
No files found.
Assets/Samples/XR Interaction Toolkit/2.3.2/Starter Assets/XRI Default Input Actions.inputactions
View file @
a4349d42
...
...
@@ -359,6 +359,15 @@
"processors": "",
"interactions": "",
"initialStateCheck": false
},
{
"name": "Menu",
"type": "Button",
"id": "da813910-0185-4191-a68e-761c4db7fe71",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false
}
],
"bindings": [
...
...
@@ -581,6 +590,17 @@
"action": "MINIMAP",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "f89887f7-f467-4f08-9c5a-e87c443d79f6",
"path": "<XRController>{LeftHand}/menu",
"interactions": "",
"processors": "",
"groups": "",
"action": "Menu",
"isComposite": false,
"isPartOfComposite": false
}
]
},
...
...
Assets/_Scenes/1_Maze1.unity
View file @
a4349d42
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Assets/_Scripts/GameSystem.cs
View file @
a4349d42
...
...
@@ -4,20 +4,27 @@ using UnityEngine;
using
UnityEngine.Events
;
using
UnityEngine.UI
;
using
TMPro
;
using
UnityEngine.InputSystem
;
public
class
GameSystem
:
SingletonBase
<
GameSystem
>
{
[
SerializeField
]
private
float
totalTime
=
60f
;
// 倒计时总时间
[
Tooltip
(
"时间文本"
)]
public
TMP_Text
text_Time
;
[
Tooltip
(
"暂停"
)]
public
InputActionReference
Pause
;
[
Tooltip
(
"暂停UI"
)]
public
GameObject
PauseUI
;
[
Tooltip
(
"暂停后处理"
)]
public
GameObject
PausePostProcessing
;
[
Tooltip
(
"当前剩余时间"
)]
private
float
currentTime
;
[
Tooltip
(
"是否正在倒计时"
)]
private
bool
isPauseGame
=
false
;
public
GameObject
onGameEndUI
;
[
Tooltip
(
"游戏开始时的事件"
)]
public
UnityEvent
onGameStart
;
...
...
@@ -26,6 +33,11 @@ public class GameSystem : SingletonBase<GameSystem>
private
void
Start
()
{
if
(
Pause
!=
null
)
{
Pause
.
action
.
Enable
();
Pause
.
action
.
performed
+=
PauseGame
;
}
currentTime
=
totalTime
;
StartGame
();
}
...
...
@@ -67,8 +79,10 @@ public class GameSystem : SingletonBase<GameSystem>
{
if
(
currentTime
<=
0
)
{
Time
.
timeScale
=
0f
;
currentTime
=
0
;
isPauseGame
=
false
;
onGameEndUI
.
SetActive
(
true
);
onGameEnd
.
Invoke
();
}
}
...
...
@@ -95,6 +109,25 @@ public class GameSystem : SingletonBase<GameSystem>
/// </summary>
public
void
PauseGame
()
{
StartCoroutine
(
PauseGameCoroutine
());
}
public
void
PauseGame
(
InputAction
.
CallbackContext
context
)
{
if
(
isPauseGame
)
{
ResumeGame
();
}
else
{
PauseGame
();
}
}
private
IEnumerator
PauseGameCoroutine
()
{
PausePostProcessing
.
SetActive
(
true
);
yield
return
new
WaitForSeconds
(
1f
);
Time
.
timeScale
=
0f
;
isPauseGame
=
true
;
PauseUI
.
SetActive
(
true
);
...
...
@@ -105,8 +138,10 @@ public class GameSystem : SingletonBase<GameSystem>
/// </summary>
public
void
ResumeGame
()
{
PausePostProcessing
.
SetActive
(
false
);
Time
.
timeScale
=
1f
;
isPauseGame
=
false
;
PauseUI
.
SetActive
(
false
);
}
}
Assets/_Scripts/SlidingVerification.cs
View file @
a4349d42
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.Events
;
/// <summary>
/// 滑动验证
/// </summary>
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
void
Start
()
{
if
(
slider
==
null
)
{
Debug
.
LogError
(
"没有设置Slider"
);
enabled
=
false
;
}
}
// Update is called once per frame
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/_美术资源/5_动画/Animation/迷宫2/桌子/操作台 (1).controller
View file @
a4349d42
...
...
@@ -33,7 +33,10 @@ AnimatorStateMachine:
m_ChildStates
:
-
serializedVersion
:
1
m_State
:
{
fileID
:
8687181047316162206
}
m_Position
:
{
x
:
200
,
y
:
0
,
z
:
0
}
m_Position
:
{
x
:
330
,
y
:
150
,
z
:
0
}
-
serializedVersion
:
1
m_State
:
{
fileID
:
6226603698969438560
}
m_Position
:
{
x
:
377.91882
,
y
:
-34.3528
,
z
:
0
}
m_ChildStateMachines
:
[]
m_AnyStateTransitions
:
[]
m_EntryTransitions
:
[]
...
...
@@ -43,7 +46,33 @@ AnimatorStateMachine:
m_EntryPosition
:
{
x
:
50
,
y
:
120
,
z
:
0
}
m_ExitPosition
:
{
x
:
800
,
y
:
120
,
z
:
0
}
m_ParentStateMachinePosition
:
{
x
:
800
,
y
:
20
,
z
:
0
}
m_DefaultState
:
{
fileID
:
8687181047316162206
}
m_DefaultState
:
{
fileID
:
6226603698969438560
}
---
!u!1102
&6226603698969438560
AnimatorState
:
serializedVersion
:
6
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
New State
m_Speed
:
1
m_CycleOffset
:
0
m_Transitions
:
[]
m_StateMachineBehaviours
:
[]
m_Position
:
{
x
:
50
,
y
:
50
,
z
:
0
}
m_IKOnFeet
:
0
m_WriteDefaultValues
:
1
m_Mirror
:
0
m_SpeedParameterActive
:
0
m_MirrorParameterActive
:
0
m_CycleOffsetParameterActive
:
0
m_TimeParameterActive
:
0
m_Motion
:
{
fileID
:
0
}
m_Tag
:
m_SpeedParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
---
!u!1102
&8687181047316162206
AnimatorState
:
serializedVersion
:
6
...
...
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/操作台1.controller
View file @
a4349d42
...
...
@@ -59,7 +59,10 @@ AnimatorStateMachine:
m_ChildStates
:
-
serializedVersion
:
1
m_State
:
{
fileID
:
1342997852910071057
}
m_Position
:
{
x
:
200
,
y
:
0
,
z
:
0
}
m_Position
:
{
x
:
280
,
y
:
10
,
z
:
0
}
-
serializedVersion
:
1
m_State
:
{
fileID
:
8356128917497193178
}
m_Position
:
{
x
:
305.5838
,
y
:
97.05585
,
z
:
0
}
m_ChildStateMachines
:
[]
m_AnyStateTransitions
:
[]
m_EntryTransitions
:
[]
...
...
@@ -69,4 +72,30 @@ AnimatorStateMachine:
m_EntryPosition
:
{
x
:
50
,
y
:
120
,
z
:
0
}
m_ExitPosition
:
{
x
:
800
,
y
:
120
,
z
:
0
}
m_ParentStateMachinePosition
:
{
x
:
800
,
y
:
20
,
z
:
0
}
m_DefaultState
:
{
fileID
:
1342997852910071057
}
m_DefaultState
:
{
fileID
:
8356128917497193178
}
---
!u!1102
&8356128917497193178
AnimatorState
:
serializedVersion
:
6
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
New State
m_Speed
:
1
m_CycleOffset
:
0
m_Transitions
:
[]
m_StateMachineBehaviours
:
[]
m_Position
:
{
x
:
50
,
y
:
50
,
z
:
0
}
m_IKOnFeet
:
0
m_WriteDefaultValues
:
1
m_Mirror
:
0
m_SpeedParameterActive
:
0
m_MirrorParameterActive
:
0
m_CycleOffsetParameterActive
:
0
m_TimeParameterActive
:
0
m_Motion
:
{
fileID
:
0
}
m_Tag
:
m_SpeedParameter
:
m_MirrorParameter
:
m_CycleOffsetParameter
:
m_TimeParameter
:
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/收起操作台1.anim
View file @
a4349d42
...
...
@@ -68,7 +68,7 @@ AnimationClip:
m_Level
:
0
m_CycleOffset
:
0
m_HasAdditiveReferencePose
:
0
m_LoopTime
:
1
m_LoopTime
:
0
m_LoopBlend
:
0
m_LoopBlendOrientation
:
0
m_LoopBlendPositionY
:
0
...
...
Assets/_美术资源/5_动画/Animation/迷宫2/桌子/收起操作台第一关.anim
View file @
a4349d42
...
...
@@ -68,7 +68,7 @@ AnimationClip:
m_Level
:
0
m_CycleOffset
:
0
m_HasAdditiveReferencePose
:
0
m_LoopTime
:
1
m_LoopTime
:
0
m_LoopBlend
:
0
m_LoopBlendOrientation
:
0
m_LoopBlendPositionY
:
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