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
f7835182
Commit
f7835182
authored
Feb 29, 2024
by
杨泽宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新射箭小游戏
parent
f4dc446a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
345 additions
and
70 deletions
+345
-70
2_Maze2.unity
Assets/_Scenes/2_Maze2.unity
+337
-62
ArrowController.cs
Assets/_Scripts/ArrowController.cs
+4
-7
BowController.cs
Assets/_Scripts/BowController.cs
+1
-1
PullMeasurer.cs
Assets/_Scripts/PullMeasurer.cs
+1
-0
TagManager.asset
ProjectSettings/TagManager.asset
+2
-0
No files found.
Assets/_Scenes/2_Maze2.unity
View file @
f7835182
This diff is collapsed.
Click to expand it.
Assets/_Scripts/ArrowController.cs
View file @
f7835182
...
...
@@ -8,7 +8,7 @@ public class ArrowController : MonoBehaviour
// Start is called before the first frame update
public
GameObject
arrowPrefab
;
public
GameObject
arrowPlace
;
//
public GameObject arrowPlace;
public
GameObject
arrowTrigger
;
public
GameObject
arrowBack
;
public
Vector3
arrowHeading
;
...
...
@@ -16,9 +16,7 @@ public class ArrowController : MonoBehaviour
public
bool
waitingToShoot
=
false
;
void
Start
()
{
arrowPlace
=
GameObject
.
Find
(
"XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera/ArrowPlace"
);
arrowTrigger
=
GameObject
.
Find
(
"Bow/ArrowTrigger"
);
arrowBack
=
GameObject
.
Find
(
"Bow/String/Notch"
);
//arrowPlace = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera/ArrowPlace");
}
// Update is called once per frame
...
...
@@ -35,9 +33,8 @@ public class ArrowController : MonoBehaviour
public
void
GrabArrow
()
{
GameObject
arrow
=
Instantiate
(
arrowPrefab
,
arrowPlace
.
transform
.
position
,
arrowPlace
.
transform
.
rotation
);
arrow
.
transform
.
parent
=
GameObject
.
Find
(
"XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera"
).
transform
;
//GameObject arrow = Instantiate(arrowPrefab, arrowPlace.transform.position, arrowPlace.transform.rotation);
//arrow.transform.parent = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera").transform;
}
public
void
ReleaseArrow
()
...
...
Assets/_Scripts/BowController.cs
View file @
f7835182
...
...
@@ -28,7 +28,7 @@ public class BowController : MonoBehaviour
public
void
ReleaseString
()
{
Debug
.
Log
(
"ReleaseString"
);
//
Debug.Log("ReleaseString");
stringMiddlePoint
.
transform
.
position
=
(
stringStartPoint
.
transform
.
position
+
stringEndPoint
.
transform
.
position
+
new
Vector3
(
0
,
0.07f
,
0
))
/
2
;
stringMiddlePoint
.
GetComponent
<
Rigidbody
>().
velocity
=
new
Vector3
(
0
,
0
,
0
);
stringMiddlePoint
.
GetComponent
<
Rigidbody
>().
angularVelocity
=
new
Vector3
(
0
,
0
,
0
);
...
...
Assets/_Scripts/PullMeasurer.cs
View file @
f7835182
...
...
@@ -36,6 +36,7 @@ public class PullMeasurer : XRBaseInteractable
// 计算新的拉伸程度,并返回它在空间中的位置
PullAmount
=
CalculatePull
(
interactorPosition
);
}
private
float
CalculatePull
(
Vector3
pullPosition
)
...
...
ProjectSettings/TagManager.asset
View file @
f7835182
...
...
@@ -9,6 +9,8 @@ TagManager:
-
Destroyer
-
MiniWorldCamera
-
Water
-
Arrow
-
ArrowTip
layers
:
-
Default
-
TransparentFX
...
...
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