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
748a100c
Commit
748a100c
authored
Aug 19, 2019
by
17김현학
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
6d9196b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
7 deletions
+40
-7
PathRenderer.cs
Assets/Scripts/PathRenderer.cs
+38
-3
UIManager.cs
Assets/Scripts/UIManager.cs
+2
-4
No files found.
Assets/Scripts/PathRenderer.cs
View file @
748a100c
...
...
@@ -207,6 +207,9 @@ public class PathRenderer : MonoBehaviour
//square.PathList에서 0에서 시작해 finalPathNum까지 이동
var
startPosition
=
levelManager
.
player
.
transform
.
position
;
Debug
.
Log
(
startPosition
+
"test"
);
while
(
i
<=
finalPathNum
)
{
Vector3
startpos
=
new
Vector3
(
levelManager
.
player
.
transform
.
position
.
x
,
0
,
levelManager
.
player
.
transform
.
position
.
z
);
// 경로 이동 시작할때 위치
...
...
@@ -264,10 +267,13 @@ public class PathRenderer : MonoBehaviour
// INSERT CODE TO REMOVE PATH FROM PATH RENDERER HERE
// 여기에 방금 이동한 경로를 안보이게 해야 함
HideNthPath
(
i
);
i
++;
}
Debug
.
Log
(
levelManager
.
player
.
transform
.
position
+
"test"
);
shiftPath
(
finalPathNum
+
1
,
levelManager
.
player
.
transform
.
position
-
startPosition
);
Background
.
Toggle
=
true
;
//아마 여기에 이동을 다 마친 경로들을 square.pathList랑 square.pathVelocity에서 없애주고, finalPathNum 다음 경로가 square.pathList[1]이 되게 해야할듯
...
...
@@ -280,10 +286,39 @@ public class PathRenderer : MonoBehaviour
{
square
.
pathList
.
RemoveRange
(
n
,
_pathRenderer
.
positionCount
-
n
);
square
.
pathVelocity
.
RemoveRange
(
n
,
_pathRenderer
.
positionCount
-
n
);
for
(
int
i
=
0
;
i
<
transform
.
childCount
;
i
++)
for
(
int
i
=
n
-
1
;
i
<
transform
.
childCount
;
i
++)
{
Destroy
(
transform
.
GetChild
(
i
).
gameObject
);
}
_pathRenderer
.
positionCount
=
square
.
pathList
.
Count
();
}
public
void
HideNthPath
(
int
n
)
{
transform
.
GetChild
(
n
).
gameObject
.
GetComponent
<
MeshRenderer
>().
enabled
=
false
;
}
public
void
shiftPath
(
int
times
,
Vector3
deltaPosition
)
{
square
.
pathList
.
RemoveRange
(
1
,
times
);
square
.
pathVelocity
.
RemoveRange
(
1
,
times
);
deltaPosition
=
ui
.
getXYVectorfromXZVector
(
deltaPosition
);
Debug
.
Log
(
deltaPosition
+
"test"
);
int
i
;
for
(
i
=
0
;
i
<
times
;
i
++)
{
if
(
i
+
1
>=
n
)
Destroy
(
transform
.
GetChild
(
i
).
gameObject
);
Destroy
(
transform
.
GetChild
(
i
).
gameObject
);
}
for
(
i
=
0
;
i
<
transform
.
childCount
-
times
;
i
++)
{
GameObject
obj
=
transform
.
GetChild
(
i
+
times
).
gameObject
;
obj
.
name
=
"PathCollider-"
+
i
;
obj
.
transform
.
localPosition
-=
deltaPosition
;
square
.
pathList
[
i
+
1
]
-=
deltaPosition
;
}
_pathRenderer
.
positionCount
=
square
.
pathList
.
Count
();
_pathRenderer
.
SetPositions
(
square
.
pathList
.
ToArray
());
}
}
Assets/Scripts/UIManager.cs
View file @
748a100c
...
...
@@ -174,7 +174,7 @@ public class UIManager : MonoBehaviour
return
ret
;
}
p
rivate
Vector3
getXYVectorfromXZVector
(
Vector3
v
)
p
ublic
Vector3
getXYVectorfromXZVector
(
Vector3
v
)
{
return
new
Vector3
(
v
.
x
,
v
.
z
,
0.0f
);
}
...
...
@@ -230,11 +230,10 @@ public class UIManager : MonoBehaviour
/// </summary>
public
void
PathStart
()
{
_pathUI
.
SetActive
(
false
);
pathRenderer
.
Background
.
Toggle
=
false
;
StartCoroutine
(
pathRenderer
.
_StartMovingPath
(
prevSelectPathNum
));
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
pathRenderer
.
PathClear
();
}
...
...
@@ -287,7 +286,6 @@ public class UIManager : MonoBehaviour
updatePathInfo
(
pathNum
);
var
mouseClickPosition
=
getMouseClickPosition
(
hit
);
_pathUI
.
transform
.
position
=
mouseClickPosition
;
Debug
.
Log
(
pathNum
+
"test"
);
_pathUI
.
SetActive
(
true
);
}
}
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