Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
1465 Разработка игрового приложения для демонстрации возможностей VR оборудования
MainProject
Commits
3fe39f5a
Verified
Commit
3fe39f5a
authored
1 year ago
by
Мартинич Андрей Иванович
Browse files
Options
Download
Patches
Plain Diff
oompa loompa3
parent
e868f059
master
develop
1 merge request
!5
Merge from develop into master
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
Assets/Playing room/Prefs/Military target.prefab
+98
-0
Assets/Playing room/Prefs/Military target.prefab
Assets/Playing room/Prefs/SciFiHandGun.prefab
+100
-4
Assets/Playing room/Prefs/SciFiHandGun.prefab
Assets/Playing room/Scripts/GunController.cs
+12
-17
Assets/Playing room/Scripts/GunController.cs
Assets/Playing room/Scripts/TargetController.cs
+1
-0
Assets/Playing room/Scripts/TargetController.cs
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav
+3
-0
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav.meta
+23
-0
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav.meta
Assets/Scenes/Main.unity
+5
-5
Assets/Scenes/Main.unity
Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs
+5
-0
Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs
with
247 additions
and
26 deletions
+247
-26
Assets/Playing room/Prefs/Military target.prefab
+
98
−
0
View file @
3fe39f5a
...
...
@@ -17,6 +17,7 @@ GameObject:
-
component
:
{
fileID
:
8465204698793991341
}
-
component
:
{
fileID
:
6388392211831621975
}
-
component
:
{
fileID
:
8842308692343450372
}
-
component
:
{
fileID
:
-7233594277474418132
}
m_Layer
:
0
m_Name
:
Military target
m_TagString
:
Untagged
...
...
@@ -215,3 +216,100 @@ CapsuleCollider:
m_Height
:
0.04350917
m_Direction
:
0
m_Center
:
{
x
:
0
,
y
:
0.0010344908
,
z
:
-0.050325178
}
---
!u!82
&-7233594277474418132
AudioSource
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1501084758933746
}
m_Enabled
:
1
serializedVersion
:
4
OutputAudioMixerGroup
:
{
fileID
:
0
}
m_audioClip
:
{
fileID
:
8300000
,
guid
:
ff4fdc7ab5a5c42499bb7bc35fee3d95
,
type
:
3
}
m_Resource
:
{
fileID
:
8300000
,
guid
:
ff4fdc7ab5a5c42499bb7bc35fee3d95
,
type
:
3
}
m_PlayOnAwake
:
0
m_Volume
:
1
m_Pitch
:
1
Loop
:
0
Mute
:
0
Spatialize
:
0
SpatializePostEffects
:
0
Priority
:
128
DopplerLevel
:
1
MinDistance
:
1
MaxDistance
:
500
Pan2D
:
0
rolloffMode
:
0
BypassEffects
:
0
BypassListenerEffects
:
0
BypassReverbZones
:
0
rolloffCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
-
serializedVersion
:
3
time
:
1
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
panLevelCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
spreadCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
reverbZoneMixCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
This diff is collapsed.
Click to expand it.
Assets/Playing room/Prefs/SciFiHandGun.prefab
+
100
−
4
View file @
3fe39f5a
...
...
@@ -101,6 +101,7 @@ GameObject:
-
component
:
{
fileID
:
5222480561851549995
}
-
component
:
{
fileID
:
8107286817448585809
}
-
component
:
{
fileID
:
2476642138429827811
}
-
component
:
{
fileID
:
243895279731729523
}
m_Layer
:
0
m_Name
:
SciFiHandGun
m_TagString
:
Untagged
...
...
@@ -259,10 +260,8 @@ MonoBehaviour:
bulletPref
:
{
fileID
:
3331702494713981315
,
guid
:
36b5fc592ca54ef4eb66fff8acabd33b
,
type
:
3
}
spawnPoint
:
{
fileID
:
4681773637070317307
}
targetTransform1
:
{
fileID
:
0
}
targetTransform2
:
{
fileID
:
0
}
targetTransform3
:
{
fileID
:
0
}
fireSpeed
:
5
fireSpeed
:
15
cooldown
:
0.33
---
!u!114
&8107286817448585809
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -369,6 +368,103 @@ MonoBehaviour:
m_PersistentCalls
:
m_Calls
:
[]
interactable
:
{
fileID
:
0
}
---
!u!82
&243895279731729523
AudioSource
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
315305389486338692
}
m_Enabled
:
1
serializedVersion
:
4
OutputAudioMixerGroup
:
{
fileID
:
0
}
m_audioClip
:
{
fileID
:
8300000
,
guid
:
c9de1306d5ae8734c9390f15ed8de576
,
type
:
3
}
m_Resource
:
{
fileID
:
8300000
,
guid
:
c9de1306d5ae8734c9390f15ed8de576
,
type
:
3
}
m_PlayOnAwake
:
0
m_Volume
:
1
m_Pitch
:
1
Loop
:
0
Mute
:
0
Spatialize
:
0
SpatializePostEffects
:
0
Priority
:
128
DopplerLevel
:
1
MinDistance
:
1
MaxDistance
:
500
Pan2D
:
0
rolloffMode
:
0
BypassEffects
:
0
BypassListenerEffects
:
0
BypassReverbZones
:
0
rolloffCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
-
serializedVersion
:
3
time
:
1
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
panLevelCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
spreadCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
reverbZoneMixCustomCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
---
!u!1
&315330575868828356
GameObject
:
m_ObjectHideFlags
:
0
...
...
This diff is collapsed.
Click to expand it.
Assets/Playing room/Scripts/GunController.cs
+
12
−
17
View file @
3fe39f5a
...
...
@@ -14,10 +14,9 @@ public class GunController : MonoBehaviour
public
GameObject
bulletPref
;
public
Transform
spawnPoint
;
public
Transform
targetTransform1
;
public
Transform
targetTransform2
;
public
Transform
targetTransform3
;
public
float
fireSpeed
=
20f
;
public
float
cooldown
=
1f
;
private
bool
govno
=
true
;
private
new
Rigidbody
rigidbody
;
private
SteamVR_Action_Boolean
fire
=
SteamVR_Input
.
GetAction
<
SteamVR_Action_Boolean
>(
"InteractUI"
);
...
...
@@ -36,27 +35,23 @@ private void FireBullet()
Rigidbody
bulletRigidbody
=
spawnedBullet
.
GetComponent
<
Rigidbody
>();
bulletRigidbody
.
velocity
=
spawnPoint
.
forward
*
fireSpeed
;
Destroy
(
spawnedBullet
,
5f
);
/*
RaycastHit hitInfo;
bool hitTarget = Physics.Raycast(spawnPoint.position, spawnPoint.forward, out hitInfo);
if (hitTarget && hitInfo.collider.gameObject == targetTransform1.gameObject || hitInfo.collider.gameObject == targetTransform2.gameObject || hitInfo.collider.gameObject == targetTransform3.gameObject)
{
Debug.Log("Hit!");
// Add visual or audio feedback for successful hit
}
else
{
Debug.Log("Miss!");
// Add visual or audio feedback for missed shot
}*/
gameObject
.
GetComponent
<
AudioSource
>().
Play
();
}
public
void
Update
()
{
if
(
interactable
.
attachedToHand
&&
fire
.
GetStateDown
(
SteamVR_Input_Sources
.
Any
))
if
(
interactable
.
attachedToHand
&&
fire
.
GetStateDown
(
SteamVR_Input_Sources
.
Any
)
&&
govno
)
{
FireBullet
();
StartCoroutine
(
InteractCooldown
());
}
}
IEnumerator
InteractCooldown
()
{
govno
=
false
;
yield
return
new
WaitForSeconds
(
cooldown
);
govno
=
true
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Assets/Playing room/Scripts/TargetController.cs
+
1
−
0
View file @
3fe39f5a
...
...
@@ -38,6 +38,7 @@ void Update()
void
OnTriggerEnter
(
Collider
other
)
{
gameController
.
GetComponent
<
PiuPau
>().
score
++;
gameObject
.
GetComponent
<
AudioSource
>().
Play
();
Destroy
(
other
.
gameObject
);
}
}
This diff is collapsed.
Click to expand it.
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav
0 → 100644
LFS
+
3
−
0
View file @
3fe39f5a
File added
This diff is collapsed.
Click to expand it.
Assets/Playing room/mixkit-karate-fighter-hit-2154.wav.meta
0 → 100644
+
23
−
0
View file @
3fe39f5a
fileFormatVersion: 2
guid: ff4fdc7ab5a5c42499bb7bc35fee3d95
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Assets/Scenes/Main.unity
+
5
−
5
View file @
3fe39f5a
...
...
@@ -5183,7 +5183,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value:
0
value:
5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
...
...
@@ -23236,7 +23236,7 @@ PrefabInstance:
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
propertyPath: m_LocalPosition.x
value: 2
09.344
value: 2
18.187
objectReference: {fileID: 0}
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
...
...
@@ -23246,7 +23246,7 @@ PrefabInstance:
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
propertyPath: m_LocalPosition.z
value: 4
1.244
value: 4
5.112
objectReference: {fileID: 0}
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
...
...
@@ -44644,7 +44644,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value:
0
value:
5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
...
...
@@ -56271,7 +56271,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value:
0
value:
5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
This diff is collapsed.
Click to expand it.
Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs
+
5
−
0
View file @
3fe39f5a
...
...
@@ -3,6 +3,11 @@
// Purpose: Player interface used to query HMD transforms and VR hands
//
//=============================================================================
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Player interface used to query HMD transforms and VR hands
//
//=============================================================================
using
UnityEngine
;
using
System.Collections
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets