//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateWithRect(HoverCanvas pHoverCanvas, HoverShapeRect pShapeRect) { pHoverCanvas.Controllers.Set(HoverCanvas.SizeXName, this); pHoverCanvas.Controllers.Set(HoverCanvas.SizeYName, this); pHoverCanvas.SizeX = pShapeRect.SizeX; pHoverCanvas.SizeY = pShapeRect.SizeY; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateTrackShape(HoverShapeRect pShapeRect, HoverRendererSlider pRendSlider) { HoverShapeRect trackShapeRect = (HoverShapeRect)pRendSlider.Track.GetShape(); trackShapeRect.Controllers.Set(HoverShapeRect.SizeXName, this); trackShapeRect.Controllers.Set(HoverShapeRect.SizeYName, this); trackShapeRect.SizeX = pShapeRect.SizeX; trackShapeRect.SizeY = pShapeRect.SizeY; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateRow(HoverLayoutRectRow pRow, HoverShapeRect pShape) { if ( pRow == null ) { return; } pRow.Controllers.Set(HoverLayoutRectRow.SizeXName, this); pRow.Controllers.Set(HoverLayoutRectRow.SizeYName, this); pRow.SizeX = pShape.SizeX; pRow.SizeY = pShape.SizeY; }
/*--------------------------------------------------------------------------------------------*/ private void UpdateButtonWidth(HoverShapeRect pShapeRect, HoverShapeRect pButtonShapeRect) { pButtonShapeRect.Controllers.Set(HoverShapeRect.SizeXName, this); pButtonShapeRect.SizeX = pShapeRect.SizeX; }
/*--------------------------------------------------------------------------------------------*/ protected void UpdateAutoUv(HoverShapeRect pShapeRect, float pOuterW, float pOuterH) { if ( !AutoUvViaSizeType ) { return; } Controllers.Set(UvTopName, this); Controllers.Set(UvBottomName, this); Controllers.Set(UvLeftName, this); Controllers.Set(UvRightName, this); UvTop = Mathf.Lerp(0.5f, 0, pOuterH/pShapeRect.SizeY); UvBottom = 1-UvTop; UvLeft = Mathf.Lerp(0.5f, 0, pOuterW/pShapeRect.SizeX); UvRight = 1-UvLeft; }