public IDigitPanelSet CreateDigitPanelSet(int digitPlace, IQuantityRoller quantityRoller, Vector2 panelDim, Vector2 padding) { IDigitPanelSetAdaptorInitializationData uiaInitData = new DigitPanelSetAdaptorInitializationData( digitPlace, panelDim, padding ); float panelSetWidth = panelDim.x; float panelSetHeight = panelDim.y * 2 + padding.y; Vector2 panelSetLength = new Vector2(panelSetWidth, panelSetHeight); IDigitPanelSetInstantiationData instData = new DigitPanelSetInstantiationData( panelSetLength, uiaInitData ); DigitPanelSetAdaptor digitPanelSetAdaptor = CreateInstatiableUIA <DigitPanelSetAdaptor>(instData); IUIAdaptor quantityRollerAdaptor = quantityRoller.GetUIAdaptor(); digitPanelSetAdaptor.SetParentUIA(quantityRollerAdaptor, true); IUIAdaptorBaseInitializationData baseInitData = quantityRollerAdaptor.GetDomainInitializationData(); digitPanelSetAdaptor.GetReadyForActivation( baseInitData, false ); IDigitPanelSet digitPanelSet = (IDigitPanelSet)digitPanelSetAdaptor.GetUIElement(); return(digitPanelSet); }
void CalcAndSetRectDimension(Vector2 panelDim, Vector2 padding) { IQuantityRoller roller = (IQuantityRoller)this.GetParentUIE(); IUIAdaptor rollerUIA = roller.GetUIAdaptor(); Rect rollerRect = rollerUIA.GetRect(); float rollerWidth = rollerRect.width; float height = (panelDim.y * 2) + (padding.y * 3); float width = panelDim.x; float localX = rollerWidth - ((width + padding.x) * (thisDigitPlace + 1)); float localY = 0f; ((IDigitPanelSetAdaptor)this.GetUIAdaptor()).SetRectDimension(height, width, localX, localY); }