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
c8c5b8aa
Commit
c8c5b8aa
authored
Nov 03, 2019
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forwardnote 구현
parent
37fb4b2b
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
995 additions
and
104 deletions
+995
-104
Materials.meta
RhythmKata/Assets/Materials.meta
+2
-3
DefaultNote.mat
RhythmKata/Assets/Materials/DefaultNote.mat
+101
-0
DefaultNote.mat.meta
RhythmKata/Assets/Materials/DefaultNote.mat.meta
+8
-0
EdgeNote.mat
RhythmKata/Assets/Materials/EdgeNote.mat
+101
-0
EdgeNote.mat.meta
RhythmKata/Assets/Materials/EdgeNote.mat.meta
+8
-0
PinwheelFantasyEffect.meta
RhythmKata/Assets/PinwheelFantasyEffect.meta
+3
-1
Prefabs.meta
RhythmKata/Assets/Prefabs.meta
+8
-0
Ring.prefab
RhythmKata/Assets/Prefabs/Ring.prefab
+77
-0
Ring.prefab.meta
RhythmKata/Assets/Prefabs/Ring.prefab.meta
+7
-0
bs.unity
RhythmKata/Assets/Scenes/bs.unity
+366
-58
EdgeNoteObject.cs
RhythmKata/Assets/Scripts/EdgeNoteObject.cs
+18
-0
EdgeNoteObject.cs.meta
RhythmKata/Assets/Scripts/EdgeNoteObject.cs.meta
+11
-0
ForwardNoteObject.cs
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
+48
-0
ForwardNoteObject.cs.meta
RhythmKata/Assets/Scripts/ForwardNoteObject.cs.meta
+11
-0
GameManager.cs
RhythmKata/Assets/Scripts/GameManager.cs
+1
-1
IngameUIManager.cs
RhythmKata/Assets/Scripts/IngameUIManager.cs
+12
-2
Note.cs
RhythmKata/Assets/Scripts/Note.cs
+0
-38
NoteObject.cs
RhythmKata/Assets/Scripts/NoteObject.cs
+49
-0
NoteObject.cs.meta
RhythmKata/Assets/Scripts/NoteObject.cs.meta
+0
-0
SingletonBehaviour.cs
RhythmKata/Assets/Scripts/SingletonBehaviour.cs
+37
-0
SingletonBehaviour.cs.meta
RhythmKata/Assets/Scripts/SingletonBehaviour.cs.meta
+11
-0
Resources.meta
RhythmKata/Assets/SteamVR_Resources/Resources.meta
+1
-1
ring.png
RhythmKata/Assets/ring.png
+0
-0
ring.png.meta
RhythmKata/Assets/ring.png.meta
+115
-0
No files found.
RhythmKata/Assets/
SteamVR/Input/Editor/Resource
s.meta
→
RhythmKata/Assets/
Material
s.meta
View file @
c8c5b8aa
fileFormatVersion: 2
guid:
7d5e740d15d7ca249b884d30ff558bc1
guid:
de818af80ad396d408717e02d3584fb9
folderAsset: yes
timeCreated: 1547747995
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Materials/DefaultNote.mat
0 → 100644
View file @
c8c5b8aa
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
6
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Note
m_Shader
:
{
fileID
:
10753
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ShaderKeywords
:
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_AlphaTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DecalTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_SpecGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Floats
:
-
PixelSnap
:
0
-
_BumpScale
:
1
-
_ColorMask
:
15
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_EnableExternalAlpha
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0.5
-
_GlossyReflections
:
1
-
_Metallic
:
0
-
_Mode
:
0
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_Stencil
:
0
-
_StencilComp
:
8
-
_StencilOp
:
0
-
_StencilReadMask
:
255
-
_StencilWriteMask
:
255
-
_UVSec
:
0
-
_UseUIAlphaClip
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
-
_Flip
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_RendererColor
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_SpecColor
:
{
r
:
0.19999996
,
g
:
0.19999996
,
b
:
0.19999996
,
a
:
1
}
RhythmKata/Assets/Materials/DefaultNote.mat.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: e5126cfe2f1b13144a54b88b7c55be50
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Materials/EdgeNote.mat
0 → 100644
View file @
c8c5b8aa
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
6
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Note
m_Shader
:
{
fileID
:
10753
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ShaderKeywords
:
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_AlphaTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DecalTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_SpecGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Floats
:
-
PixelSnap
:
0
-
_BumpScale
:
1
-
_ColorMask
:
15
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_EnableExternalAlpha
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0.5
-
_GlossyReflections
:
1
-
_Metallic
:
0
-
_Mode
:
0
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_Stencil
:
0
-
_StencilComp
:
8
-
_StencilOp
:
0
-
_StencilReadMask
:
255
-
_StencilWriteMask
:
255
-
_UVSec
:
0
-
_UseUIAlphaClip
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
-
_Flip
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_RendererColor
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_SpecColor
:
{
r
:
0.19999996
,
g
:
0.19999996
,
b
:
0.19999996
,
a
:
1
}
RhythmKata/Assets/Materials/EdgeNote.mat.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: c14b6a54d1736a94b94ac379f0cc3f76
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/
SteamVR/Resources
.meta
→
RhythmKata/Assets/
PinwheelFantasyEffect
.meta
View file @
c8c5b8aa
fileFormatVersion: 2
guid:
40af2f692be87864ba388a27fcac9ed8
guid:
fb899d0efba85f14f8aa97aa7d5646c7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Prefabs.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: 69f8a36c4c2b83744bb1c90ce4fe7cd9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Prefabs/Ring.prefab
0 → 100644
View file @
c8c5b8aa
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&8100479809720507869
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
8100479809720507868
}
-
component
:
{
fileID
:
8100479809720507870
}
-
component
:
{
fileID
:
8100479809720507871
}
m_Layer
:
5
m_Name
:
Ring
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&8100479809720507868
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8100479809720507869
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
5
,
y
:
5
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
1.1
,
y
:
1.1
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&8100479809720507870
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8100479809720507869
}
m_CullTransparentMesh
:
0
---
!u!114
&8100479809720507871
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
8100479809720507869
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
fe87c0e1cc204ed48ad3b37840f39efc
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_TypeName
:
UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite
:
{
fileID
:
21300000
,
guid
:
ed5e85d6ad7b15842ae3af65f11a4b90
,
type
:
3
}
m_Type
:
0
m_PreserveAspect
:
0
m_FillCenter
:
1
m_FillMethod
:
4
m_FillAmount
:
1
m_FillClockwise
:
1
m_FillOrigin
:
0
m_UseSpriteMesh
:
0
m_PixelsPerUnitMultiplier
:
1
RhythmKata/Assets/Prefabs/Ring.prefab.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: 13fc3a8405d796e4e87e099e870cc446
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Scenes/bs.unity
View file @
c8c5b8aa
This diff is collapsed.
Click to expand it.
RhythmKata/Assets/Scripts/EdgeNoteObject.cs
0 → 100644
View file @
c8c5b8aa
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
EdgeNoteObject
:
MonoBehaviour
{
// Start is called before the first frame update
void
Start
()
{
}
// Update is called once per frame
void
Update
()
{
}
}
RhythmKata/Assets/Scripts/EdgeNoteObject.cs.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: 9d22c6dafddad8240b23e0f8364a5fd2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Scripts/ForwardNoteObject.cs
0 → 100644
View file @
c8c5b8aa
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
ForwardNoteObject
:
NoteObject
{
public
RectTransform
ring
;
public
override
void
Init
(
float
x
,
float
y
)
{
base
.
Init
(
x
,
y
);
//Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width * x, Screen.height * y, Camera.main.nearClipPlane));
//
perfectZ
=
IngameUIManager
.
inst
.
transform
.
position
.
z
;
Ray
ray
=
Camera
.
main
.
ScreenPointToRay
(
new
Vector3
(
Screen
.
width
*
x
,
Screen
.
height
*
y
,
Camera
.
main
.
nearClipPlane
));
endPoint
=
ray
.
GetPoint
(
perfectZ
);
Debug
.
Log
(
endPoint
);
transform
.
position
=
endPoint
+
new
Vector3
(
0
,
0
,
50
);
ring
=
IngameUIManager
.
inst
.
AddNoteRingUI
();
ring
.
position
=
endPoint
;
}
private
void
Start
()
{
Init
(
Random
.
Range
(
0f
,
1f
),
Random
.
Range
(
0f
,
1f
));
}
protected
override
void
OnDestroy
()
{
base
.
OnDestroy
();
Destroy
(
ring
.
gameObject
);
}
public
override
void
NoteHit
(
NoteHitType
type
)
{
//OnNoteHit(NoteHitType.PERFECT, 300);
}
public
override
void
SetPosition
(
float
remainedTime
)
{
base
.
SetPosition
(
remainedTime
);
ring
.
localScale
=
(
1
+
4
*
remainedTime
/
maxRemainedTime
)
*
new
Vector3
(
1
,
1
,
1
);
if
(
ring
.
localScale
.
x
<
0
)
Destroy
(
gameObject
);
}
}
RhythmKata/Assets/Scripts/ForwardNoteObject.cs.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: 5ede6b16436a58b4bb3118a59fd1a9ba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/Scripts/GameManager.cs
View file @
c8c5b8aa
...
...
@@ -14,7 +14,7 @@ public class GameManager : MonoBehaviour
private
void
Start
()
{
Note
.
OnNoteHit
+=
UpdateScore
;
Note
Object
.
OnNoteHit
+=
UpdateScore
;
}
public
void
StartStage
()
...
...
RhythmKata/Assets/Scripts/IngameUIManager.cs
View file @
c8c5b8aa
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
IngameUIManager
:
MonoBehaviour
public
class
IngameUIManager
:
SingletonBehaviour
<
IngameUIManager
>
{
public
GameObject
ringUIPrefab
;
public
List
<
GameObject
>
hitEffectPrefabs
=
new
List
<
GameObject
>();
private
void
Start
()
{
Note
.
OnNoteHit
+=
OnNoteHit
;
Note
Object
.
OnNoteHit
+=
OnNoteHit
;
}
public
void
OnNoteHit
(
NoteHitType
type
,
int
score
)
{
}
public
RectTransform
AddNoteRingUI
()
{
return
Instantiate
(
ringUIPrefab
,
transform
).
GetComponent
<
RectTransform
>();
}
}
RhythmKata/Assets/Scripts/Note.cs
deleted
100644 → 0
View file @
37fb4b2b
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
enum
NoteHitType
{
PERFECT
,
GOOD
,
BAD
,
MISS
}
public
class
Note
:
MonoBehaviour
{
public
static
Action
<
NoteHitType
,
int
>
OnNoteHit
;
private
float
remainedTime
=
5
;
public
Vector3
startPoint
=
new
Vector3
(
0
,
0
,
50
);
public
float
maxRemainedTime
=
5
;
public
float
perfectZ
=
10
;
private
void
Start
()
{
transform
.
position
=
startPoint
;
}
public
void
NoteHit
()
{
OnNoteHit
(
NoteHitType
.
PERFECT
,
300
);
}
public
void
SetPosition
(
float
remainedTime
)
{
transform
.
position
=
Vector3
.
Lerp
(
startPoint
,
new
Vector3
(
startPoint
.
x
,
startPoint
.
y
,
perfectZ
),
remainedTime
/
maxRemainedTime
);
}
}
RhythmKata/Assets/Scripts/NoteObject.cs
0 → 100644
View file @
c8c5b8aa
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
enum
NoteHitType
{
PERFECT
,
GOOD
,
BAD
,
MISS
}
public
abstract
class
NoteObject
:
MonoBehaviour
{
public
static
Action
<
NoteHitType
,
int
>
OnNoteHit
;
protected
float
remainedTime
;
public
Vector3
startPoint
{
get
{
return
endPoint
+
new
Vector3
(
0
,
0
,
50
);
}
}
public
Vector3
endPoint
;
public
float
maxRemainedTime
=
1
;
public
float
perfectZ
=
10
;
protected
virtual
void
Update
()
{
//for debug
remainedTime
-=
Time
.
deltaTime
;
SetPosition
(
remainedTime
);
}
protected
virtual
void
OnDestroy
()
{
}
public
virtual
void
Init
(
float
x
,
float
y
)
{
remainedTime
=
maxRemainedTime
;
}
public
abstract
void
NoteHit
(
NoteHitType
type
);
public
virtual
void
SetPosition
(
float
remainedTime
)
{
transform
.
position
=
endPoint
+
new
Vector3
(
0
,
0
,
50
)
*
remainedTime
/
maxRemainedTime
;
}
}
RhythmKata/Assets/Scripts/Note.cs.meta
→
RhythmKata/Assets/Scripts/Note
Object
.cs.meta
View file @
c8c5b8aa
File moved
RhythmKata/Assets/Scripts/SingletonBehaviour.cs
0 → 100644
View file @
c8c5b8aa
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
SingletonBehaviour
<
T
>
:
MonoBehaviour
where
T
:
MonoBehaviour
{
private
static
T
_inst
=
null
;
public
static
T
inst
{
get
{
if
(
_inst
==
null
)
{
if
(
FindObjectsOfType
<
T
>().
Length
>
1
)
Debug
.
LogError
(
"More than one"
);
else
if
(
FindObjectOfType
<
T
>()
!=
null
)
_inst
=
FindObjectOfType
<
T
>();
else
{
GameObject
go
=
new
GameObject
{
name
=
typeof
(
T
).
Name
};
_inst
=
go
.
AddComponent
<
T
>();
}
}
return
_inst
;
}
}
public
void
SetStatic
()
{
if
(
_inst
!=
null
)
DontDestroyOnLoad
(
_inst
.
gameObject
);
}
}
RhythmKata/Assets/Scripts/SingletonBehaviour.cs.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: 95fb5fdfe9fe09348bd9e6232aec085b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
RhythmKata/Assets/SteamVR_Resources/Resources.meta
View file @
c8c5b8aa
fileFormatVersion: 2
guid:
53e7865ed14c65d4587a4fa922c6d0d7
guid:
63951b5c98c98d94bb25b53a400cecb9
folderAsset: yes
DefaultImporter:
externalObjects: {}
...
...
RhythmKata/Assets/ring.png
0 → 100644
View file @
c8c5b8aa
28.5 KB
RhythmKata/Assets/ring.png.meta
0 → 100644
View file @
c8c5b8aa
fileFormatVersion: 2
guid: ed5e85d6ad7b15842ae3af65f11a4b90
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
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