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
7561f915
Commit
7561f915
authored
5 years ago
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Result, Music Selection 관련 UI 구현
parent
f4ec1461
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5129 additions
and
1240 deletions
+5129
-1240
mergescene.unity
RhythmKata/Assets/Scenes/mergescene.unity
+5066
-1239
IngameUIManager.cs
RhythmKata/Assets/Scripts/IngameUIManager.cs
+62
-0
PlayEngine.cs
RhythmKata/Assets/Scripts/PlayEngine.cs
+1
-1
No files found.
RhythmKata/Assets/Scenes/mergescene.unity
View file @
7561f915
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/IngameUIManager.cs
View file @
7561f915
...
...
@@ -3,6 +3,13 @@ using System.Collections.Generic;
using
UnityEngine
;
using
UnityEngine.UI
;
public
enum
UISetType
{
INGAME
,
SELECTION
,
RESULT
}
public
class
IngameUIManager
:
SingletonBehaviour
<
IngameUIManager
>
{
public
GameObject
ringUIPrefab
;
...
...
@@ -11,9 +18,17 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
public
Text
comboText
;
private
Vector3
comboTextPosition
;
private
int
musicIdx
=
0
;
public
Image
prevMusicImage
,
nextMusicImage
,
curMusicImage
;
public
List
<
GameObject
>
UISetList
=
new
List
<
GameObject
>();
public
Text
perfectCountText
,
hitCountText
,
missCountText
,
scoreResultText
,
maxComboText
;
private
void
Start
()
{
NoteObject
.
OnNoteHit
+=
OnNoteHit
;
ChangeUISet
(
UISetType
.
SELECTION
);
}
public
void
OnNoteHit
(
JudgeResult
type
)
{
...
...
@@ -47,4 +62,51 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
}
comboText
.
transform
.
localPosition
=
Vector3
.
zero
;
}
public
void
OnChangeMusicButtonClicked
(
int
delta
)
{
musicIdx
+=
delta
;
//Need MAX_MUSIC_COUNT constant in PlayEngine or etc...
/*
if (musicIdx < 0)
{
musicIdx = MAX_MUSIC_COUNT - 1;
}
else if (musicIdx > MAX_MUSIC_COUNT - 1)
{
musicIdx = 0;
}
prevMusicImage.sprite = ImageList[musicIdx - 1 >= 0 ?musicIdx - 1: MAX_MUSIC_COUNT - 1 ];
nextMusicImage.sprite = ImageList[musicIdx + 1 < MAX_MUSIC_COUNT ? musicIdx + 1 : 0 ];
curMusicImage.sprite = ImageList[musicIdx];
*/
}
public
void
OnStartButtonClicked
()
{
PlayEngine
.
inst
.
LoadAndPlay
(
musicIdx
);
ChangeUISet
(
UISetType
.
INGAME
);
}
public
void
ChangeUISet
(
UISetType
type
)
{
ChangeUISet
((
int
)
type
);
}
public
void
ChangeUISet
(
int
idx
)
{
foreach
(
var
set
in
UISetList
)
{
set
.
SetActive
(
false
);
}
UISetList
[
idx
].
SetActive
(
true
);
}
public
void
UpdateResultUIs
(
int
perfect
,
int
hit
,
int
miss
,
int
score
,
int
combo
)
{
perfectCountText
.
text
=
perfect
.
ToString
();
hitCountText
.
text
=
hit
.
ToString
();
missCountText
.
text
=
miss
.
ToString
();
scoreResultText
.
text
=
score
.
ToString
();
maxComboText
.
text
=
"x "
+
combo
.
ToString
();
}
}
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/PlayEngine.cs
View file @
7561f915
...
...
@@ -44,7 +44,7 @@ public class PlayEngine : SingletonBehaviour<PlayEngine>
public
void
Start
()
{
audioSource
=
GetComponent
<
AudioSource
>();
LoadAndPlay
(
0
);
//
LoadAndPlay(0);
}
public
void
LoadAndPlay
(
int
idx
)
...
...
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