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
46db69f0
Commit
46db69f0
authored
Aug 21, 2019
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
카메라 줌인아웃에 따른 플레이어 크기변화
parent
6424eb56
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
2 deletions
+31
-2
Test.unity
Assets/Scenes/Test.unity
+2
-1
CameraMovement.cs
Assets/Scripts/CameraMovement.cs
+11
-0
Square.cs
Assets/Scripts/Square.cs
+16
-0
UIManager.cs
Assets/Scripts/UIManager.cs
+2
-1
No files found.
Assets/Scenes/Test.unity
View file @
46db69f0
...
@@ -660,6 +660,7 @@ MonoBehaviour:
...
@@ -660,6 +660,7 @@ MonoBehaviour:
levelManager
:
{
fileID
:
279236944
}
levelManager
:
{
fileID
:
279236944
}
player
:
{
fileID
:
739347346
}
player
:
{
fileID
:
739347346
}
pathRenderer
:
{
fileID
:
948598108
}
pathRenderer
:
{
fileID
:
948598108
}
playerSquare
:
{
fileID
:
934514725
}
cameraMovement
:
{
fileID
:
1661408491
}
cameraMovement
:
{
fileID
:
1661408491
}
scrollSpeed
:
5
scrollSpeed
:
5
---
!u!4
&394305456
---
!u!4
&394305456
...
@@ -1698,7 +1699,7 @@ GameObject:
...
@@ -1698,7 +1699,7 @@ GameObject:
-
component
:
{
fileID
:
934514726
}
-
component
:
{
fileID
:
934514726
}
-
component
:
{
fileID
:
934514725
}
-
component
:
{
fileID
:
934514725
}
m_Layer
:
2
m_Layer
:
2
m_Name
:
Square
m_Name
:
Player
Square
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
...
Assets/Scripts/CameraMovement.cs
View file @
46db69f0
...
@@ -75,4 +75,15 @@ public class CameraMovement : MonoBehaviour
...
@@ -75,4 +75,15 @@ public class CameraMovement : MonoBehaviour
}
}
}
}
}
}
/// <summary>
/// size/defaultSize
/// </summary>
public
float
SizeScale
{
get
{
return
(
float
)
size
/
(
float
)
defaultSize
;
}
}
}
}
\ No newline at end of file
Assets/Scripts/Square.cs
View file @
46db69f0
...
@@ -11,6 +11,14 @@ public class Square : FlatLandObject
...
@@ -11,6 +11,14 @@ public class Square : FlatLandObject
private
float
_zPosition
=>
transform
.
position
.
z
;
private
float
_zPosition
=>
transform
.
position
.
z
;
private
float
PlayerVelocity
;
private
float
PlayerVelocity
;
private
Vector3
defaultScale
;
private
void
Start
()
{
defaultScale
=
GetComponent
<
Transform
>().
localScale
;
}
public
Vector3
GetNthPath
(
int
n
)
// Get a path from (n)th destination to (n+1)th destination.
public
Vector3
GetNthPath
(
int
n
)
// Get a path from (n)th destination to (n+1)th destination.
{
{
return
pathList
[
n
+
1
]
-
pathList
[
n
];
return
pathList
[
n
+
1
]
-
pathList
[
n
];
...
@@ -30,4 +38,12 @@ public class Square : FlatLandObject
...
@@ -30,4 +38,12 @@ public class Square : FlatLandObject
{
{
return
pathVelocity
[
n
+
1
];
return
pathVelocity
[
n
+
1
];
}
}
public
float
Scale
{
set
{
GetComponent
<
Transform
>().
localScale
=
defaultScale
*
value
;
}
}
}
}
Assets/Scripts/UIManager.cs
View file @
46db69f0
...
@@ -31,6 +31,7 @@ public class UIManager : MonoBehaviour
...
@@ -31,6 +31,7 @@ public class UIManager : MonoBehaviour
public
PlayerMovement
player
;
public
PlayerMovement
player
;
public
PathRenderer
pathRenderer
;
public
PathRenderer
pathRenderer
;
public
Square
playerSquare
;
public
CameraMovement
cameraMovement
;
public
CameraMovement
cameraMovement
;
public
float
scrollSpeed
=
1.0f
;
public
float
scrollSpeed
=
1.0f
;
...
@@ -122,7 +123,7 @@ public class UIManager : MonoBehaviour
...
@@ -122,7 +123,7 @@ public class UIManager : MonoBehaviour
float
scroll
=
Input
.
GetAxis
(
"Mouse ScrollWheel"
)
*
scrollSpeed
;
float
scroll
=
Input
.
GetAxis
(
"Mouse ScrollWheel"
)
*
scrollSpeed
;
cameraMovement
.
Size
+=
scroll
;
cameraMovement
.
Size
+=
scroll
;
playerSquare
.
Scale
=
1
/
cameraMovement
.
SizeScale
;
//player movement
//player movement
if
(
pathRenderer
.
pathcreatable
)
if
(
pathRenderer
.
pathcreatable
)
...
...
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