Ejemplo n.º 1
0
    void initData(mapData md)
    {
        if (md.GTDList.Count == 0)
        {
            List <GoodsTempData> gtdList = MapBasicData.ReadHouseData();
            for (int i = 0; i < gtdList.Count; i++)
            {
                md.GTDList.Add(gtdList[i]);
            }
        }

        if (md.m_ftList.Count == 0)
        {
            MapBasicData.ReadFloorFile(md.m_ftList);
        }
    }
Ejemplo n.º 2
0
        void drawFloor(Vector2 vec)
        {
            MapBasicData.ReadFloorFile(m_ftList);

            int     num  = 0;
            Vector2 temp = Camera.main.ScreenToWorldPoint(vec);

            for (int i = 0; i < m_nCol; i++)
            {
                for (int j = 0; j < m_nRaw; j++)
                {
                    string     str = MapBasicData.GetFloorRes(m_ftList[num]);
                    GameObject obj = Instantiate(Resources.Load(str)) as GameObject;
                    obj.transform.SetParent(m_build.transform, true);
                    obj.transform.position     = new Vector2(temp.x + j * 0.355f + i * 0.355f, temp.y + j * 0.205f - i * 0.205f);
                    MapBasicData.map_list[num] = obj.transform.position;
                    num++;
                }
            }
        }