Hi,
I have searched a lot but could not solve this. Please help me out with this.
I am trying to position the UIDragPanel in and out of the scene on the click of a button. It is working perfectly fine if i don't move the items in the panel. If i am moving the items in the drag panel and then again clicking to move the UIDragPanel back and fro the position changes.
After searching a lot i found if i reset the clipping center x back to 0 it is working fine. Tried doing in inspector and it worked.
This code i am attaching with the button
public UIPanel _DemGemSlider;
private bool isClicked = false;
void OnClick()
{
isClicked = !isClicked;
if(isClicked)
{
// to bring the UIDragPanel in front of the camera
TweenPosition.Begin(_DemGemSlider.gameObject, 0.1f, new Vector3(180, -29, -50));
}
if(!isClicked)
{
//to push back the UIDragPanel out of the scene
TweenPosition.Begin(_DemGemSlider.gameObject, 0.1f, new Vector3(1042, -29, -50));
//Reseting the cliprange to 0;
Vector4 reset = _DemGemSlider.clipRange;
reset.x = 0;
reset.y = 0;
_DemGemSlider.clipRange = reset;
}
}
The value of x is not changing.
Also if i use prefabs for the same thing what will be effect and which approach is better?
Please help me out with this !!!