Пример #1
0
    public void changeFloorType(int nIndex, int ft)
    {
        GameObject obj = Instantiate(Resources.Load(MapBasicData.GetFloorRes(ft))) as GameObject;

        obj.transform.SetParent(m_parent.transform, true);
        obj.transform.position = m_floorObjList[nIndex].transform.position;
        obj.transform.GetComponent <Renderer>().sortingOrder = 0;
        DestroyImmediate(m_floorObjList[nIndex]);
        m_floorObjList[nIndex] = obj;
        m_ftList[nIndex]       = ft;
    }
Пример #2
0
    void DrawFloor()
    {
        int nNum = 0;

        for (int i = 0; i < m_col; i++)
        {
            for (int j = 0; j < m_raw; j++)
            {
                string     str = MapBasicData.GetFloorRes(m_mapData.m_ftList[nNum]);
                GameObject obj = Instantiate(Resources.Load(str)) as GameObject;
                obj.transform.SetParent(m_buildEdit.transform, true);
                m_floorObjList.Add(obj);
                nNum++;
            }
        }
        setMapPos();
    }
Пример #3
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++;
                }
            }
        }