Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
ButtonPusher
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
Button Pusher
ButtonPusher
Commits
540ef035
Commit
540ef035
authored
7 years ago
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring class 'TrackInfo'
parent
8d2a3d7c
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1102 additions
and
174 deletions
+1102
-174
InitTestScene636511946751484252.unity
Assets/InitTestScene636511946751484252.unity
+355
-0
InitTestScene636511946751484252.unity.meta
Assets/InitTestScene636511946751484252.unity.meta
+9
-0
InitTestScene636511952132748649.unity
Assets/InitTestScene636511952132748649.unity
+355
-0
InitTestScene636511952132748649.unity.meta
Assets/InitTestScene636511952132748649.unity.meta
+9
-0
CoordinateMapperManager.cs
Assets/Script/CoordinateMapperManager.cs
+7
-1
CoordinateMapperView.cs
Assets/Script/CoordinateMapperView.cs
+4
-2
CoordinateMapperViewTests.cs
Assets/Script/Tests/CoordinateMapperViewTests.cs
+37
-35
TrackInfo.cs
Assets/Script/TrackInfo.cs
+313
-128
TrackManager.cs
Assets/Script/TrackManager.cs
+12
-7
ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+1
-1
No files found.
Assets/InitTestScene636511946751484252.unity
0 → 100644
View file @
540ef035
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!29
&1
OcclusionCullingSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_OcclusionBakeSettings
:
smallestOccluder
:
5
smallestHole
:
0.25
backfaceThreshold
:
100
m_SceneGUID
:
00000000000000000000000000000000
m_OcclusionCullingData
:
{
fileID
:
0
}
---
!u!104
&2
RenderSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
8
m_Fog
:
0
m_FogColor
:
{
r
:
0.5
,
g
:
0.5
,
b
:
0.5
,
a
:
1
}
m_FogMode
:
3
m_FogDensity
:
0.01
m_LinearFogStart
:
0
m_LinearFogEnd
:
300
m_AmbientSkyColor
:
{
r
:
0.212
,
g
:
0.227
,
b
:
0.259
,
a
:
1
}
m_AmbientEquatorColor
:
{
r
:
0.114
,
g
:
0.125
,
b
:
0.133
,
a
:
1
}
m_AmbientGroundColor
:
{
r
:
0.047
,
g
:
0.043
,
b
:
0.035
,
a
:
1
}
m_AmbientIntensity
:
1
m_AmbientMode
:
0
m_SubtractiveShadowColor
:
{
r
:
0.42
,
g
:
0.478
,
b
:
0.627
,
a
:
1
}
m_SkyboxMaterial
:
{
fileID
:
10304
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_HaloStrength
:
0.5
m_FlareStrength
:
1
m_FlareFadeSpeed
:
3
m_HaloTexture
:
{
fileID
:
0
}
m_SpotCookie
:
{
fileID
:
10001
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_DefaultReflectionMode
:
0
m_DefaultReflectionResolution
:
128
m_ReflectionBounces
:
1
m_ReflectionIntensity
:
1
m_CustomReflection
:
{
fileID
:
0
}
m_Sun
:
{
fileID
:
0
}
m_IndirectSpecularColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
---
!u!157
&3
LightmapSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
11
m_GIWorkflowMode
:
1
m_GISettings
:
serializedVersion
:
2
m_BounceScale
:
1
m_IndirectOutputScale
:
1
m_AlbedoBoost
:
1
m_TemporalCoherenceThreshold
:
1
m_EnvironmentLightingMode
:
0
m_EnableBakedLightmaps
:
1
m_EnableRealtimeLightmaps
:
1
m_LightmapEditorSettings
:
serializedVersion
:
9
m_Resolution
:
2
m_BakeResolution
:
40
m_TextureWidth
:
1024
m_TextureHeight
:
1024
m_AO
:
0
m_AOMaxDistance
:
1
m_CompAOExponent
:
1
m_CompAOExponentDirect
:
0
m_Padding
:
2
m_LightmapParameters
:
{
fileID
:
0
}
m_LightmapsBakeMode
:
1
m_TextureCompression
:
1
m_FinalGather
:
0
m_FinalGatherFiltering
:
1
m_FinalGatherRayCount
:
256
m_ReflectionCompression
:
2
m_MixedBakeMode
:
2
m_BakeBackend
:
0
m_PVRSampling
:
1
m_PVRDirectSampleCount
:
32
m_PVRSampleCount
:
500
m_PVRBounces
:
2
m_PVRFilterTypeDirect
:
0
m_PVRFilterTypeIndirect
:
0
m_PVRFilterTypeAO
:
0
m_PVRFilteringMode
:
1
m_PVRCulling
:
1
m_PVRFilteringGaussRadiusDirect
:
1
m_PVRFilteringGaussRadiusIndirect
:
5
m_PVRFilteringGaussRadiusAO
:
2
m_PVRFilteringAtrousPositionSigmaDirect
:
0.5
m_PVRFilteringAtrousPositionSigmaIndirect
:
2
m_PVRFilteringAtrousPositionSigmaAO
:
1
m_ShowResolutionOverlay
:
1
m_LightingDataAsset
:
{
fileID
:
0
}
m_UseShadowmask
:
1
---
!u!196
&4
NavMeshSettings
:
serializedVersion
:
2
m_ObjectHideFlags
:
0
m_BuildSettings
:
serializedVersion
:
2
agentTypeID
:
0
agentRadius
:
0.5
agentHeight
:
2
agentSlope
:
45
agentClimb
:
0.4
ledgeDropHeight
:
0
maxJumpAcrossDistance
:
0
minRegionArea
:
2
manualCellSize
:
0
cellSize
:
0.16666667
manualTileSize
:
0
tileSize
:
256
accuratePlacement
:
0
debug
:
m_Flags
:
0
m_NavMeshData
:
{
fileID
:
0
}
---
!u!1
&16548550
GameObject
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
serializedVersion
:
5
m_Component
:
-
component
:
{
fileID
:
16548553
}
-
component
:
{
fileID
:
16548552
}
-
component
:
{
fileID
:
16548551
}
m_Layer
:
0
m_Name
:
Code-based tests runner
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&16548551
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
16548550
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1619214696
,
guid
:
53ebcfaa2e1e4e2dbc85882cd5a73fa1
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&16548552
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
16548550
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-1751138608
,
guid
:
53ebcfaa2e1e4e2dbc85882cd5a73fa1
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
testStartedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
16548551
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
589035149
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
1033339993
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.TestStartedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
testFinishedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
16548551
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
589035149
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
1033339993
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.TestFinishedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
runStartedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
16548551
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
589035149
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
1033339993
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.RunStartedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
runFinishedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
16548551
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
589035149
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
1033339993
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.RunFinishedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
cleanupVerifier
:
m_ExistingFiles
:
[]
m_ExistingFilesScanned
:
0
settings
:
filter
:
groupNames
:
-
CoordinateMapperViewTests
categories
:
[]
testNames
:
[]
sceneBased
:
0
originalScene
:
Assets/Scene/InGame.unity
bootstrapScene
:
Assets/InitTestScene636511946751484252.unity
resultFilePath
:
isBatchModeRun
:
0
---
!u!4
&16548553
Transform
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
16548550
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&589035149
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-1026517869
,
guid
:
4113173d5e95493ab8765d7b08371de4
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&1033339993
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1703293177
,
guid
:
4113173d5e95493ab8765d7b08371de4
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
This diff is collapsed.
Click to expand it.
Assets/InitTestScene636511946751484252.unity.meta
0 → 100644
View file @
540ef035
fileFormatVersion: 2
guid: 927664c416bad5248b093f481aeb9dcf
timeCreated: 1515565475
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Assets/InitTestScene636511952132748649.unity
0 → 100644
View file @
540ef035
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!29
&1
OcclusionCullingSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_OcclusionBakeSettings
:
smallestOccluder
:
5
smallestHole
:
0.25
backfaceThreshold
:
100
m_SceneGUID
:
00000000000000000000000000000000
m_OcclusionCullingData
:
{
fileID
:
0
}
---
!u!104
&2
RenderSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
8
m_Fog
:
0
m_FogColor
:
{
r
:
0.5
,
g
:
0.5
,
b
:
0.5
,
a
:
1
}
m_FogMode
:
3
m_FogDensity
:
0.01
m_LinearFogStart
:
0
m_LinearFogEnd
:
300
m_AmbientSkyColor
:
{
r
:
0.212
,
g
:
0.227
,
b
:
0.259
,
a
:
1
}
m_AmbientEquatorColor
:
{
r
:
0.114
,
g
:
0.125
,
b
:
0.133
,
a
:
1
}
m_AmbientGroundColor
:
{
r
:
0.047
,
g
:
0.043
,
b
:
0.035
,
a
:
1
}
m_AmbientIntensity
:
1
m_AmbientMode
:
0
m_SubtractiveShadowColor
:
{
r
:
0.42
,
g
:
0.478
,
b
:
0.627
,
a
:
1
}
m_SkyboxMaterial
:
{
fileID
:
10304
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_HaloStrength
:
0.5
m_FlareStrength
:
1
m_FlareFadeSpeed
:
3
m_HaloTexture
:
{
fileID
:
0
}
m_SpotCookie
:
{
fileID
:
10001
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_DefaultReflectionMode
:
0
m_DefaultReflectionResolution
:
128
m_ReflectionBounces
:
1
m_ReflectionIntensity
:
1
m_CustomReflection
:
{
fileID
:
0
}
m_Sun
:
{
fileID
:
0
}
m_IndirectSpecularColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
---
!u!157
&3
LightmapSettings
:
m_ObjectHideFlags
:
0
serializedVersion
:
11
m_GIWorkflowMode
:
1
m_GISettings
:
serializedVersion
:
2
m_BounceScale
:
1
m_IndirectOutputScale
:
1
m_AlbedoBoost
:
1
m_TemporalCoherenceThreshold
:
1
m_EnvironmentLightingMode
:
0
m_EnableBakedLightmaps
:
1
m_EnableRealtimeLightmaps
:
1
m_LightmapEditorSettings
:
serializedVersion
:
9
m_Resolution
:
2
m_BakeResolution
:
40
m_TextureWidth
:
1024
m_TextureHeight
:
1024
m_AO
:
0
m_AOMaxDistance
:
1
m_CompAOExponent
:
1
m_CompAOExponentDirect
:
0
m_Padding
:
2
m_LightmapParameters
:
{
fileID
:
0
}
m_LightmapsBakeMode
:
1
m_TextureCompression
:
1
m_FinalGather
:
0
m_FinalGatherFiltering
:
1
m_FinalGatherRayCount
:
256
m_ReflectionCompression
:
2
m_MixedBakeMode
:
2
m_BakeBackend
:
0
m_PVRSampling
:
1
m_PVRDirectSampleCount
:
32
m_PVRSampleCount
:
500
m_PVRBounces
:
2
m_PVRFilterTypeDirect
:
0
m_PVRFilterTypeIndirect
:
0
m_PVRFilterTypeAO
:
0
m_PVRFilteringMode
:
1
m_PVRCulling
:
1
m_PVRFilteringGaussRadiusDirect
:
1
m_PVRFilteringGaussRadiusIndirect
:
5
m_PVRFilteringGaussRadiusAO
:
2
m_PVRFilteringAtrousPositionSigmaDirect
:
0.5
m_PVRFilteringAtrousPositionSigmaIndirect
:
2
m_PVRFilteringAtrousPositionSigmaAO
:
1
m_ShowResolutionOverlay
:
1
m_LightingDataAsset
:
{
fileID
:
0
}
m_UseShadowmask
:
1
---
!u!196
&4
NavMeshSettings
:
serializedVersion
:
2
m_ObjectHideFlags
:
0
m_BuildSettings
:
serializedVersion
:
2
agentTypeID
:
0
agentRadius
:
0.5
agentHeight
:
2
agentSlope
:
45
agentClimb
:
0.4
ledgeDropHeight
:
0
maxJumpAcrossDistance
:
0
minRegionArea
:
2
manualCellSize
:
0
cellSize
:
0.16666667
manualTileSize
:
0
tileSize
:
256
accuratePlacement
:
0
debug
:
m_Flags
:
0
m_NavMeshData
:
{
fileID
:
0
}
---
!u!114
&812693797
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1703293177
,
guid
:
4113173d5e95493ab8765d7b08371de4
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!1
&1330667971
GameObject
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
serializedVersion
:
5
m_Component
:
-
component
:
{
fileID
:
1330667974
}
-
component
:
{
fileID
:
1330667973
}
-
component
:
{
fileID
:
1330667972
}
m_Layer
:
0
m_Name
:
Code-based tests runner
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&1330667972
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1330667971
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1619214696
,
guid
:
53ebcfaa2e1e4e2dbc85882cd5a73fa1
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&1330667973
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1330667971
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-1751138608
,
guid
:
53ebcfaa2e1e4e2dbc85882cd5a73fa1
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
testStartedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
1330667972
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
2079415433
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
812693797
}
m_MethodName
:
TestStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.TestStartedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
testFinishedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
1330667972
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
2079415433
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
812693797
}
m_MethodName
:
TestFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.TestFinishedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
runStartedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
1330667972
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
2079415433
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
812693797
}
m_MethodName
:
RunStarted
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.RunStartedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
runFinishedEvent
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
1330667972
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
2079415433
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
-
m_Target
:
{
fileID
:
812693797
}
m_MethodName
:
RunFinished
m_Mode
:
0
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
m_IntArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.TestTools.TestRunner.RunFinishedEvent, UnityEngine.TestRunner,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
cleanupVerifier
:
m_ExistingFiles
:
[]
m_ExistingFilesScanned
:
0
settings
:
filter
:
groupNames
:
-
CoordinateMapperViewTests
categories
:
[]
testNames
:
[]
sceneBased
:
0
originalScene
:
Assets/InitTestScene636511946751484252.unity
bootstrapScene
:
Assets/InitTestScene636511952132748649.unity
resultFilePath
:
isBatchModeRun
:
0
---
!u!4
&1330667974
Transform
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1330667971
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&2079415433
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_PrefabParentObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
-1026517869
,
guid
:
4113173d5e95493ab8765d7b08371de4
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
This diff is collapsed.
Click to expand it.
Assets/InitTestScene636511952132748649.unity.meta
0 → 100644
View file @
540ef035
fileFormatVersion: 2
guid: a83a7fa7a4f7f6b4382c0b23b43fe313
timeCreated: 1515566013
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Assets/Script/CoordinateMapperManager.cs
View file @
540ef035
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
using
Windows.Kinect
;
using
Windows.Kinect
;
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Linq
;
using
System.Linq
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -20,6 +19,13 @@ public class CoordinateMapperManager : MonoBehaviour
...
@@ -20,6 +19,13 @@ public class CoordinateMapperManager : MonoBehaviour
Texture2D
_ColorRGBX
;
Texture2D
_ColorRGBX
;
// In play mode, GUI for Null frame should show when Kinect cannot access.
// In play mode, GUI for FPS always show.
// In play mode, ColorTexture should not be null value.
// In play mode, BodyIndexBuffer should not be null value.
// In play mode, DepthCoordinates should not be null value.
// In play mode, BodyBuffer should not be null value.
public
Texture2D
ColorTexture
public
Texture2D
ColorTexture
{
get
{
return
_ColorRGBX
;
}
}
{
get
{
return
_ColorRGBX
;
}
}
public
byte
[]
BodyIndexBuffer
public
byte
[]
BodyIndexBuffer
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/CoordinateMapperView.cs
View file @
540ef035
...
@@ -10,6 +10,8 @@ public class CoordinateMapperView : MonoBehaviour
...
@@ -10,6 +10,8 @@ public class CoordinateMapperView : MonoBehaviour
private
DepthSpacePoint
[]
DepthPoints
;
private
DepthSpacePoint
[]
DepthPoints
;
private
byte
[]
BodyIndexPoints
;
private
byte
[]
BodyIndexPoints
;
// In play mode, texture of gameobject should be same as texture which made by shader when after update.
void
Start
()
void
Start
()
{
{
CoordinateMapperManager
CoordinateMapperManager
=
GameObject
.
Find
(
"Managers"
).
GetComponent
<
CoordinateMapperManager
>();
CoordinateMapperManager
CoordinateMapperManager
=
GameObject
.
Find
(
"Managers"
).
GetComponent
<
CoordinateMapperManager
>();
...
...
This diff is collapsed.
Click to expand it.
Assets/Script/Tests/CoordinateMapperViewTests.cs
View file @
540ef035
...
@@ -6,22 +6,22 @@ using Windows.Kinect;
...
@@ -6,22 +6,22 @@ using Windows.Kinect;
using
System.Runtime.InteropServices
;
using
System.Runtime.InteropServices
;
using
System
;
using
System
;
namespace
Assets.Script.
Tests
class
CoordinateMapperView
Tests
{
{
class
CoordinateMapperViewTests
{
[
Test
]
public
void
CoordinateMapperViewTestsSimplePasses
()
{
// Use the Assert class to test conditions.
}
// A UnityTest behaves like a coroutine in PlayMode
// A UnityTest behaves like a coroutine in PlayMode
// and allows you to yield null to skip a frame in EditMode
// and allows you to yield null to skip a frame in EditMode
[
UnityTest
]
[
UnityTest
]
public
IEnumerator
CoordinateMapperViewTestsWithEnumeratorPasses
()
public
IEnumerator
MainTexture_Equal_Texture_Generate_By_Shader_When_After_Update
()
{
{
var
CoordinateMapperManager
=
GameObject
.
Find
(
"Managers"
).
GetComponent
<
CoordinateMapperManager
>();
yield
return
null
;
GameManager
.
Instance
.
SceneTransition
(
"InGame"
);
yield
return
null
;
var
Managers
=
GameObject
.
Find
(
"Managers"
);
var
CoordinateMapperManager
=
Managers
.
GetComponent
<
CoordinateMapperManager
>();
var
tmpObj
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Plane
);
var
tmpObj
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Plane
);
tmpObj
.
GetComponent
<
Renderer
>().
material
=
Resources
.
Load
(
"GreenScreen/GreenScreen.mat"
,
typeof
(
Material
))
as
Material
;
tmpObj
.
GetComponent
<
Renderer
>().
material
=
Resources
.
Load
(
"GreenScreen/GreenScreen.mat"
,
typeof
(
Material
))
as
Material
;
...
@@ -41,7 +41,9 @@ namespace Assets.Script.Tests
...
@@ -41,7 +41,9 @@ namespace Assets.Script.Tests
// yield to skip a frame
// yield to skip a frame
yield
return
null
;
yield
return
null
;
Assert
.
AreEqual
(
tmpObj
.
GetComponent
<
Renderer
>().
material
.
mainTexture
,
CoordinateMapperView
.
GetComponent
<
Renderer
>().
material
.
mainTexture
,
"CoordinateMapperViewTest Failed."
);
var
expected
=
tmpObj
.
GetComponent
<
Renderer
>().
material
.
mainTexture
;
}
var
actual
=
CoordinateMapperView
.
GetComponent
<
Renderer
>().
material
.
mainTexture
;
Assert
.
AreEqual
(
expected
,
actual
,
"texture of gameobject should be same as texture which made by shader."
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Assets/Script/TrackInfo.cs
View file @
540ef035
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
...
@@ -18,17 +19,24 @@ public class TrackInfo
...
@@ -18,17 +19,24 @@ public class TrackInfo
public
List
<
Note
>
Notes
{
get
;
private
set
;
}
public
List
<
Note
>
Notes
{
get
;
private
set
;
}
public
TrackInfo
(
string
path
):
this
(
new
FileInfo
(
path
))
{
}
public
TrackInfo
(
string
path
):
this
(
new
FileInfo
(
path
))
{
}
public
TrackInfo
(
FileInfo
file
)
public
TrackInfo
(
FileInfo
file
)
{
{
TrackList
=
new
List
<
string
>();
MultiDictionary
<
string
,
string
>
parseResult
=
ParseBPE
(
file
);
ExtractTrackHeader
(
parseResult
);
ParseBPEHeader
(
file
);
TrackNotes
notes
=
new
TrackNotes
();
Notes
=
ParseBPENote
(
file
);
notes
.
ExtractNotes
(
parseResult
,
BPM
);
Notes
=
notes
.
Notes
;
}
}
private
void
ParseBPEHeader
(
FileInfo
file
)
MultiDictionary
<
string
,
string
>
ParseBPE
(
FileInfo
file
)
{
{
MultiDictionary
<
string
,
string
>
result
=
new
MultiDictionary
<
string
,
string
>();
using
(
StreamReader
reader
using
(
StreamReader
reader
=
new
StreamReader
(
new
BufferedStream
(
file
.
OpenRead
())))
=
new
StreamReader
(
new
BufferedStream
(
file
.
OpenRead
())))
{
{
...
@@ -39,147 +47,324 @@ public class TrackInfo
...
@@ -39,147 +47,324 @@ public class TrackInfo
continue
;
continue
;
string
[]
token
=
line
.
Split
(
new
char
[]
{
' '
},
2
);
string
[]
token
=
line
.
Split
(
new
char
[]
{
' '
},
2
);
string
field
=
token
[
0
];
string
value
=
token
[
1
].
Trim
();
result
[
token
[
0
]]
=
new
List
<
string
>
{
token
[
1
].
Trim
()
};
}
switch
(
field
)
}
{
case
"#TITLE"
:
return
result
;
Title
=
value
;
}
break
;
case
"#ARTIST"
:
private
void
ExtractTrackHeader
(
MultiDictionary
<
string
,
string
>
parseResult
)
Artist
=
value
;
{
break
;
TrackHeader
header
=
new
TrackHeader
();
case
"#GENRE"
:
header
.
ExtractHeader
(
parseResult
);
Genre
=
value
;
break
;
Title
=
header
.
Title
;
case
"#BPM"
:
Artist
=
header
.
Artist
;
float
outBPM
;
Genre
=
header
.
Genre
;
if
(
float
.
TryParse
(
value
,
out
outBPM
))
BPM
=
header
.
BPM
;
BPM
=
outBPM
;
Level
=
header
.
Level
;
else
TrackList
=
header
.
TrackList
;
BPM
=
0
;
BGM
=
header
.
BGM
;
break
;
}
case
"#PLAYLEVEL"
:
}
int
outLevel
;
if
(
int
.
TryParse
(
value
,
out
outLevel
))
internal
class
MultiDictionary
<
TKey
,
TValue
>
:
IEnumerable
<
KeyValuePair
<
TKey
,
List
<
TValue
>>>
Level
=
outLevel
;
{
private
Dictionary
<
TKey
,
List
<
TValue
>>
dictionary
=
new
Dictionary
<
TKey
,
List
<
TValue
>>();
public
List
<
TValue
>
this
[
TKey
key
]
{
get
{
List
<
TValue
>
list
;
if
(!
dictionary
.
TryGetValue
(
key
,
out
list
))
{
list
=
new
List
<
TValue
>();
dictionary
[
key
]
=
list
;
}
return
list
;
}
set
{
List
<
TValue
>
list
;
if
(!
dictionary
.
TryGetValue
(
key
,
out
list
))
dictionary
[
key
]
=
value
;
else
else
Level
=
0
;
dictionary
[
key
]
=
list
.
Concat
(
value
).
ToList
();
break
;
case
"#TRACKLIST"
:
TrackList
.
Add
(
value
);
break
;
case
"#WAV"
:
BGM
=
Resources
.
Load
(
value
)
as
AudioSource
;
break
;
}
}
}
}
public
bool
TryGetValue
(
TKey
key
,
out
List
<
TValue
>
value
)
{
return
dictionary
.
TryGetValue
(
key
,
out
value
);
}
}
public
IEnumerator
<
KeyValuePair
<
TKey
,
List
<
TValue
>>>
GetEnumerator
()
{
return
dictionary
.
GetEnumerator
();
}
}
public
List
<
Note
>
ParseBPENote
(
FileInfo
file
)
IEnumerator
IEnumerable
.
GetEnumerator
(
)
{
{
List
<
Note
>
notes
=
new
List
<
Note
>();
return
GetEnumerator
();
float
?
tempLongBtnStart
=
null
;
}
float
?
tempLongMtnStart
=
null
;
int
maxMeasure
=
0
;
public
bool
Remove
(
TKey
key
)
{
return
dictionary
.
Remove
(
key
);
}
}
using
(
StreamReader
reader
internal
class
TrackHeader
=
new
StreamReader
(
new
BufferedStream
(
file
.
OpenRead
())))
{
public
string
Title
{
get
;
private
set
;
}
public
string
Artist
{
get
;
private
set
;
}
public
string
Genre
{
get
;
private
set
;
}
public
float
BPM
{
get
;
private
set
;
}
public
int
Level
{
get
;
private
set
;
}
public
AudioSource
BGM
{
get
;
private
set
;
}
public
List
<
string
>
TrackList
{
get
;
private
set
;
}
public
void
ExtractHeader
(
MultiDictionary
<
string
,
string
>
parseResult
)
{
{
string
line
;
Title
=
ExtractMetaString
(
parseResult
,
"#TITLE"
);
while
((
line
=
reader
.
ReadLine
())
!=
null
)
Artist
=
ExtractMetaString
(
parseResult
,
"#ARTIST"
);
Genre
=
ExtractMetaString
(
parseResult
,
"#GENRE"
);
BPM
=
ExtractBPM
(
parseResult
);
Level
=
ExtractLevel
(
parseResult
);
TrackList
=
ExtractMetaList
(
parseResult
,
"#TRACKLIST"
);
BGM
=
Resources
.
Load
(
ExtractMetaString
(
parseResult
,
"#WAV"
))
as
AudioSource
;
}
private
List
<
string
>
ExtractMetaList
(
MultiDictionary
<
string
,
string
>
parseResult
,
string
key
)
{
{
if
(
line
==
""
||
line
[
0
]
!=
'#'
)
List
<
string
>
list
;
continue
;
string
[]
token
=
line
.
Split
(
new
char
[]
{
' '
},
2
);
if
(
parseResult
.
TryGetValue
(
key
,
out
list
))
string
field
=
token
[
0
];
{
string
value
=
token
[
1
].
Trim
();
parseResult
.
Remove
(
key
);
return
list
;
}
if
(
field
.
Length
!=
7
)
return
null
;
continue
;
}
private
string
ExtractMetaString
(
MultiDictionary
<
string
,
string
>
parseResult
,
string
key
)
{
List
<
string
>
list
=
ExtractMetaList
(
parseResult
,
key
);
return
list
==
null
?
null
:
list
[
0
];
}
private
float
ExtractBPM
(
MultiDictionary
<
string
,
string
>
parseResult
)
{
string
str
=
ExtractMetaString
(
parseResult
,
"#BPM"
);
float
outBPM
;
if
(
float
.
TryParse
(
str
,
out
outBPM
))
return
outBPM
;
else
return
0
;
}
private
int
ExtractLevel
(
MultiDictionary
<
string
,
string
>
parseResult
)
{
string
str
=
ExtractMetaString
(
parseResult
,
"#PLAYLEVEL"
);
int
outLevel
;
if
(
int
.
TryParse
(
str
,
out
outLevel
))
return
outLevel
;
else
return
0
;
}
}
internal
class
TrackNotes
{
private
List
<
Note
>
notes
=
new
List
<
Note
>();
public
List
<
Note
>
Notes
{
get
{
return
notes
;
}
}
public
void
ExtractNotes
(
MultiDictionary
<
string
,
string
>
parseResult
,
float
BPM
)
{
var
validSigns
=
ExtractValidSigns
(
parseResult
);
CreateNotes
(
validSigns
,
BPM
);
CreateBeatLines
(
ExtractEnd
(
validSigns
),
BPM
);
}
string
[]
CHANNELS
=
{
"SBT"
,
"LBT"
,
"SMO"
,
"LMO"
};
IEnumerable
<
KeyValuePair
<
string
,
List
<
string
>>>
ExtractValidSigns
(
MultiDictionary
<
string
,
string
>
parseResult
)
{
return
parseResult
.
Where
(
x
=>
IsValidSignType
(
x
.
Key
));
}
bool
IsValidSignType
(
string
signType
)
{
int
measure
;
int
measure
;
string
channel
=
field
.
Substring
(
4
,
3
);
if
(!
int
.
TryParse
(
field
.
Substring
(
1
,
3
),
out
measure
))
return
signType
.
Length
==
7
&&
continue
;
int
.
TryParse
(
signType
.
Substring
(
1
,
3
),
out
measure
)
&&
if
(
Array
.
FindIndex
(
CHANNELS
,
x
=>
x
==
channel
)
==
-
1
)
Enumerable
.
Contains
(
new
List
<
string
>
{
"SBT"
,
"LBT"
,
"SMO"
,
"LMO"
},
continue
;
signType
.
Substring
(
4
,
3
));
}
if
(
measure
>
maxMeasure
)
int
ExtractEnd
(
IEnumerable
<
KeyValuePair
<
string
,
List
<
string
>>>
validSigns
)
maxMeasure
=
measure
;
{
return
validSigns
.
Select
(
x
=>
int
.
Parse
(
x
.
Key
.
Substring
(
1
,
3
))).
Max
();
}
int
seq
=
value
.
Length
/
2
;
void
CreateBeatLines
(
int
end
,
float
BPM
)
float
ms
=
4
*
60
*
1000f
/
BPM
;
{
Notes
.
Concat
(
Enumerable
.
Range
(
1
,
(
end
+
1
)
*
4
)
.
Select
(
x
=>
new
Note
(
NoteType
.
BeatLine
,
(
x
/
4.0f
)
*
(
4
*
60
*
1000f
/
BPM
))));
}
for
(
int
i
=
0
;
i
<
seq
;
i
++
)
void
CreateNotes
(
IEnumerable
<
KeyValuePair
<
string
,
List
<
string
>>>
validSigns
,
float
BPM
)
{
{
string
key
=
value
.
Substring
(
i
*
2
,
2
);
notes
=
new
List
<
Note
>();
if
(
key
==
"00"
)
continue
;
float
timing
=
(
measure
+
(
float
)
i
/
seq
)
*
ms
;
validSigns
.
ToList
().
ForEach
(
x
=>
AddNoteSign
(
x
,
4
*
60
*
1000f
/
BPM
,
new
NoteMaker
()));
}
if
(
channel
==
"SBT"
)
void
AddNoteSign
(
KeyValuePair
<
string
,
List
<
string
>>
parsedItem
,
float
miliSeconds
,
NoteMaker
noteMaker
)
{
{
notes
.
Add
(
new
Note
(
key
,
channel
,
timing
));
parsedItem
.
Value
.
ForEach
(
x
=>
Notes
.
Concat
(
NoteSignGenerator
.
SignToNotes
(
x
,
parsedItem
.
Key
,
miliSeconds
,
noteMaker
)
));
}
}
else
if
(
channel
==
"LBT"
)
}
internal
class
NoteSignGenerator
{
public
static
IEnumerable
<
Note
>
SignToNotes
(
string
sign
,
string
signType
,
float
miliSeconds
,
NoteMaker
noteMaker
)
{
{
if
(
tempLongBtnStart
==
null
)
return
GenerateNoteSequence
(
Enumerable
.
Range
(
0
,
sign
.
Length
/
2
),
x
=>
CurrentCode
(
x
,
sign
),
x
=>
ComputeTiming
(
int
.
Parse
(
signType
.
Substring
(
1
,
3
)),
x
,
sign
.
Length
/
2
,
miliSeconds
),
(
code
,
timing
)
=>
MakeNote
(
noteMaker
,
code
,
signType
.
Substring
(
4
,
3
),
timing
));
}
static
string
CurrentCode
(
int
location
,
string
sign
)
{
{
tempLongBtnStart
=
timing
;
return
sign
.
Substring
(
location
*
2
,
2
);
continue
;
}
}
float
start
=
tempLongBtnStart
.
Value
;
static
float
ComputeTiming
(
float
measure
,
int
location
,
int
sequenceSize
,
float
miliSeconds
)
notes
.
Add
(
new
Note
(
key
,
channel
,
start
,
timing
));
{
return
(
measure
+
(
float
)
location
/
sequenceSize
)
*
miliSeconds
;
}
tempLongBtnStart
=
null
;
static
Note
MakeNote
(
NoteMaker
noteMaker
,
string
code
,
string
type
,
float
timing
)
{
return
noteMaker
.
Make
(
code
,
type
,
timing
);
}
}
Type
motionType
;
static
IEnumerable
<
Note
>
GenerateNoteSequence
(
IEnumerable
<
int
>
range
,
Func
<
int
,
string
>
currentCode
,
Func
<
int
,
float
>
calcTiming
,
Func
<
string
,
float
,
Note
>
concreteNote
)
if
(!
MotionNote
.
keymap
.
TryGetValue
(
key
,
out
motionType
))
{
continue
;
return
DiscreteRange
(
range
,
x
=>
currentCode
(
x
))
.
Select
(
x
=>
concreteNote
(
currentCode
(
x
),
calcTiming
(
x
)))
.
Where
(
x
=>
x
!=
null
);
}
if
(
channel
==
"SMO"
)
static
IEnumerable
<
int
>
DiscreteRange
(
IEnumerable
<
int
>
range
,
Func
<
int
,
string
>
currentCode
)
{
{
notes
.
Add
((
MotionNote
)
Activator
.
CreateInstance
(
return
range
.
Where
(
x
=>
currentCode
(
x
).
Equals
(
"00"
));
motionType
,
key
,
timing
));
}
}
else
if
(
channel
==
"LMO"
)
}
internal
abstract
class
NoteMakerBase
{
protected
float
?
Timing
=
null
;
public
Note
Make
(
string
code
,
string
type
,
float
timing
)
{
{
if
(
tempLongMtnStart
==
null
)
if
(
NotValidType
(
type
))
return
null
;
if
(
IsShort
(
type
))
return
MakeShort
(
code
,
type
,
timing
);
if
(
IsLongEnd
(
type
))
return
MakeLong
(
code
,
type
,
timing
);
RegisterTiming
(
timing
);
return
null
;
}
bool
IsShort
(
string
type
)
{
{
tempLongMtnStart
=
timing
;
return
type
[
0
]
==
'S'
;
continue
;
}
}
float
start
=
tempLongMtnStart
.
Value
;
bool
IsLongEnd
(
string
type
)
notes
.
Add
((
MotionNote
)
Activator
.
CreateInstance
(
{
motionType
,
key
,
start
,
timing
));
return
type
[
0
]
==
'L'
&&
Timing
!=
null
;
}
tempLongMtnStart
=
null
;
void
RegisterTiming
(
float
timing
)
{
Timing
=
timing
;
}
}
abstract
protected
bool
NotValidType
(
string
type
);
abstract
protected
Note
MakeShort
(
string
code
,
string
type
,
float
timing
);
abstract
protected
Note
MakeLong
(
string
code
,
string
type
,
float
timing
);
}
internal
class
ButtonNoteMaker
:
NoteMakerBase
{
override
protected
bool
NotValidType
(
string
type
)
{
return
type
.
Substring
(
1
)
!=
"BT"
;
}
}
override
protected
Note
MakeShort
(
string
code
,
string
type
,
float
timing
)
{
return
new
Note
(
code
,
type
,
timing
);
}
}
override
protected
Note
MakeLong
(
string
code
,
string
type
,
float
timing
)
{
float
start
=
Timing
.
Value
;
Timing
=
null
;
return
new
Note
(
code
,
type
,
start
,
timing
);
}
}
}
for
(
int
i
=
0
;
i
<=
maxMeasure
;
i
++)
internal
class
MotionNoteMaker
:
NoteMakerBase
{
override
protected
bool
NotValidType
(
string
type
)
{
{
for
(
int
j
=
1
;
j
<
4
;
j
++)
Type
motionType
;
return
type
.
Substring
(
1
)
!=
"MO"
||
!
MotionNote
.
keymap
.
TryGetValue
(
type
,
out
motionType
);
}
override
protected
Note
MakeShort
(
string
code
,
string
type
,
float
timing
)
{
{
notes
.
Add
(
new
Note
(
NoteType
.
BeatLine
,
(
i
+
(
float
)
j
/
4
)
*
4
*
60
*
1000f
/
BPM
));
return
(
MotionNote
)
Activator
.
CreateInstance
(
MotionNote
.
keymap
[
type
],
code
,
timing
);
}
}
notes
.
Add
(
new
Note
(
NoteType
.
BeatLine
,
(
i
+
1
)
*
4
*
60
*
1000f
/
BPM
));
override
protected
Note
MakeLong
(
string
code
,
string
type
,
float
timing
)
{
float
start
=
Timing
.
Value
;
Timing
=
null
;
return
(
MotionNote
)
Activator
.
CreateInstance
(
MotionNote
.
keymap
[
type
],
code
,
start
,
timing
);
}
}
}
internal
class
NoteMaker
{
ButtonNoteMaker
buttonNoteMaker
=
new
ButtonNoteMaker
();
MotionNoteMaker
motionNoteMaker
=
new
MotionNoteMaker
();
return
notes
;
public
Note
Make
(
string
code
,
string
type
,
float
timing
)
{
return
motionNoteMaker
.
Make
(
code
,
type
,
timing
)
??
buttonNoteMaker
.
Make
(
code
,
type
,
timing
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Assets/Script/TrackManager.cs
View file @
540ef035
...
@@ -81,13 +81,7 @@ public class TrackManager : MonoBehaviour {
...
@@ -81,13 +81,7 @@ public class TrackManager : MonoBehaviour {
void
LoadTracks
()
void
LoadTracks
()
{
{
var
files
=
new
DirectoryInfo
(
"Assets/Tracks"
).
GetFiles
(
"*.bpe"
,
SearchOption
.
AllDirectories
);
foreach
(
TrackInfo
track
in
LoadTrackInfos
())
List
<
TrackInfo
>
tracks
=
files
.
Select
(
s
=>
new
TrackInfo
(
s
)).
ToList
();
while
(
tracks
.
Count
()
<
5
)
tracks
.
AddRange
(
tracks
);
foreach
(
TrackInfo
track
in
tracks
)
{
{
var
trackItem
=
Instantiate
(
trackItemPrefab
,
trackList
.
transform
);
var
trackItem
=
Instantiate
(
trackItemPrefab
,
trackList
.
transform
);
...
@@ -95,6 +89,17 @@ public class TrackManager : MonoBehaviour {
...
@@ -95,6 +89,17 @@ public class TrackManager : MonoBehaviour {
}
}
}
}
List
<
TrackInfo
>
LoadTrackInfos
()
{
var
files
=
new
DirectoryInfo
(
"Assets/Tracks"
).
GetFiles
(
"*.bpe"
,
SearchOption
.
AllDirectories
);
var
tracks
=
files
.
Select
(
s
=>
new
TrackInfo
(
s
)).
ToList
();
while
(
tracks
.
Count
()
<
5
)
tracks
.
AddRange
(
tracks
);
return
tracks
;
}
public
void
StartTrack
()
public
void
StartTrack
()
{
{
// TODO: disable start button if nothing selected
// TODO: disable start button if nothing selected
...
...
This diff is collapsed.
Click to expand it.
ProjectSettings/ProjectSettings.asset
View file @
540ef035
...
@@ -67,7 +67,7 @@ PlayerSettings:
...
@@ -67,7 +67,7 @@ PlayerSettings:
defaultIsFullScreen
:
1
defaultIsFullScreen
:
1
defaultIsNativeResolution
:
1
defaultIsNativeResolution
:
1
macRetinaSupport
:
1
macRetinaSupport
:
1
runInBackground
:
0
runInBackground
:
1
captureSingleScreen
:
0
captureSingleScreen
:
0
muteOtherAudioSources
:
0
muteOtherAudioSources
:
0
Prepare IOS For Recording
:
0
Prepare IOS For Recording
:
0
...
...
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