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
8864b943
Commit
8864b943
authored
Aug 08, 2019
by
17김현학
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PathUI is placed at destination of path regardless of screensize
parent
2e620bee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
Test.unity
Assets/Scenes/Test.unity
+6
-6
Square.cs
Assets/Scripts/Square.cs
+2
-2
UIManager.cs
Assets/Scripts/UIManager.cs
+8
-1
No files found.
Assets/Scenes/Test.unity
View file @
8864b943
...
...
@@ -1290,9 +1290,9 @@ RectTransform:
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
-
{
fileID
:
1988874618
}
-
{
fileID
:
1843084269
}
-
{
fileID
:
1749798926
}
-
{
fileID
:
1988874618
}
m_Father
:
{
fileID
:
219938175
}
m_RootOrder
:
6
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
...
...
@@ -3288,7 +3288,7 @@ RectTransform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
699256181
}
m_RootOrder
:
1
m_RootOrder
:
2
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
...
...
@@ -3655,7 +3655,7 @@ RectTransform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
699256181
}
m_RootOrder
:
0
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
...
...
@@ -3813,12 +3813,12 @@ RectTransform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
699256181
}
m_RootOrder
:
2
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
0.0000
11921
,
y
:
27.1
}
m_SizeDelta
:
{
x
:
86.75
,
y
:
30
}
m_AnchoredPosition
:
{
x
:
0.0000
02861
,
y
:
30.6
}
m_SizeDelta
:
{
x
:
99.82
,
y
:
30
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1988874619
MonoBehaviour
:
...
...
Assets/Scripts/Square.cs
View file @
8864b943
...
...
@@ -21,8 +21,8 @@ public class Square : FlatLandObject
return
v
.
y
/
v
.
x
;
}
public
Vector3
Get
MiddlePoint
(
int
st
,
int
e
n
)
public
Vector3
Get
DestPoint
(
int
n
)
{
return
(
pathList
[
en
]
-
pathList
[
st
])
/
2
;
return
pathList
[
n
+
1
]
;
}
}
\ No newline at end of file
Assets/Scripts/UIManager.cs
View file @
8864b943
...
...
@@ -20,11 +20,17 @@ public class UIManager : MonoBehaviour
public
GameObject
_pathUI
;
public
LevelManager
Levelmanager
;
private
int
prevSelectPathNum
=
-
1
;
private
Text
pathName
;
private
Vector3
middlePoint
;
private
float
Screenfactor
;
// Start is called before the first frame update
void
Start
()
{
pathName
=
_pathUI
.
transform
.
GetComponentInChildren
<
Text
>();
_pathUI
.
SetActive
(
false
);
middlePoint
=
_pathUI
.
transform
.
position
;
Screenfactor
=
Screen
.
width
/
862.0f
*
2.5f
;
}
// Update is called once per frame
...
...
@@ -52,7 +58,8 @@ public class UIManager : MonoBehaviour
if
(
pathNum
!=
prevSelectPathNum
)
{
_pathUI
.
transform
.
Find
(
"Name"
).
GetComponent
<
Text
>().
text
=
obj
.
name
;
pathName
.
text
=
obj
.
name
;
_pathUI
.
transform
.
position
=
middlePoint
+
(
square
.
GetDestPoint
(
pathNum
)
+
new
Vector3
(
0
,
300
,
0
))
*
Screenfactor
;
_pathUI
.
SetActive
(
true
);
prevSelectPathNum
=
pathNum
;
}
...
...
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