Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
curvedflats
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
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
Flatland
curvedflats
Commits
2e620bee
Commit
2e620bee
authored
Aug 02, 2019
by
Chae Ho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working proto level
parent
b4184cd7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
Test.unity
Assets/Scenes/Test.unity
+6
-4
Planemovement.cs
Assets/Scripts/Planemovement.cs
+9
-5
PlayerMovement.cs
Assets/Scripts/PlayerMovement.cs
+1
-1
UIManager.cs
Assets/Scripts/UIManager.cs
+1
-1
No files found.
Assets/Scenes/Test.unity
View file @
2e620bee
...
@@ -793,7 +793,7 @@ GameObject:
...
@@ -793,7 +793,7 @@ GameObject:
-
component
:
{
fileID
:
439858917
}
-
component
:
{
fileID
:
439858917
}
-
component
:
{
fileID
:
439858916
}
-
component
:
{
fileID
:
439858916
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
Plane
m_Name
:
Plane
1
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
@@ -1059,6 +1059,7 @@ MonoBehaviour:
...
@@ -1059,6 +1059,7 @@ MonoBehaviour:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
Levelmanager
:
{
fileID
:
279236944
}
starttime
:
10
starttime
:
10
gamma
:
1
theobject
:
{
fileID
:
439858915
}
theobject
:
{
fileID
:
439858915
}
otherclock
:
{
fileID
:
1094934749
}
otherclock
:
{
fileID
:
1094934749
}
---
!u!4
&535323109
---
!u!4
&535323109
...
@@ -1783,7 +1784,7 @@ GameObject:
...
@@ -1783,7 +1784,7 @@ GameObject:
-
component
:
{
fileID
:
839664888
}
-
component
:
{
fileID
:
839664888
}
-
component
:
{
fileID
:
839664893
}
-
component
:
{
fileID
:
839664893
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
Plane
m_Name
:
Plane
2
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
@@ -2548,6 +2549,7 @@ MonoBehaviour:
...
@@ -2548,6 +2549,7 @@ MonoBehaviour:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
Levelmanager
:
{
fileID
:
279236944
}
starttime
:
0
starttime
:
0
gamma
:
1
theobject
:
{
fileID
:
839664886
}
theobject
:
{
fileID
:
839664886
}
otherclock
:
{
fileID
:
535323108
}
otherclock
:
{
fileID
:
535323108
}
---
!u!4
&1094934750
---
!u!4
&1094934750
...
@@ -2906,7 +2908,7 @@ GameObject:
...
@@ -2906,7 +2908,7 @@ GameObject:
-
component
:
{
fileID
:
1320474663
}
-
component
:
{
fileID
:
1320474663
}
-
component
:
{
fileID
:
1320474662
}
-
component
:
{
fileID
:
1320474662
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
Plane
m_Name
:
Pla
yerpla
ne
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
@@ -3465,7 +3467,7 @@ MeshCollider:
...
@@ -3465,7 +3467,7 @@ MeshCollider:
m_GameObject
:
{
fileID
:
1756789504
}
m_GameObject
:
{
fileID
:
1756789504
}
m_Material
:
{
fileID
:
0
}
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_IsTrigger
:
0
m_Enabled
:
1
m_Enabled
:
0
serializedVersion
:
3
serializedVersion
:
3
m_Convex
:
0
m_Convex
:
0
m_CookingOptions
:
14
m_CookingOptions
:
14
...
...
Assets/Scripts/Planemovement.cs
View file @
2e620bee
...
@@ -12,6 +12,7 @@ public class Planemovement : MonoBehaviour
...
@@ -12,6 +12,7 @@ public class Planemovement : MonoBehaviour
Vector3
v
;
Vector3
v
;
public
LevelManager
Levelmanager
;
public
LevelManager
Levelmanager
;
public
double
starttime
=
0.0f
;
public
double
starttime
=
0.0f
;
public
double
gamma
=
1.0f
;
Vector3
orientation
;
Vector3
orientation
;
double
time
=
0.0f
;
double
time
=
0.0f
;
...
@@ -31,6 +32,7 @@ public class Planemovement : MonoBehaviour
...
@@ -31,6 +32,7 @@ public class Planemovement : MonoBehaviour
//playergamma = 1.0f;
//playergamma = 1.0f;
orientation
=
new
Vector3
(
0.0f
,
0.0f
,
1.0f
);
orientation
=
new
Vector3
(
0.0f
,
0.0f
,
1.0f
);
time
=
starttime
;
time
=
starttime
;
gamma
=
1.0f
;
}
}
// Update is called once per frame
// Update is called once per frame
...
@@ -86,9 +88,9 @@ public class Planemovement : MonoBehaviour
...
@@ -86,9 +88,9 @@ public class Planemovement : MonoBehaviour
beta
=
v
.
magnitude
/
1.0f
;
beta
=
v
.
magnitude
/
1.0f
;
double
gamma
=
1.0f
/
Mathf
.
Sqrt
(
1.0f
-
(
float
)(
beta
*
beta
));
gamma
=
1.0f
/
Mathf
.
Sqrt
(
1.0f
-
(
float
)(
beta
*
beta
));
transform
.
Translate
(
v
*
Time
.
fixedDeltaTime
,
Space
.
World
);
transform
.
Translate
(
v
*
Time
.
fixedDeltaTime
*
(
float
)
Levelmanager
.
player
.
gamma
,
Space
.
World
);
var
vt
=
v
+
Vector3
.
up
;
var
vt
=
v
+
Vector3
.
up
;
...
@@ -113,7 +115,7 @@ public class Planemovement : MonoBehaviour
...
@@ -113,7 +115,7 @@ public class Planemovement : MonoBehaviour
transform
.
localScale
=
new
Vector3
(
1.0f
,
1.0f
,
(
float
)
gamma
);
// scale x' axis
transform
.
localScale
=
new
Vector3
(
1.0f
,
1.0f
,
(
float
)
gamma
);
// scale x' axis
time
+=
Time
.
fixedDeltaTime
*
(
float
)
Levelmanager
.
player
.
gamma
/
(
float
)
gamma
;
time
+=
Time
.
fixedDeltaTime
*
(
float
)
(
Levelmanager
.
player
.
gamma
/
gamma
)
;
}
}
public
void
OnCollisionStaychild
(
Collision
collision
)
public
void
OnCollisionStaychild
(
Collision
collision
)
...
@@ -123,15 +125,17 @@ public class Planemovement : MonoBehaviour
...
@@ -123,15 +125,17 @@ public class Planemovement : MonoBehaviour
// Debug.Log(collision.gameObject.name + " wow!");
// Debug.Log(collision.gameObject.name + " wow!");
if
(
collision
.
transform
.
parent
!=
null
)
if
(
collision
.
transform
.
parent
!=
null
)
{
{
if
(
collision
.
transform
.
parent
.
gameObject
.
Equals
(
otherclock
))
var
x
=
collision
.
transform
.
parent
.
gameObject
.
GetComponent
(
typeof
(
Planemovement
))
as
Planemovement
;
if
(
x
!=
null
&&
x
.
Equals
(
otherclock
))
{
{
Debug
.
Log
(
"hit!"
);
Debug
.
Log
(
"hit!"
);
if
(
Mathf
.
Abs
((
float
)(
otherclock
.
GetTime
()
-
time
))
<
1.0f
)
if
(
Mathf
.
Abs
((
float
)(
otherclock
.
GetTime
()
-
time
))
<
=
1.0f
)
{
{
Levelmanager
.
winstate
=
true
;
Levelmanager
.
winstate
=
true
;
}
}
}
}
}
}
}
}
public
double
GetTime
()
public
double
GetTime
()
...
...
Assets/Scripts/PlayerMovement.cs
View file @
2e620bee
...
@@ -64,7 +64,7 @@ public class PlayerMovement : MonoBehaviour
...
@@ -64,7 +64,7 @@ public class PlayerMovement : MonoBehaviour
gamma
=
1.0f
/
Mathf
.
Sqrt
(
1.0f
-
(
float
)(
beta
*
beta
));
gamma
=
1.0f
/
Mathf
.
Sqrt
(
1.0f
-
(
float
)(
beta
*
beta
));
transform
.
Translate
(
v
*
Time
.
fixedDeltaTime
,
Space
.
World
);
transform
.
Translate
(
v
*
Time
.
fixedDeltaTime
*
(
float
)
gamma
,
Space
.
World
);
var
vt
=
v
+
Vector3
.
up
;
var
vt
=
v
+
Vector3
.
up
;
...
...
Assets/Scripts/UIManager.cs
View file @
2e620bee
...
@@ -35,7 +35,7 @@ public class UIManager : MonoBehaviour
...
@@ -35,7 +35,7 @@ public class UIManager : MonoBehaviour
clock2time
.
text
=
clock2
.
GetTime
().
ToString
()
+
" s"
;
clock2time
.
text
=
clock2
.
GetTime
().
ToString
()
+
" s"
;
if
(
Levelmanager
.
winstate
)
if
(
Levelmanager
.
winstate
)
{
{
wintext
.
enabled
=
true
;
wintext
.
gameObject
.
SetActive
(
true
)
;
}
}
if
(
Input
.
GetMouseButtonDown
(
0
))
if
(
Input
.
GetMouseButtonDown
(
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