Beispiel #1
0
    void ResizingReportPanel()
    {
        Canvas.ForceUpdateCanvases();

        float DefaultReportCarrierSize  = (CallPanelController.CurrentUIsize * 5f) - CallPanelController.CurrentEdgePadding;
        float DefaultReportPanelSize    = CallPanelController.CurrentUIsize * 6f;
        float ReportPanelDifferenceSize = 0;

        if (DetailReportCarrier.GetComponent <RectTransform>().rect.height > DefaultReportCarrierSize)
        {
            ReportPanelDifferenceSize = DetailReportCarrier.GetComponent <RectTransform>().rect.height - DefaultReportCarrierSize;
        }

        DetailReportInnerPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 15.6f, DefaultReportCarrierSize + CallPanelController.CurrentEdgePadding + ReportPanelDifferenceSize);

        CallPanelController.ContentSizeFitterReseter(DetailReportPanel);
        CallPanelController.ContentSizeFitterReseter(DetailReportPanel.transform.parent.gameObject);
        CallPanelController.ContentSizeFitterReseter(DetailReportCarrier);
    }
Beispiel #2
0
    public void Scaling()
    {
        SummaryPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 6f);
        Vector2 SummaryPanelSize = SummaryPanel.GetComponent <RectTransform>().sizeDelta;

        DetailScrollPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(0, Screen.height - CallPanelController.CurrentUIsize - SummaryPanelSize.y);
        Vector2 DetailScrollPanelSize = DetailScrollPanel.GetComponent <RectTransform>().sizeDelta;

        IncomePieGraphPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 5.6f, 0);
        float PieGraphPanelSize = IncomePieGraphPanel.GetComponent <RectTransform>().sizeDelta.x - (CallPanelController.CurrentEdgePadding * 2f);

        IncomePieGraphPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, CallPanelController.CurrentEdgePadding);
        IncomePieGraphPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(CallPanelController.CurrentEdgePadding, -CallPanelController.CurrentEdgePadding);
        IncomePieGraphCarrier.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, PieGraphPanelSize);
        IncomePieGraphCarrier.GetComponent <RectTransform>().anchoredPosition = new Vector2(CallPanelController.CurrentEdgePadding, -CallPanelController.CurrentEdgePadding * 2f);
        IncomePieGraphPanel.transform.GetChild(2).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, PieGraphPanelSize);
        IncomePieGraphPanel.transform.GetChild(2).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(CallPanelController.CurrentEdgePadding, -CallPanelController.CurrentEdgePadding * 2f);
        ExpensePieGraphPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(PieGraphPanelSize + CallPanelController.CurrentEdgePadding, 0);
        ExpensePieGraphPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, CallPanelController.CurrentEdgePadding);
        ExpensePieGraphPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -CallPanelController.CurrentEdgePadding);
        ExpensePieGraphCarrier.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, PieGraphPanelSize);
        ExpensePieGraphCarrier.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -CallPanelController.CurrentEdgePadding * 2f);
        ExpensePieGraphPanel.transform.GetChild(2).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(PieGraphPanelSize, PieGraphPanelSize);
        ExpensePieGraphPanel.transform.GetChild(2).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -CallPanelController.CurrentEdgePadding * 2f);
        SummaryReportPanel.GetComponent <RectTransform>().sizeDelta   = new Vector2(CallPanelController.CurrentUIsize * 4.4f, 0);
        SummaryReportCarrier.GetComponent <RectTransform>().offsetMin = new Vector2(0, CallPanelController.CurrentEdgePadding);
        SummaryReportCarrier.GetComponent <RectTransform>().offsetMax = new Vector2(-CallPanelController.CurrentEdgePadding, -CallPanelController.CurrentEdgePadding);
        SummaryReportCarrier.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 1.25f);
        SummaryReportCarrier.transform.GetChild(1).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 0.5f);
        for (int i = 2; i < 8; i++)
        {
            SummaryReportCarrier.transform.GetChild(i).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding);
        }
        SummaryReportCarrier.transform.GetChild(8).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 0.5f);
        for (int i = 9; i < 12; i++)
        {
            SummaryReportCarrier.transform.GetChild(i).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding);
        }
        SummaryReportCarrier.transform.GetChild(12).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 0.5f);
        SummaryReportCarrier.transform.GetChild(13).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 1.25f);
        for (int i = 0; i < SummaryReportCarrier.transform.childCount; i++)
        {
            if (i != 1 && i != 8 && i != 12 && i != 13)
            {
                SummaryReportCarrier.transform.GetChild(i).GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 0.4f);
                SummaryReportCarrier.transform.GetChild(i).GetChild(1).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 0.4f);
            }
        }
        SummaryReportCarrier.transform.GetChild(13).GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 0.6f);
        SummaryReportCarrier.transform.GetChild(13).GetChild(1).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 0.2f);
        SummaryReportCarrier.transform.GetChild(13).GetChild(2).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize * 0.4f);

        float DetailPanelBasicSize          = CallPanelController.CurrentUIsize * 5.6f;
        float DetailPanelCarrierBasicSize   = CallPanelController.CurrentUIsize * 4.6f;
        float DetailPanelCategoryObjectSize = CallPanelController.CurrentUIsize - CallPanelController.CurrentEdgePadding;

        DetailScrollPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0);
        DetailScrollPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().offsetMax = new Vector2(-CallPanelController.CurrentEdgePadding, 0);
        DetailScrollPanel.transform.GetChild(1).gameObject.GetComponent <RectTransform>().offsetMin = new Vector2(-CallPanelController.CurrentEdgePadding, 0);
        DetailScrollPanel.transform.GetChild(1).gameObject.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0);

        DetailReportCategoryPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentUIsize);
        DetailReportCategoryPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(0, DetailPanelCategoryObjectSize);
        DetailReportCategoryPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(CallPanelController.CurrentUIsize, -(CallPanelController.CurrentEdgePadding * 0.5f));
        DetailReportCategoryPanel.transform.GetChild(1).gameObject.GetComponent <RectTransform>().sizeDelta        = new Vector2(CallPanelController.CurrentUIsize * 4f, DetailPanelCategoryObjectSize);
        DetailReportCategoryPanel.transform.GetChild(1).gameObject.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, -(CallPanelController.CurrentEdgePadding * 0.5f));
        DetailReportInnerPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(0, DetailPanelCarrierBasicSize + CallPanelController.CurrentEdgePadding);
        DetailReportInnerPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().offsetMin = new Vector2(CallPanelController.CurrentEdgePadding, CallPanelController.CurrentEdgePadding);
        DetailReportInnerPanel.transform.GetChild(0).gameObject.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0);
        DetailReportCarrier.GetComponent <RectTransform>().sizeDelta        = new Vector2(CallPanelController.CurrentUIsize * 15.2f, 0);
        DetailReportCarrier.GetComponent <RectTransform>().anchoredPosition = new Vector2(CallPanelController.CurrentEdgePadding, 0);

        for (int i = 0; i < DetailReportCarrier.transform.childCount; i++)
        {
            DetailReportCarrier.transform.GetChild(i).GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 3f, 0);
            DetailReportCarrier.transform.GetChild(i).GetChild(1).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 4f, 0);
            DetailReportCarrier.transform.GetChild(i).GetChild(2).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 2f, 0);
            DetailReportCarrier.transform.GetChild(i).GetChild(3).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentEdgePadding * 0.5f, 0);
            DetailReportCarrier.transform.GetChild(i).GetChild(4).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 4f, 0);
            DetailReportCarrier.transform.GetChild(i).GetChild(5).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(CallPanelController.CurrentUIsize * 2f, 0);
            for (int j = 0; j < DetailReportCarrier.transform.GetChild(i).GetChild(j).childCount; j++)
            {
                if (i > 1)
                {
                    DetailReportCarrier.transform.GetChild(i).GetChild(j).GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding);
                }
                else
                {
                    DetailReportCarrier.transform.GetChild(i).GetChild(j).GetChild(0).gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(0, CallPanelController.CurrentEdgePadding * 0.75f);
                }
            }
        }

        CallPanelController.FontScaling(gameObject);
    }