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
64a65eca
Commit
64a65eca
authored
5 years ago
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
더블클릭시 무한히 진행
parent
6005c77b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
FlatlandMovement.cs
Assets/Scripts/FlatlandMovement.cs
+23
-13
UIManager.cs
Assets/Scripts/UIManager.cs
+2
-1
No files found.
Assets/Scripts/FlatlandMovement.cs
View file @
64a65eca
...
@@ -142,32 +142,42 @@ public class FlatlandMovement : MonoBehaviour
...
@@ -142,32 +142,42 @@ public class FlatlandMovement : MonoBehaviour
/// </summary>
/// </summary>
/// <param name="path">목적지 x z 가 공간</param>
/// <param name="path">목적지 x z 가 공간</param>
/// <param name="v">속력 0<v<1</param>
/// <param name="v">속력 0<v<1</param>
public
bool
MoveTo
(
Vector3
dest
,
float
v
)
public
bool
MoveTo
AbPosition
(
Vector3
dest
,
float
v
)
{
{
dest
.
y
=
0
;
bool
result
=
SetVelecityToAbPosition
(
dest
,
v
);
Debug
.
Log
(
"bb"
);
if
(!
result
)
Debug
.
Log
(
dest
);
if
(
v
<
0.0001f
)
{
{
//v가 0일때.
return
false
;
return
false
;
}
}
nowDest
=
dest
;
isAutoMove
=
true
;
return
true
;
}
/// <summary>
/// 절대좌표 방향으로 무한히 날아갑니다
/// </summary>
/// <param name="dest"></param>
/// <param name="v"></param>
/// <returns></returns>
public
bool
MoveInfinitelyToAbPosition
(
Vector3
dest
,
float
v
)
{
return
SetVelecityToAbPosition
(
dest
,
v
);
}
public
bool
SetVelecityToAbPosition
(
Vector3
dest
,
float
v
)
{
dest
.
y
=
0
;
//속도와 목적지 설정.
//속도와 목적지 설정.
Vector3
tmp
=
dest
-
transform
.
position
;
Vector3
tmp
=
dest
-
transform
.
position
;
Debug
.
Log
(
"move vector: "
+
tmp
);
tmp
.
y
=
0
;
tmp
.
y
=
0
;
this
.
v
=
tmp
.
normalized
*
v
*
(
float
)
Constants
.
c
;
this
.
v
=
tmp
.
normalized
*
v
*
(
float
)
Constants
.
c
;
Debug
.
Log
(
"v : "
+
this
.
v
);
this
.
nowDest
=
dest
;
isAutoMove
=
true
;
return
true
;
return
true
;
}
}
private
void
NextMove
()
private
void
NextMove
()
{
{
MoveTo
(
dests
[
0
],
pathVelocitys
[
0
]);
MoveTo
AbPosition
(
dests
[
0
],
pathVelocitys
[
0
]);
dests
.
RemoveAt
(
0
);
dests
.
RemoveAt
(
0
);
pathVelocitys
.
RemoveAt
(
0
);
pathVelocitys
.
RemoveAt
(
0
);
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UIManager.cs
View file @
64a65eca
...
@@ -260,7 +260,8 @@ public class UIManager : MonoBehaviour
...
@@ -260,7 +260,8 @@ public class UIManager : MonoBehaviour
ray
=
playercamera
.
ViewportPointToRay
(
hit
.
textureCoord
);
ray
=
playercamera
.
ViewportPointToRay
(
hit
.
textureCoord
);
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
{
levelManager
.
player
.
MoveTo
(
hit
.
point
,
velocityslider
.
GetLogScaleValue
());
levelManager
.
player
.
MoveInfinitelyToAbPosition
(
hit
.
point
,
velocityslider
.
GetLogScaleValue
());
//levelManager.player.MoveToAbPosition(hit.point, velocityslider.GetLogScaleValue());
//Debug.Log(velocityslider.GetLogScaleValue() * (float)Constants.c);
//Debug.Log(velocityslider.GetLogScaleValue() * (float)Constants.c);
//Debug.Log(hit.point);
//Debug.Log(hit.point);
}
}
...
...
This diff is collapsed.
Click to expand it.
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