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
6424eb56
Commit
6424eb56
authored
Aug 21, 2019
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
카메라 줌인아웃 기능
parent
00600790
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
3 deletions
+48
-3
Test.unity
Assets/Scenes/Test.unity
+5
-0
CameraMovement.cs
Assets/Scripts/CameraMovement.cs
+30
-3
UIManager.cs
Assets/Scripts/UIManager.cs
+13
-0
No files found.
Assets/Scenes/Test.unity
View file @
6424eb56
...
...
@@ -660,6 +660,8 @@ MonoBehaviour:
levelManager
:
{
fileID
:
279236944
}
player
:
{
fileID
:
739347346
}
pathRenderer
:
{
fileID
:
948598108
}
cameraMovement
:
{
fileID
:
1661408491
}
scrollSpeed
:
5
---
!u!4
&394305456
Transform
:
m_ObjectHideFlags
:
0
...
...
@@ -3562,6 +3564,9 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
Levelmanager
:
{
fileID
:
279236944
}
minSize
:
5
defaultSize
:
10
maxSize
:
50
---
!u!114
&1661408492
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/CameraMovement.cs
View file @
6424eb56
...
...
@@ -7,6 +7,10 @@ public class CameraMovement : MonoBehaviour
public
LevelManager
Levelmanager
;
public
double
minSize
=
5.0
;
public
double
defaultSize
=
10.0
;
public
double
maxSize
=
50.0
;
Camera
thecamera
;
double
aspect
;
double
size
;
...
...
@@ -16,8 +20,8 @@ public class CameraMovement : MonoBehaviour
{
//playergamma = 1.0f;
thecamera
=
GetComponent
<
Camera
>();
aspect
=
16.0
f
/
9.0f
;
size
=
10.0f
;
aspect
=
16.0
/
9.0
;
size
=
defaultSize
;
}
// Update is called once per frame
...
...
@@ -48,4 +52,27 @@ public class CameraMovement : MonoBehaviour
transform
.
Translate
(-
Vector3
.
forward
*
50
);
// number is distance of camera from player
}
}
public
double
Size
{
get
{
return
size
;
}
set
{
if
(
value
<
minSize
)
{
size
=
minSize
;
}
else
if
(
value
>
maxSize
)
{
size
=
maxSize
;
}
else
{
size
=
value
;
}
}
}
}
\ No newline at end of file
Assets/Scripts/UIManager.cs
View file @
6424eb56
...
...
@@ -30,6 +30,10 @@ public class UIManager : MonoBehaviour
public
LevelManager
levelManager
;
public
PlayerMovement
player
;
public
PathRenderer
pathRenderer
;
public
CameraMovement
cameraMovement
;
public
float
scrollSpeed
=
1.0f
;
private
int
prevSelectPathNum
=
-
1
;
private
Text
pathName
;
...
...
@@ -64,6 +68,9 @@ public class UIManager : MonoBehaviour
{
wintext
.
gameObject
.
SetActive
(
true
);
}
//마우스 클릭시
if
(
Input
.
GetMouseButtonDown
(
0
))
{
ped
.
position
=
Input
.
mousePosition
;
...
...
@@ -110,6 +117,12 @@ public class UIManager : MonoBehaviour
sliderflag
=
0
;
}
//마우스 휠
float
scroll
=
Input
.
GetAxis
(
"Mouse ScrollWheel"
)
*
scrollSpeed
;
cameraMovement
.
Size
+=
scroll
;
//player movement
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