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
Jan 15, 2018
by
16이상민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring class 'TrackInfo'
parent
8d2a3d7c
Changes
10
Expand all
Hide 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
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:
Assets/InitTestScene636511952132748649.unity
0 → 100644
View file @
540ef035
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:
Assets/Script/CoordinateMapperManager.cs
View file @
540ef035
...
...
@@ -2,7 +2,6 @@
using
Windows.Kinect
;
using
System.Runtime.InteropServices
;
using
System
;
using
System.Collections
;
using
System.Linq
;
using
System.Collections.Generic
;
...
...
@@ -20,6 +19,13 @@ public class CoordinateMapperManager : MonoBehaviour
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
{
get
{
return
_ColorRGBX
;
}
}
public
byte
[]
BodyIndexBuffer
...
...
Assets/Script/CoordinateMapperView.cs
View file @
540ef035
...
...
@@ -9,8 +9,10 @@ public class CoordinateMapperView : MonoBehaviour
private
DepthSpacePoint
[]
DepthPoints
;
private
byte
[]
BodyIndexPoints
;
void
Start
()
// In play mode, texture of gameobject should be same as texture which made by shader when after update.
void
Start
()
{
CoordinateMapperManager
CoordinateMapperManager
=
GameObject
.
Find
(
"Managers"
).
GetComponent
<
CoordinateMapperManager
>();
...
...
Assets/Script/Tests/CoordinateMapperViewTests.cs
View file @
540ef035
...
...
@@ -6,42 +6,44 @@ using Windows.Kinect;
using
System.Runtime.InteropServices
;
using
System
;
namespace
Assets.Script.
Tests
class
CoordinateMapperView
Tests
{
class
CoordinateMapperViewTests
// A UnityTest behaves like a coroutine in PlayMode
// and allows you to yield null to skip a frame in EditMode
[
UnityTest
]
public
IEnumerator
MainTexture_Equal_Texture_Generate_By_Shader_When_After_Update
()
{
[
Test
]
public
void
CoordinateMapperViewTestsSimplePasses
()
{
// Use the Assert class to test conditions.
}
// A UnityTest behaves like a coroutine in PlayMode
// and allows you to yield null to skip a frame in EditMode
[
UnityTest
]
public
IEnumerator
CoordinateMapperViewTestsWithEnumeratorPasses
()
{
var
CoordinateMapperManager
=
GameObject
.
Find
(
"Managers"
).
GetComponent
<
CoordinateMapperManager
>();
var
tmpObj
=
GameObject
.
CreatePrimitive
(
PrimitiveType
.
Plane
);
tmpObj
.
GetComponent
<
Renderer
>().
material
=
Resources
.
Load
(
"GreenScreen/GreenScreen.mat"
,
typeof
(
Material
))
as
Material
;
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetTexture
(
"_MainTex"
,
CoordinateMapperManager
.
ColorTexture
);
var
DepthPoints
=
CoordinateMapperManager
.
DepthCoordinates
;
var
DepthBuffer
=
new
ComputeBuffer
(
DepthPoints
.
Length
,
sizeof
(
float
)
*
2
);
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetBuffer
(
"depthCoordinates"
,
DepthBuffer
);
var
BodyIndexPoints
=
CoordinateMapperManager
.
BodyIndexBuffer
;
var
BodyIndexBuffer
=
new
ComputeBuffer
(
BodyIndexPoints
.
Length
,
sizeof
(
float
));
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetBuffer
(
"bodyIndexBuffer"
,
BodyIndexBuffer
);
var
CoordinateMapperView
=
GameObject
.
Find
(
"CoordinateMapView"
);
// Use the Assert class to test conditions.
// yield to skip a frame
yield
return
null
;
Assert
.
AreEqual
(
tmpObj
.
GetComponent
<
Renderer
>().
material
.
mainTexture
,
CoordinateMapperView
.
GetComponent
<
Renderer
>().
material
.
mainTexture
,
"CoordinateMapperViewTest Failed."
);
}
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
);
tmpObj
.
GetComponent
<
Renderer
>().
material
=
Resources
.
Load
(
"GreenScreen/GreenScreen.mat"
,
typeof
(
Material
))
as
Material
;
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetTexture
(
"_MainTex"
,
CoordinateMapperManager
.
ColorTexture
);
var
DepthPoints
=
CoordinateMapperManager
.
DepthCoordinates
;
var
DepthBuffer
=
new
ComputeBuffer
(
DepthPoints
.
Length
,
sizeof
(
float
)
*
2
);
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetBuffer
(
"depthCoordinates"
,
DepthBuffer
);
var
BodyIndexPoints
=
CoordinateMapperManager
.
BodyIndexBuffer
;
var
BodyIndexBuffer
=
new
ComputeBuffer
(
BodyIndexPoints
.
Length
,
sizeof
(
float
));
tmpObj
.
GetComponent
<
Renderer
>().
material
.
SetBuffer
(
"bodyIndexBuffer"
,
BodyIndexBuffer
);
var
CoordinateMapperView
=
GameObject
.
Find
(
"CoordinateMapView"
);
// Use the Assert class to test conditions.
// yield to skip a frame
yield
return
null
;
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."
);
}
}
Assets/Script/TrackInfo.cs
View file @
540ef035
This diff is collapsed.
Click to expand it.
Assets/Script/TrackManager.cs
View file @
540ef035
...
...
@@ -81,13 +81,7 @@ public class TrackManager : MonoBehaviour {
void
LoadTracks
()
{
var
files
=
new
DirectoryInfo
(
"Assets/Tracks"
).
GetFiles
(
"*.bpe"
,
SearchOption
.
AllDirectories
);
List
<
TrackInfo
>
tracks
=
files
.
Select
(
s
=>
new
TrackInfo
(
s
)).
ToList
();
while
(
tracks
.
Count
()
<
5
)
tracks
.
AddRange
(
tracks
);
foreach
(
TrackInfo
track
in
tracks
)
foreach
(
TrackInfo
track
in
LoadTrackInfos
())
{
var
trackItem
=
Instantiate
(
trackItemPrefab
,
trackList
.
transform
);
...
...
@@ -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
()
{
// TODO: disable start button if nothing selected
...
...
ProjectSettings/ProjectSettings.asset
View file @
540ef035
...
...
@@ -67,7 +67,7 @@ PlayerSettings:
defaultIsFullScreen
:
1
defaultIsNativeResolution
:
1
macRetinaSupport
:
1
runInBackground
:
0
runInBackground
:
1
captureSingleScreen
:
0
muteOtherAudioSources
:
0
Prepare IOS For Recording
:
0
...
...
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