Example #1
0
    public static List <StaticShipCanvas> GetAllShipDesignList(ShipModemType type)
    {
        Int2 range = ConfigM.GetShipDesignCellRange(type);
        List <StaticShipCanvas> l = new List <StaticShipCanvas>();

        foreach (StaticShipCanvas canvas in m_lShipDesignInfo.Values)
        {
            if (canvas != null && canvas.Cell > range.Layer && canvas.Cell <= range.Unit)
            {
                l.Add(canvas);
            }
        }
        return(l);
    }
Example #2
0
    /// <summary>
    /// 获取船只设计图格子数区间.
    /// </summary>
    /// <returns>The ship design cell number.</returns>
    /// <param name="type">Type.</param>
    public static Int2 GetShipDesignCellRange(ShipModemType type)
    {
        int  Index = (int)type;
        Int2 range = new Int2();

        if (Index == 0)
        {
            range.Layer = 0;
            range.Unit  = 100;
        }
        else
        {
            range.Layer = GetParaStrToInt(59, Index, 0);
            range.Unit  = GetParaStrToInt(59, Index, 1);;
        }
        return(range);
    }
Example #3
0
    void CreateWhenSelectChange(ShipModemType type)
    {
        U3DUtil.DestroyAllChild(MyHead.Table.gameObject);
        List <StaticShipCanvas> l = ShipPlanDC.GetAllShipDesignList(type);

        SortCanvasList(ref l);
        for (int i = 0; i < l.Count; i++)
        {
            StaticShipCanvas Info = l[i];

            GameObject go = NDLoad.LoadWndItem("ShipDesignItem", MyHead.Table.transform);
            if (go != null)
            {
                ShipDesignItem item = go.GetComponent <ShipDesignItem>();
                if (item != null)
                {
                    item.SetData(Info, m_iWndType == WndType.ShipEdit, Info.ShipDesignID);
                    item.m_SelectCallBack = ShipDesignItemCallBack;
                }
            }
        }
        StartCoroutine(RepositionTable(1));
    }