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
94a9b12d
Commit
94a9b12d
authored
Aug 14, 2019
by
16이진형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui 클릭되면 double click 무시
parent
833ef0ae
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
48 deletions
+63
-48
Test.unity
Assets/Scenes/Test.unity
+1
-1
UIManager.cs
Assets/Scripts/UIManager.cs
+60
-47
TagManager.asset
ProjectSettings/TagManager.asset
+2
-0
No files found.
Assets/Scenes/Test.unity
View file @
94a9b12d
...
...
@@ -829,7 +829,7 @@ GameObject:
-
component
:
{
fileID
:
502908128
}
m_Layer
:
5
m_Name
:
DoubleClickPanel
m_TagString
:
Untagged
m_TagString
:
panel
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
...
...
Assets/Scripts/UIManager.cs
View file @
94a9b12d
...
...
@@ -68,65 +68,32 @@ public class UIManager : MonoBehaviour
ped
.
position
=
Input
.
mousePosition
;
List
<
RaycastResult
>
results
=
new
List
<
RaycastResult
>();
gr
.
Raycast
(
ped
,
results
);
if
(
results
.
Count
!=
0
)
{
GameObject
obj
=
results
[
0
].
gameObject
;
if
(
obj
.
tag
==
"VelocitySlider"
)
bool
isIgnored
=
true
;
//ui 클릭시.
foreach
(
RaycastResult
re
in
results
)
{
GameObject
obj
=
re
.
gameObject
;
//panel만 있는지 검사.
isIgnored
&=
(
obj
.
tag
==
"ignored"
);
//Debug.Log(obj);
//슬라이더일때
if
(
obj
.
tag
==
"VelocitySlider"
)
{
sliderflag
=
1
;
if
(
_pathUI
.
activeSelf
==
true
&&
prevSelectPathNum
!=
-
1
)
{
square
.
pathVelocity
[
prevSelectPathNum
+
1
]
=
velocityslider
.
GetLogScaleValue
();
pathVelocity
.
text
=
"Velocity: "
+
square
.
GetPathVelocity
(
prevSelectPathNum
).
ToString
()
+
"c"
;
break
;
}
}
}
else
{
RaycastHit
hit1
;
RaycastHit
hit2
;
var
ray
=
Camera
.
main
.
ScreenPointToRay
(
Input
.
mousePosition
);
if
(
Physics
.
Raycast
(
ray
,
out
hit1
))
{
ray
=
playercamera
.
ViewportPointToRay
(
hit1
.
textureCoord
);
if
(
Physics
.
Raycast
(
ray
,
out
hit2
))
if
(
isIgnored
)
{
var
obj
=
hit2
.
collider
.
gameObject
;
if
(
obj
.
tag
==
"path"
)
{
int
pathNum
=
int
.
Parse
(
obj
.
name
.
Substring
(
13
));
if
(
pathNum
!=
prevSelectPathNum
)
{
updatePathInfo
(
obj
,
pathNum
);
var
mouseClickPosition
=
getMouseClickPosition
(
hit1
);
var
v
=
getDestVector
(
mouseClickPosition
-
middlePoint
,
new
Vector3
(
hit2
.
point
.
x
,
hit2
.
point
.
z
,
0.0f
),
pathNum
);
_pathUI
.
transform
.
position
=
mouseClickPosition
+
v
;
_pathUI
.
SetActive
(
true
);
prevSelectPathNum
=
pathNum
;
}
else
{
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
sliderflag
=
0
;
}
}
else
{
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
sliderflag
=
0
;
}
}
}
//클릭된 ui가 패널만 있을때.
TryFIndPath
();
}
}
else
if
(
sliderflag
==
1
&&
Input
.
GetMouseButton
(
0
))
...
...
@@ -208,6 +175,52 @@ public class UIManager : MonoBehaviour
velocityslider
.
UpdateValuebyVelocity
(
square
.
GetPathVelocity
(
pathNum
));
}
private
void
TryFIndPath
()
{
RaycastHit
hit1
;
RaycastHit
hit2
;
var
ray
=
Camera
.
main
.
ScreenPointToRay
(
Input
.
mousePosition
);
if
(
Physics
.
Raycast
(
ray
,
out
hit1
))
{
ray
=
playercamera
.
ViewportPointToRay
(
hit1
.
textureCoord
);
if
(
Physics
.
Raycast
(
ray
,
out
hit2
))
{
var
obj
=
hit2
.
collider
.
gameObject
;
Debug
.
Log
(
obj
.
tag
);
if
(
obj
.
tag
==
"path"
)
{
int
pathNum
=
int
.
Parse
(
obj
.
name
.
Substring
(
13
));
if
(
pathNum
!=
prevSelectPathNum
)
{
updatePathInfo
(
obj
,
pathNum
);
var
mouseClickPosition
=
getMouseClickPosition
(
hit1
);
var
v
=
getDestVector
(
mouseClickPosition
-
middlePoint
,
new
Vector3
(
hit2
.
point
.
x
,
hit2
.
point
.
z
,
0.0f
),
pathNum
);
_pathUI
.
transform
.
position
=
mouseClickPosition
+
v
;
_pathUI
.
SetActive
(
true
);
prevSelectPathNum
=
pathNum
;
}
else
{
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
sliderflag
=
0
;
}
}
else
{
_pathUI
.
SetActive
(
false
);
prevSelectPathNum
=
-
1
;
sliderflag
=
0
;
}
}
}
}
/// <summary>
/// 현재 지정된 path를 시작합니다.
/// </summary>
...
...
ProjectSettings/TagManager.asset
View file @
94a9b12d
...
...
@@ -7,6 +7,8 @@ TagManager:
-
path
-
pathui
-
VelocitySlider
-
doubleclick
-
panel
layers
:
-
Default
-
TransparentFX
...
...
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