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
b4184cd7
Commit
b4184cd7
authored
Aug 02, 2019
by
Chae Ho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working demo of model(proto level)
parent
d689c27e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
436 additions
and
37 deletions
+436
-37
Test.unity
Assets/Scenes/Test.unity
+273
-22
CameraMovement.cs
Assets/Scripts/CameraMovement.cs
+1
-1
ExtrudedMesh.cs
Assets/Scripts/ExtrudedMesh.cs
+9
-1
LevelManager.cs
Assets/Scripts/LevelManager.cs
+2
-1
Planemovement.cs
Assets/Scripts/Planemovement.cs
+69
-8
PlayerMovement.cs
Assets/Scripts/PlayerMovement.cs
+34
-3
RuntimeCSGFlatlandObject.cs
Assets/Scripts/RuntimeCSGFlatlandObject.cs
+1
-1
ScreenMovement.cs
Assets/Scripts/ScreenMovement.cs
+22
-0
ScreenMovement.cs.meta
Assets/Scripts/ScreenMovement.cs.meta
+11
-0
UIManager.cs
Assets/Scripts/UIManager.cs
+14
-0
No files found.
Assets/Scenes/Test.unity
View file @
b4184cd7
...
...
@@ -291,6 +291,9 @@ RectTransform:
-
{
fileID
:
589301197
}
-
{
fileID
:
714652445
}
-
{
fileID
:
699256181
}
-
{
fileID
:
1366244996
}
-
{
fileID
:
1112383569
}
-
{
fileID
:
757328238
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
7
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -465,6 +468,7 @@ MonoBehaviour:
m_EditorClassIdentifier
:
gamma
:
0
player
:
{
fileID
:
739347346
}
winstate
:
0
---
!u!1
&290750634
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -715,7 +719,14 @@ MonoBehaviour:
m_EditorClassIdentifier
:
square
:
{
fileID
:
934514725
}
canvas
:
{
fileID
:
219938171
}
mytime
:
{
fileID
:
1936867591
}
clock1
:
{
fileID
:
1094934749
}
clock2
:
{
fileID
:
535323108
}
clock1time
:
{
fileID
:
1366244998
}
clock2time
:
{
fileID
:
1112383571
}
wintext
:
{
fileID
:
757328240
}
_pathUI
:
{
fileID
:
699256180
}
Levelmanager
:
{
fileID
:
279236944
}
---
!u!4
&394305456
Transform
:
m_ObjectHideFlags
:
0
...
...
@@ -845,7 +856,7 @@ MeshCollider:
m_IsTrigger
:
0
m_Enabled
:
1
serializedVersion
:
3
m_Convex
:
0
m_Convex
:
1
m_CookingOptions
:
14
m_Mesh
:
{
fileID
:
10209
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!23
&439858920
...
...
@@ -1028,7 +1039,7 @@ GameObject:
-
component
:
{
fileID
:
535323109
}
-
component
:
{
fileID
:
535323108
}
m_Layer
:
0
m_Name
:
AnObject
(1)
m_Name
:
AnObject
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
@@ -1047,8 +1058,9 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
playergamma
:
1
starttime
:
10
theobject
:
{
fileID
:
439858915
}
otherclock
:
{
fileID
:
1094934749
}
---
!u!4
&535323109
Transform
:
m_ObjectHideFlags
:
0
...
...
@@ -1560,6 +1572,8 @@ MonoBehaviour:
v
:
{
x
:
0
,
y
:
0
,
z
:
0
}
gamma
:
1
theobject
:
{
fileID
:
1320474661
}
orientation
:
{
x
:
0
,
y
:
0
,
z
:
0
}
time
:
0
---
!u!4
&739347347
Transform
:
m_ObjectHideFlags
:
0
...
...
@@ -1575,6 +1589,85 @@ Transform:
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
5
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&757328237
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
757328238
}
-
component
:
{
fileID
:
757328239
}
-
component
:
{
fileID
:
757328240
}
m_Layer
:
5
m_Name
:
Text
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
0
---
!u!224
&757328238
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
757328237
}
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
:
219938175
}
m_RootOrder
:
9
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
:
-10
}
m_SizeDelta
:
{
x
:
800
,
y
:
450
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&757328239
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
757328237
}
m_CullTransparentMesh
:
0
---
!u!114
&757328240
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
757328237
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
708705254
,
guid
:
f70555f144d8491a825f0804e09c671c
,
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_FontData
:
m_Font
:
{
fileID
:
10102
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_FontSize
:
64
m_FontStyle
:
0
m_BestFit
:
0
m_MinSize
:
6
m_MaxSize
:
64
m_Alignment
:
4
m_AlignByGeometry
:
0
m_RichText
:
1
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
YOU WIN!
---
!u!1
&804812004
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -1737,7 +1830,7 @@ MeshCollider:
m_IsTrigger
:
0
m_Enabled
:
1
serializedVersion
:
3
m_Convex
:
0
m_Convex
:
1
m_CookingOptions
:
14
m_Mesh
:
{
fileID
:
10209
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!23
&839664890
...
...
@@ -2454,8 +2547,9 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
playergamma
:
1
starttime
:
0
theobject
:
{
fileID
:
839664886
}
otherclock
:
{
fileID
:
535323108
}
---
!u!4
&1094934750
Transform
:
m_ObjectHideFlags
:
0
...
...
@@ -2638,6 +2732,85 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1105400276
}
m_CullTransparentMesh
:
0
---
!u!1
&1112383568
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1112383569
}
-
component
:
{
fileID
:
1112383570
}
-
component
:
{
fileID
:
1112383571
}
m_Layer
:
5
m_Name
:
Clock2
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&1112383569
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1112383568
}
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
:
219938175
}
m_RootOrder
:
8
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
:
18
,
y
:
205
}
m_SizeDelta
:
{
x
:
160
,
y
:
30
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&1112383570
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1112383568
}
m_CullTransparentMesh
:
0
---
!u!114
&1112383571
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1112383568
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
708705254
,
guid
:
f70555f144d8491a825f0804e09c671c
,
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_FontData
:
m_Font
:
{
fileID
:
10102
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_FontSize
:
14
m_FontStyle
:
0
m_BestFit
:
0
m_MinSize
:
10
m_MaxSize
:
40
m_Alignment
:
0
m_AlignByGeometry
:
0
m_RichText
:
1
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
New Text
---
!u!1
&1202787301
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -2858,6 +3031,85 @@ Transform:
m_Father
:
{
fileID
:
739347347
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&1366244995
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1366244996
}
-
component
:
{
fileID
:
1366244997
}
-
component
:
{
fileID
:
1366244998
}
m_Layer
:
5
m_Name
:
Clock1
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&1366244996
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1366244995
}
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
:
219938175
}
m_RootOrder
:
7
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
:
-145.3
,
y
:
206
}
m_SizeDelta
:
{
x
:
160
,
y
:
30
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&1366244997
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1366244995
}
m_CullTransparentMesh
:
0
---
!u!114
&1366244998
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1366244995
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
708705254
,
guid
:
f70555f144d8491a825f0804e09c671c
,
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_FontData
:
m_Font
:
{
fileID
:
10102
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_FontSize
:
14
m_FontStyle
:
0
m_BestFit
:
0
m_MinSize
:
10
m_MaxSize
:
40
m_Alignment
:
0
m_AlignByGeometry
:
0
m_RichText
:
1
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
New Text
---
!u!1
&1611090155
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -2949,7 +3201,7 @@ Camera:
far clip plane
:
1000
field of view
:
73.479935
orthographic
:
1
orthographic size
:
5
orthographic size
:
10
m_Depth
:
0
m_CullingMask
:
serializedVersion
:
2
...
...
@@ -3094,6 +3346,7 @@ GameObject:
-
component
:
{
fileID
:
1751424969
}
-
component
:
{
fileID
:
1751424971
}
-
component
:
{
fileID
:
1751424970
}
-
component
:
{
fileID
:
1751424972
}
m_Layer
:
5
m_Name
:
RawImage
m_TagString
:
Untagged
...
...
@@ -3118,7 +3371,7 @@ RectTransform:
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
:
1600
,
y
:
90
0
}
m_SizeDelta
:
{
x
:
3840
,
y
:
216
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1751424970
MonoBehaviour
:
...
...
@@ -3155,6 +3408,19 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1751424968
}
m_CullTransparentMesh
:
0
---
!u!114
&1751424972
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1751424968
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
4e0af0ca58f3ba4479655495ab6e9bef
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
---
!u!1
&1756789504
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -3168,7 +3434,6 @@ GameObject:
-
component
:
{
fileID
:
1756789507
}
-
component
:
{
fileID
:
1756789506
}
-
component
:
{
fileID
:
1756789509
}
-
component
:
{
fileID
:
1756789510
}
-
component
:
{
fileID
:
1756789511
}
m_Layer
:
0
m_Name
:
Cone
...
...
@@ -3266,20 +3531,6 @@ Rigidbody:
m_Interpolate
:
0
m_Constraints
:
0
m_CollisionDetection
:
0
---
!u!114
&1756789510
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1756789504
}
m_Enabled
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
d99664edeab700d4ca972d282f99515b
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
time
:
0.1
leaveworldline
:
0
---
!u!114
&1756789511
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/CameraMovement.cs
View file @
b4184cd7
...
...
@@ -37,7 +37,7 @@ public class CameraMovement : MonoBehaviour
transform
.
rotation
=
Quaternion
.
LookRotation
(-
vt
,
newforward
);
thecamera
.
orthographicSize
=
5
.0f
*
((
float
)
Levelmanager
.
player
.
gamma
);
thecamera
.
orthographicSize
=
10
.0f
*
((
float
)
Levelmanager
.
player
.
gamma
);
aspect
=
16.0f
/
(
9.0f
*
(
Levelmanager
.
player
.
gamma
));
...
...
Assets/Scripts/ExtrudedMesh.cs
View file @
b4184cd7
...
...
@@ -75,7 +75,7 @@ public class ExtrudedMesh : MonoBehaviour
DestroyImmediate
(
clone
.
transform
.
GetChild
(
1
).
gameObject
);
}
DestroyImmediate
(
clone
.
GetComponentInChildren
<
ExtrudedMesh
>());
clone
.
GetComponentInChildren
<
MeshCollider
>().
convex
=
tru
e
;
clone
.
GetComponentInChildren
<
MeshCollider
>().
convex
=
fals
e
;
clone
.
GetComponentInChildren
<
MeshCollider
>().
sharedMesh
=
clone
.
GetComponentInChildren
<
MeshFilter
>().
mesh
;
clone
.
transform
.
GetChild
(
0
).
gameObject
.
AddComponent
<
RuntimeCSGFlatlandObject
>();
clone
.
layer
=
8
;
...
...
@@ -167,4 +167,12 @@ public class ExtrudedMesh : MonoBehaviour
}
public
void
OnCollisionStay
(
Collision
collision
)
{
if
(
transform
.
parent
.
GetComponent
(
typeof
(
Planemovement
))
==
null
)
return
;
else
transform
.
parent
.
GetComponent
<
Planemovement
>().
OnCollisionStaychild
(
collision
);
}
}
Assets/Scripts/LevelManager.cs
View file @
b4184cd7
...
...
@@ -7,10 +7,11 @@ public class LevelManager : MonoBehaviour
public
double
gamma
;
public
PlayerMovement
player
;
public
bool
winstate
=
false
;
// Start is called before the first frame update
void
Start
()
{
winstate
=
false
;
}
// Update is called once per frame
...
...
Assets/Scripts/Planemovement.cs
View file @
b4184cd7
...
...
@@ -4,17 +4,23 @@ using UnityEngine;
public
class
Planemovement
:
MonoBehaviour
{
//bool toggle = true;
bool
toggle
=
false
;
bool
grabbed
=
false
;
int
cnt
=
0
;
double
beta
=
0.5f
;
// v/c
Vector3
alpha
=
new
Vector3
(
0.1f
,
0.0f
,
0.0f
);
// proper acceleration
Vector3
v
;
public
LevelManager
Levelmanager
;
public
double
playergamma
;
public
double
starttime
=
0.0f
;
Vector3
orientation
;
double
time
=
0.0f
;
// Start is called before the first frame update
public
GameObject
theobject
;
public
Planemovement
otherclock
;
void
Start
()
{
...
...
@@ -22,7 +28,9 @@ public class Planemovement : MonoBehaviour
//Color materialColor = r.material.color;
//r.material.color = Color.clear;
v
=
new
Vector3
(
0.0f
,
0.0f
,
0.0f
);
playergamma
=
1.0f
;
//playergamma = 1.0f;
orientation
=
new
Vector3
(
0.0f
,
0.0f
,
1.0f
);
time
=
starttime
;
}
// Update is called once per frame
...
...
@@ -32,22 +40,50 @@ public class Planemovement : MonoBehaviour
{
var
prevup
=
transform
.
up
;
var
prevfor
=
transform
.
forward
;
var
prevorient
=
orientation
;
transform
.
Translate
(
Vector3
.
up
*
Time
.
fixedDeltaTime
*
(
float
)
Levelmanager
.
player
.
gamma
,
Space
.
World
);
// move up by 1 second
//cnt++;
//if (cnt % 480 == 0)
//{
// cnt = 0;
//}
cnt
++;
if
(
cnt
%
480
==
0
)
{
cnt
=
0
;
}
//transform.Translate(Vector3.forward * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.forward * Mathf.Cos(2*Mathf.PI*cnt/480) * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480) * Time.fixedDeltaTime, Space.World);
//orientation = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
//v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
//v = alpha.normalized * (alpha.magnitude * Time.time / Mathf.Sqrt(1.0f+(alpha.magnitude * Time.time)*(alpha.magnitude * Time.time)));
//v = new Vector3(0, 0, 0);
if
((
Levelmanager
.
player
.
transform
.
position
-
transform
.
position
).
magnitude
<
0.5f
)
{
toggle
=
true
;
}
else
{
toggle
=
false
;
}
if
(
toggle
&&
Input
.
GetKeyDown
(
"g"
))
{
grabbed
=
!
grabbed
;
}
if
(
grabbed
)
{
v
=
Levelmanager
.
player
.
v
;
Debug
.
Log
(
"being grabbed"
);
}
else
{
v
=
new
Vector3
(
0
,
0
,
0
);
}
beta
=
v
.
magnitude
/
1.0f
;
double
gamma
=
1.0f
/
Mathf
.
Sqrt
(
1.0f
-
(
float
)(
beta
*
beta
));
...
...
@@ -67,6 +103,7 @@ public class Planemovement : MonoBehaviour
theobject
.
transform
.
up
=
vt
;
theobject
.
transform
.
parent
=
null
;
theobject
.
transform
.
RotateAround
(
theobject
.
transform
.
position
,
vt
,
Vector3
.
Angle
(
prevorient
,
orientation
));
Vector3
newforward
=
new
Vector3
(
vt
.
y
*
(
v
.
x
/
v
.
magnitude
),
Mathf
.
Sqrt
(
vt
.
x
*
vt
.
x
+
vt
.
z
*
vt
.
z
),
vt
.
y
*
(
v
.
z
/
v
.
magnitude
));
...
...
@@ -76,5 +113,29 @@ public class Planemovement : MonoBehaviour
transform
.
localScale
=
new
Vector3
(
1.0f
,
1.0f
,
(
float
)
gamma
);
// scale x' axis
time
+=
Time
.
fixedDeltaTime
*
(
float
)
Levelmanager
.
player
.
gamma
/
(
float
)
gamma
;
}
public
void
OnCollisionStaychild
(
Collision
collision
)
{
//Debug.Log("hit!");
//if(collision.transform.parent.name != "AnObject(Clone)")
// Debug.Log(collision.gameObject.name + " wow!");
if
(
collision
.
transform
.
parent
!=
null
)
{
if
(
collision
.
transform
.
parent
.
gameObject
.
Equals
(
otherclock
))
{
Debug
.
Log
(
"hit!"
);
if
(
Mathf
.
Abs
((
float
)(
otherclock
.
GetTime
()
-
time
))
<
1.0f
)
{
Levelmanager
.
winstate
=
true
;
}
}
}
}
public
double
GetTime
()
{
return
time
;
}
}
Assets/Scripts/PlayerMovement.cs
View file @
b4184cd7
...
...
@@ -10,6 +10,9 @@ public class PlayerMovement : MonoBehaviour
public
Vector3
v
=
new
Vector3
(
0.0f
,
0.0f
,
0.0f
);
public
double
gamma
=
1.0f
;
public
GameObject
theobject
;
public
Vector3
orientation
=
new
Vector3
(
0.0f
,
0.0f
,
0.0f
);
public
double
time
=
0.0f
;
int
cnt
=
0
;
// Start is called before the first frame update
void
Start
()
...
...
@@ -17,6 +20,8 @@ public class PlayerMovement : MonoBehaviour
v
=
new
Vector3
(
0.0f
,
0.0f
,
0.0f
);
gamma
=
1.0f
;
cnt
=
0
;
orientation
=
new
Vector3
(
0.0f
,
0.0f
,
1.0f
);
time
=
0.0f
;
}
// Update is called once per frame
...
...
@@ -24,6 +29,7 @@ public class PlayerMovement : MonoBehaviour
{
var
prevup
=
transform
.
up
;
var
prevfor
=
transform
.
forward
;
var
prevorient
=
orientation
;
transform
.
Translate
(
Vector3
.
up
*
Time
.
fixedDeltaTime
*
(
float
)
gamma
,
Space
.
World
);
// move up by 1 second
cnt
++;
if
(
cnt
%
480
==
0
)
...
...
@@ -33,9 +39,26 @@ public class PlayerMovement : MonoBehaviour
//transform.Translate(Vector3.forward * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.forward * Mathf.Cos(2*Mathf.PI*cnt/480) * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480) * Time.fixedDeltaTime, Space.World);
//orientation = Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
//v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
v
=
alpha
.
normalized
*
(
alpha
.
magnitude
*
Time
.
time
/
Mathf
.
Sqrt
(
1.0f
+
(
alpha
.
magnitude
*
Time
.
time
)
*
(
alpha
.
magnitude
*
Time
.
time
)));
//v = alpha.normalized * (alpha.magnitude * Time.time / Mathf.Sqrt(1.0f + (alpha.magnitude * Time.time) * (alpha.magnitude * Time.time)));
v
=
new
Vector3
(
0
,
0
,
0
);
if
(
Input
.
GetKey
(
"w"
))
{
v
+=
Vector3
.
forward
*
0.8f
;
}
else
if
(
Input
.
GetKey
(
"a"
))
{
v
+=
Vector3
.
left
*
0.8f
;
}
else
if
(
Input
.
GetKey
(
"s"
))
{
v
-=
Vector3
.
forward
*
0.8f
;
}
else
if
(
Input
.
GetKey
(
"d"
))
{
v
+=
Vector3
.
right
*
0.8f
;
}
beta
=
v
.
magnitude
/
1.0f
;
...
...
@@ -53,9 +76,14 @@ public class PlayerMovement : MonoBehaviour
transform
.
localScale
=
new
Vector3
(
1.0f
,
1.0f
,
1.0f
);
// release child to change x'-axis scale
theobject
.
transform
.
up
=
vt
;
//theobject.transform.up = vt;
var
neworientation
=
(
Quaternion
.
FromToRotation
(
Vector3
.
up
,
vt
))
*
orientation
;
theobject
.
transform
.
rotation
=
Quaternion
.
LookRotation
(
neworientation
,
vt
);
theobject
.
transform
.
parent
=
null
;
//theobject.transform.RotateAround(theobject.transform.position, vt, Vector3.Angle(prevorient, orientation));
Vector3
newforward
=
new
Vector3
(
vt
.
y
*
(
v
.
x
/
v
.
magnitude
),
Mathf
.
Sqrt
(
vt
.
x
*
vt
.
x
+
vt
.
z
*
vt
.
z
),
vt
.
y
*
(
v
.
z
/
v
.
magnitude
));
...
...
@@ -64,5 +92,8 @@ public class PlayerMovement : MonoBehaviour
theobject
.
transform
.
parent
=
transform
;
transform
.
localScale
=
new
Vector3
(
1.0f
,
1.0f
,
(
float
)
gamma
);
// scale x'-axis scale (distance dilation)
time
+=
Time
.
fixedDeltaTime
;
}
}
Assets/Scripts/RuntimeCSGFlatlandObject.cs
View file @
b4184cd7
...
...
@@ -11,7 +11,7 @@ public class RuntimeCSGFlatlandObject : MonoBehaviour
int
cnt
=
0
;
public
CSG
csg
;
//
public CSG csg;
// Start is called before the first frame update
void
Start
()
{
...
...
Assets/Scripts/ScreenMovement.cs
0 → 100644
View file @
b4184cd7
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
ScreenMovement
:
MonoBehaviour
{
public
LevelManager
Levelmanager
;
// Start is called before the first frame update
void
Start
()
{
}
// Update is called once per frame
void
FixedUpdate
()
{
var
v
=
Levelmanager
.
player
.
v
;
transform
.
rotation
=
Quaternion
.
AngleAxis
(
Vector3
.
SignedAngle
(
v
,
Vector3
.
forward
,
Vector3
.
up
),
Vector3
.
forward
);
}
}
Assets/Scripts/ScreenMovement.cs.meta
0 → 100644
View file @
b4184cd7
fileFormatVersion: 2
guid: 4e0af0ca58f3ba4479655495ab6e9bef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/UIManager.cs
View file @
b4184cd7
...
...
@@ -11,7 +11,14 @@ public class UIManager : MonoBehaviour
Square
square
;
public
GameObject
canvas
;
public
Text
mytime
;
public
Planemovement
clock1
;
public
Planemovement
clock2
;
public
Text
clock1time
;
public
Text
clock2time
;
public
Text
wintext
;
public
GameObject
_pathUI
;
public
LevelManager
Levelmanager
;
private
int
prevSelectPathNum
=
-
1
;
// Start is called before the first frame update
...
...
@@ -23,6 +30,13 @@ public class UIManager : MonoBehaviour
// Update is called once per frame
void
Update
()
{
mytime
.
text
=
Levelmanager
.
player
.
time
.
ToString
()
+
" s"
;
clock1time
.
text
=
clock1
.
GetTime
().
ToString
()
+
" s"
;
clock2time
.
text
=
clock2
.
GetTime
().
ToString
()
+
" s"
;
if
(
Levelmanager
.
winstate
)
{
wintext
.
enabled
=
true
;
}
if
(
Input
.
GetMouseButtonDown
(
0
))
{
RaycastHit
hit
;
...
...
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