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
b10d43a6
Commit
b10d43a6
authored
Aug 22, 2019
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이동 기능 온오프
parent
f54dd753
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
8 deletions
+36
-8
LevelManager.cs
Assets/Scripts/LevelManager/abstract/LevelManager.cs
+16
-2
PlayerMovement.cs
Assets/Scripts/ObjectMovement/PlayerMovement.cs
+1
-1
PathRenderer.cs
Assets/Scripts/PathRenderer.cs
+1
-1
UIManager.cs
Assets/Scripts/UIManager.cs
+18
-4
No files found.
Assets/Scripts/LevelManager/abstract/LevelManager.cs
View file @
b10d43a6
...
@@ -11,14 +11,28 @@ public class LevelManager : MonoBehaviour
...
@@ -11,14 +11,28 @@ public class LevelManager : MonoBehaviour
public
PlayerMovement
player
;
public
PlayerMovement
player
;
[
SerializeField
]
[
SerializeField
]
protected
bool
winstate
=
false
;
protected
bool
winstate
=
false
;
[
SerializeField
]
protected
bool
DoubleClickMove
=
true
;
[
SerializeField
]
protected
bool
PathRanderMove
=
true
;
[
SerializeField
]
protected
bool
WASDMove
=
true
;
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
protected
virtual
void
Start
()
{
{
winstate
=
false
;
winstate
=
false
;
uiManager
.
WASDMove
=
WASDMove
;
uiManager
.
PathCreateAble
=
PathRanderMove
;
uiManager
.
DoubleCLickMove
=
DoubleClickMove
;
}
}
// Update is called once per frame
// Update is called once per frame
void
Update
()
protected
virtual
void
Update
()
{
{
if
(
WinCondition
())
if
(
WinCondition
())
{
{
...
...
Assets/Scripts/ObjectMovement/PlayerMovement.cs
View file @
b10d43a6
...
@@ -45,7 +45,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor,IGraber
...
@@ -45,7 +45,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor,IGraber
if
(
obj
)
if
(
obj
)
{
{
uiManager
.
InteractText
=
obj
.
InteractType
;
uiManager
.
InteractText
=
"G:"
+
obj
.
InteractType
;
}
}
else
else
{
{
...
...
Assets/Scripts/PathRenderer.cs
View file @
b10d43a6
...
@@ -48,7 +48,7 @@ public class PathRenderer : MonoBehaviour
...
@@ -48,7 +48,7 @@ public class PathRenderer : MonoBehaviour
_pathRenderer
=
GetComponent
<
LineRenderer
>();
_pathRenderer
=
GetComponent
<
LineRenderer
>();
_ResetPaths
();
_ResetPaths
();
pathcreatable
=
true
;
//
pathcreatable = true;
}
}
// Update is called once per frame
// Update is called once per frame
...
...
Assets/Scripts/UIManager.cs
View file @
b10d43a6
...
@@ -36,6 +36,9 @@ public class UIManager : MonoBehaviour
...
@@ -36,6 +36,9 @@ public class UIManager : MonoBehaviour
public
float
scrollSpeed
=
1.0f
;
public
float
scrollSpeed
=
1.0f
;
public
bool
WASDMove
=
true
;
public
bool
DoubleCLickMove
=
true
;
private
int
prevSelectPathNum
=
-
1
;
private
int
prevSelectPathNum
=
-
1
;
private
Text
pathName
;
private
Text
pathName
;
private
Text
pathVelocity
;
private
Text
pathVelocity
;
...
@@ -120,9 +123,11 @@ public class UIManager : MonoBehaviour
...
@@ -120,9 +123,11 @@ public class UIManager : MonoBehaviour
cameraMovement
.
Size
+=
scroll
;
cameraMovement
.
Size
+=
scroll
;
playerSquare
.
Scale
=
1
/
cameraMovement
.
SizeScale
;
playerSquare
.
Scale
=
1
/
cameraMovement
.
SizeScale
;
//player movement
//player movement
if
(
pathRenderer
.
pathcreatabl
e
)
if
(
WASDMov
e
)
{
{
if
(
Input
.
GetKeyDown
(
"w"
))
if
(
Input
.
GetKeyDown
(
"w"
))
{
{
...
@@ -188,6 +193,14 @@ public class UIManager : MonoBehaviour
...
@@ -188,6 +193,14 @@ public class UIManager : MonoBehaviour
wintext
.
GetComponent
<
Text
>().
text
=
"Lose"
;
wintext
.
GetComponent
<
Text
>().
text
=
"Lose"
;
}
}
public
bool
PathCreateAble
{
set
{
pathRenderer
.
pathcreatable
=
value
;
}
}
private
void
updatePathInfo
(
int
pathNum
)
private
void
updatePathInfo
(
int
pathNum
)
{
{
pathName
.
text
=
"Path - "
+
pathNum
;
pathName
.
text
=
"Path - "
+
pathNum
;
...
@@ -274,9 +287,10 @@ public class UIManager : MonoBehaviour
...
@@ -274,9 +287,10 @@ public class UIManager : MonoBehaviour
public
void
OnDoubleClicked
()
public
void
OnDoubleClicked
()
{
{
try
try
{
{
if
(
levelManager
.
player
.
IsInertial
&&
pathRenderer
.
pathcreatabl
e
)
if
(
levelManager
.
player
.
IsInertial
&&
DoubleCLickMov
e
)
{
{
RaycastHit
hit
;
RaycastHit
hit
;
var
ray
=
Camera
.
main
.
ScreenPointToRay
(
Input
.
mousePosition
);
var
ray
=
Camera
.
main
.
ScreenPointToRay
(
Input
.
mousePosition
);
...
...
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