Exemple #1
0
    public void LoadShipDesign()
    {
        U3DUtil.DestroyAllChild(MyHead.ShipDesignParent, false);
        StaticShipCanvas canvas = ShipPlanDC.GetCurShipDesignInfo();

        if (canvas != null)
        {
            GameObject go = NDLoad.LoadWndItem("ShipDesignItem", MyHead.ShipDesignParent.transform);
            if (go != null)
            {
                go.transform.localScale = new Vector3(0.8f, 0.8f, 1f);
                ShipDesignItem item = go.GetComponent <ShipDesignItem>();
                if (item != null)
                {
                    item.SetData(canvas, false, ShipPlanDC.CurShipDesignID);
                    EventDelegate.Add(item.BtnSelect.onClick, BtnSelectChange);
                }
            }
        }
    }
Exemple #2
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));
    }