Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RhythmKata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
13정준영
RhythmKata
Commits
1b6d4c2b
Commit
1b6d4c2b
authored
5 years ago
by
13정준영
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI Interaction
parent
a8ed1d1d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5386 additions
and
12 deletions
+5386
-12
DefaultNote 1.mat
RhythmKata/Assets/Materials/DefaultNote 1.mat
+1
-1
Precision Strike.bms
RhythmKata/Assets/Resources/Level/Precision Strike.bms
+0
-1
finalscene.unity
RhythmKata/Assets/Scenes/finalscene.unity
+5317
-0
finalscene.unity.meta
RhythmKata/Assets/Scenes/finalscene.unity.meta
+7
-0
PlayEngine.cs
RhythmKata/Assets/Scripts/PlayEngine.cs
+59
-9
TagManager.asset
RhythmKata/ProjectSettings/TagManager.asset
+2
-1
No files found.
RhythmKata/Assets/Materials/DefaultNote 1.mat
View file @
1b6d4c2b
...
...
@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
DefaultNote
m_Name
:
DefaultNote
1
m_Shader
:
{
fileID
:
4800000
,
guid
:
19d29d358ae9fed4b8a0fd347863afc5
,
type
:
3
}
m_ShaderKeywords
:
_EMISSION _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags
:
1
...
...
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Resources/Level/Precision Strike.bms
View file @
1b6d4c2b
...
...
@@ -22,7 +22,6 @@
#00113:E1
#00114:E3
#00116:E2
#00312:37
...
...
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scenes/finalscene.unity
0 → 100644
View file @
1b6d4c2b
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scenes/finalscene.unity.meta
0 → 100644
View file @
1b6d4c2b
fileFormatVersion: 2
guid: d5e3d585ae166d14caf9bcac636e6054
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/PlayEngine.cs
View file @
1b6d4c2b
...
...
@@ -82,21 +82,21 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
private
void
Update
()
{
//get laser
var
handObjects
=
player
.
GetComponent
<
Valve
.
VR
.
InteractionSystem
.
Player
>().
hands
;
var
leftHandObject
=
handObjects
[
0
];
var
rightHandObject
=
handObjects
[
1
];
TrackHand
(
leftHandObject
,
leftHandTracker
);
TrackHand
(
rightHandObject
,
rightHandTracker
);
if
(
level
!=
null
)
{
var
playbackTime
=
AudioSettings
.
dspTime
-
startDspTime
;
PlayerInput
input
=
new
PlayerInput
();
input
.
time
=
playbackTime
;
//get laser
var
handObjects
=
player
.
GetComponent
<
Valve
.
VR
.
InteractionSystem
.
Player
>().
hands
;
var
leftHandObject
=
handObjects
[
0
];
var
rightHandObject
=
handObjects
[
1
];
TrackHand
(
leftHandObject
,
leftHandTracker
);
TrackHand
(
rightHandObject
,
rightHandTracker
);
level
.
UpdateNotes
(
playbackTime
);
if
(
Input
.
GetKeyDown
(
KeyCode
.
Alpha1
))
...
...
@@ -170,6 +170,56 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
audioSource
.
time
+=
1.0f
;
startDspTime
-=
1.0f
;
}
// UI
if
(
level
==
null
)
{
try
// when no VR device is available, SteamVR causes an error.
{
// TODO: handle vr input
if
(
fire
.
GetStateDown
(
leftHand
))
{
if
(
leftHandObject
)
{
var
gun
=
leftHandObject
.
GetComponentInChildren
<
GunBehaviour
>();
gun
.
Fire
();
ClickButton
(
gun
.
GetRay
());
}
}
if
(
fire
.
GetStateDown
(
rightHand
))
{
if
(
rightHandObject
)
{
var
gun
=
rightHandObject
.
GetComponentInChildren
<
GunBehaviour
>();
gun
.
Fire
();
ClickButton
(
gun
.
GetRay
());
}
}
}
catch
(
NullReferenceException
e
)
{
if
(
e
.
Source
!=
"SteamVR"
)
// ignore SteamVR, rethrow otherwise
{
Debug
.
LogError
(
e
.
StackTrace
);
throw
e
;
}
}
}
}
private
void
ClickButton
(
Ray
ray
)
{
RaycastHit
hit
;
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
var
button
=
hit
.
collider
.
gameObject
.
GetComponent
<
UnityEngine
.
UI
.
Button
>();
if
(
button
)
{
button
.
onClick
.
Invoke
();
}
}
}
private
void
TrackHand
(
Hand
handObject
,
MotionTracker
tracker
)
...
...
This diff is collapsed.
Click to expand it.
RhythmKata/ProjectSettings/TagManager.asset
View file @
1b6d4c2b
...
...
@@ -3,7 +3,8 @@
---
!u!78
&1
TagManager
:
serializedVersion
:
2
tags
:
[]
tags
:
-
Deco
layers
:
-
Default
-
TransparentFX
...
...
This diff is collapsed.
Click to expand it.
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