Hi!
I have a draggable panel that goes from top to bottom of the screen. I have a script that adjusts clipping properly based on Screen.height. Here is the code:
int maxHeight = GameObject.Find("UI Root (2D)").GetComponent<UIRoot>().maximumHeight;
Vector4 tmp = this.GetComponent<UIPanel>().clipRange;
if(Screen.height > maxHeight)
tmp
= new Vector4
(0,
0,
0,maxHeight
); else
tmp
= new Vector4
(0,
0,
0,Screen
.height);
this.GetComponent<UIPanel>().clipRange = tmp;
this.GetComponent<UIDraggablePanel>().ResetPosition();
I attach this to any draggablepanel object that i want clipping to be from top to bottom and it works.
The problem is that when going fullscreen, this code will not work any more! I tried everything i could think of, but basically
calling this code after app is in fullscreen does not again correctly position clipping.
Is there any ideas that i can try, i waited few frames until app goes into fullscreen and then tried to position again. I really can't figure this out, any help appreciated!