public void updateForGUI() { // if using offset as proportion then convert it as pixels if (!xAsPixels) { offsetInPixels.x = offset.x * Screen.width; } else { offsetInPixels.x = offset.x; } // if using offset as propportion then convert it as pixels if (!yAsPixels) { offsetInPixels.y = offset.y * Screen.height; } else { offsetInPixels.y = offset.y; } // then apply position correction GUIScreenLayoutManager.adjustPos(transform, guiElem, offsetInPixels, layout); }
public void updateForGUI() { // if using offset as percentage then convert it as pixels if (asProportion) { offsetCalculation.x = offset.x * Screen.width; offsetCalculation.y = offset.y * Screen.height; } else { offsetCalculation.x = offset.x; offsetCalculation.y = offset.y; } // then apply position correction GUIScreenLayoutManager.adjustPos(transform, guiElem, offsetCalculation, layout); }