Welcome,
Guest
. Please
login
or
register
.
December 11, 2024, 11:50:13 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
problem with draggable panels
« previous
next »
Print
Pages: [
1
]
Author
Topic: problem with draggable panels (Read 1657 times)
laurentl
Full Member
Thank You
-Given: 0
-Receive: 0
Posts: 188
problem with draggable panels
«
on:
October 02, 2013, 06:15:27 PM »
it's all offset for some reason:
structure is:
panel with draggable panel
grid
dragpanelcontents ...
it looks like this :
https://www.youtube.com/watch?v=JVbhdG0CBv4
I'm using this script to center on click:
using
UnityEngine
;
using
System.Collections
;
public
class
CenterOnObject
:
MonoBehaviour
{
public
UIDraggablePanel dragPanel
;
void
Start
(
)
{
dragPanel
=
NGUITools
.
FindInParents
<
UIDraggablePanel
>
(
gameObject
)
;
}
void
OnClick
(
)
{
Center
(
)
;
}
public
void
Center
(
)
{
if
(
dragPanel
)
{
Vector3 pos
=
dragPanel
.
transform
.
worldToLocalMatrix
.
MultiplyPoint3x4
(
transform
.
position
)
;
SpringPanel
.
Begin
(
dragPanel
.
gameObject
,
-
pos, 7f
)
;
}
}
}
Logged
McDROID!
http://www.mcdroidgame.com/
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: problem with draggable panels
«
Reply #1 on:
October 03, 2013, 04:20:29 AM »
"an error has occurred. Please try again later"
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
problem with draggable panels