コード例 #1
0
    /// <summary>
    /// 填充数据(标题和类型)
    /// </summary>
    public void SetData()
    {
        ProduceDialogBasePanel produceDialogBasePanel = OwnerView as ProduceDialogBasePanel;

        if (produceDialogBasePanel != null)
        {
            switch (produceDialogBasePanel.CurrentProduceType)
            {
            case ProduceType.HeavyWeapon:
                m_ToggleCount        = 4;
                m_TitleDescribes     = new string[] { "production_text_1001", "production_text_1002", "production_text_1003", "production_text_1015" };
                m_TypeNames          = new string[] { "production_title_1006", "production_title_1007", "production_title_1008", "production_title_1020" };
                m_ImageIcons         = new int[] { 40106, 40107, 40108, 40104 };
                m_ImageBaseIcons     = new int[] { 40109, 40109, 40109, 40105 };
                m_CurrentProduceType = ProduceType.HeavyWeapon;
                break;

            case ProduceType.Reformer:
                m_ToggleCount        = 4;
                m_TitleDescribes     = new string[] { "production_text_1010", "production_text_1011", "production_text_1012", "production_text_1015" };
                m_TypeNames          = new string[] { "production_title_1015", "production_title_1016", "production_title_1017", "production_title_1020" };
                m_ImageIcons         = new int[] { 40100, 40101, 40102, 40104 };
                m_ImageBaseIcons     = new int[] { 40103, 40103, 40103, 40105 };
                m_CurrentProduceType = ProduceType.Reformer;
                break;

            case ProduceType.Chip:
                m_ToggleCount        = 3;
                m_TitleDescribes     = new string[] { "production_text_1013", "production_text_1014", "production_text_1015" };
                m_TypeNames          = new string[] { "production_title_1018", "production_title_1019", "production_title_1020" };
                m_ImageIcons         = new int[] { 40110, 40111, 40104 };
                m_ImageBaseIcons     = new int[] { 40113, 40113, 40105 };
                m_CurrentProduceType = ProduceType.Chip;
                break;

            case ProduceType.Device:
                m_ToggleCount        = 4;
                m_TitleDescribes     = new string[] { "production_text_1007", "production_text_1008", "production_text_1009", "production_text_1015" };
                m_TypeNames          = new string[] { "production_title_1012", "production_title_1013", "production_title_1014", "production_title_1020" };
                m_ImageIcons         = new int[] { 40114, 40115, 40116, 40104 };
                m_ImageBaseIcons     = new int[] { 40117, 40117, 40117, 40105 };
                m_CurrentProduceType = ProduceType.Device;
                break;

            case ProduceType.Ship:
                m_ToggleCount        = 4;
                m_TitleDescribes     = new string[] { "production_text_1042", "production_text_1043", "production_text_1044", "production_text_1015" };
                m_TypeNames          = new string[] { "production_title_1062", "production_title_1063", "production_title_1064", "production_title_1020" };
                m_ImageIcons         = new int[] { 40118, 40119, 40120, 40104 };
                m_ImageBaseIcons     = new int[] { 40121, 40121, 40121, 40105 };
                m_CurrentProduceType = ProduceType.Ship;
                break;

            default:
                break;
            }
        }
    }
コード例 #2
0
    protected override void OnViewPartLoaded()
    {
        base.OnViewPartLoaded();
        ShowCharacter();
        OwnerView.PageBox.gameObject.SetActive(false);

        m_UIScrollRect = FindComponent <UIScrollRect>("Content/Scroller");
        ProduceDialogBasePanel produceDialogBasePanel = OwnerView as ProduceDialogBasePanel;

        if (produceDialogBasePanel.CloseByEsc)
        {
            //State.GetPage(0).ListSelection = new Vector2Int(0, 0);
            m_UIScrollRect.SetSelection(new Vector2Int(0, 0));
            produceDialogBasePanel.CloseByEsc = false;
        }
        switch (produceDialogBasePanel.CurrentProduceType)
        {
        case ProduceType.HeavyWeapon:
        case ProduceType.Reformer:
        case ProduceType.Device:
        case ProduceType.Ship:
            m_UIScrollRect.CellListPadding = new RectOffset(0,
                                                            m_UIScrollRect.CellListPadding.right,
                                                            m_UIScrollRect.CellListPadding.top,
                                                            m_UIScrollRect.CellListPadding.bottom);
            break;

        case ProduceType.Chip:
            m_UIScrollRect.CellListPadding = new RectOffset(170,
                                                            m_UIScrollRect.CellListPadding.right,
                                                            m_UIScrollRect.CellListPadding.top,
                                                            m_UIScrollRect.CellListPadding.bottom);
            break;

        default:
            break;
        }
    }