public void setProperties(Rect windowContentRect, GUIContent windowGuiContent, GUISkin skin,
Action doMyWindowMethod, Action onExitByEscOrClose, Action onClickOutsideOfWindow)
{
if (windowStyle==null)
windowStyle = skin.FindStyle(windowStyleName);
closeButtonStyle = skin.FindStyle(closeButtonStyleName);
this.doMyWindowMethod = doMyWindowMethod;
this.onExitByEscOrClose = onExitByEscOrClose;
this.onClickOutsideOfWindow = onClickOutsideOfWindow;
this.skin = skin;
this.windowGuiContent = windowGuiContent;
windowRect = new Rect ( windowContentRect.x - windowStyle.padding.left,
windowContentRect.y - windowStyle.padding.top,
windowContentRect.width + windowStyle.padding.horizontal,
windowContentRect.height + windowStyle.padding.vertical);
windowContentRect.x = windowStyle.padding.left;
windowContentRect.y = windowStyle.padding.top;
this.windowContentRect = windowContentRect;
this.windowDragHeight = windowStyle.padding.top;
updateDragRect();
closeButtonHeight = closeButtonStyle.normal.background.height - closeButtonStyle.overflow.vertical;
closeButtonWidth = closeButtonStyle.normal.background.width - closeButtonStyle.overflow.horizontal;
int top = 8;
int left = (int)( windowRect.width - closeButtonWidth) - 12;
closeButtonRect = new Rect(left,
top,
closeButtonWidth,
closeButtonHeight);
}