コード例 #1
0
ファイル: MapTips.cs プロジェクト: ishidafuu/nkpb_base_system
        public void ShrinkZ(int lineZ, int length)
        {
            MapTips res = CreateInstance <MapTips>();

            res.Init(mapSizeX, mapSizeY, mapSizeZ);

            for (int x = 0; x < mapSizeX; ++x)
            {
                for (int y = 0; y < mapSizeY; ++y)
                {
                    for (int z = 0; z < mapSizeZ; ++z)
                    {
                        Vector3Int tagpos;
                        if (z < lineZ)
                        {
                            tagpos = new Vector3Int(x, y, z);
                        }
                        else
                        {
                            tagpos = new Vector3Int(x, y, z + length);
                        }

                        res.SetShape(GetShape(tagpos), x, y, z);
                    }
                }
            }

            this.shapes = res.shapes;
        }
コード例 #2
0
        //マップサイズ変更
        void ResizeMap()
        {
            MapTips newMapTips3 = CreateInstance <MapTips>();

            newMapTips3.Init(m_mapSizeX, m_mapSizeY, m_mapSizeZ);

            for (int x = 0; x < m_mapTips.mapSizeX; ++x)
            {
                if (x >= m_mapSizeX)
                {
                    continue;
                }

                for (int y = 0; y < m_mapTips.mapSizeY; ++y)
                {
                    if (y >= m_mapSizeY)
                    {
                        continue;
                    }

                    for (int z = 0; z < m_mapTips.mapSizeZ; ++z)
                    {
                        if (z >= m_mapSizeZ)
                        {
                            continue;
                        }

                        newMapTips3.SetEvent(m_mapTips.GetEvent(x, y, z), x, y, z);
                        newMapTips3.SetShape(m_mapTips.GetShape(x, y, z), x, y, z);
                    }
                }
            }

            m_mapTips = newMapTips3;

            OpenMapEditor();
        }
コード例 #3
0
ファイル: MapTips.cs プロジェクト: ishidafuu/nkpb_base_system
        //コピー
        public MapTips GetCopy(Vector3Int pos, Vector3Int size)
        {
            //MapTips res = new MapTips(size.x, size.y, size.z);
            MapTips res = CreateInstance <MapTips>();

            res.Init(size.x, size.y, size.z);

            for (int x = 0; x < size.x; ++x)
            {
                for (int y = 0; y < size.y; ++y)
                {
                    for (int z = 0; z < size.z; ++z)
                    {
                        Vector3Int tagpos = new Vector3Int(pos.x + x, pos.y + y, pos.z + z);
                        // Assert.IsTrue(this.IsSafePos(tagpos));
                        // Debug.Log(tagpos + " shape" + GetShape(tagpos));
                        res.SetShape(GetShape(tagpos), x, y, z);
                        // res.SetEvent(GetEvent(tagpos), tagpos);
                    }
                }
            }

            return(res);
        }
コード例 #4
0
 public void SetMapShape(EnumShapeType value, int x, int y, int z)
 {
     m_mapTips.SetShape(value, x, y, z);
 }