public Texture GetTipsSprite(Vector3Int pos, enRotate rotate, bool isEmpNull = false) { if (m_mapTips == null) { return(null); } if (isEmpNull && (m_mapTips.GetShape(pos) == 0)) { return(null); } return(GetSprite(m_mapTips.GetShape(pos), rotate)); }
List <MapNodePlate> GetMapPath(int stX, int stZ, MapTips mapTips3) { List <MapNodePlate> res = new List <MapNodePlate>(); //基準点ブロック //真上からブロックにぶつかるまで探す int baseY = -1; bool isTriFloor = false; for (int y = 0; y < mapTips3.mapSizeY; ++y) { int revY = (mapTips3.mapSizeY - y - 1); Vector3Int pos = new Vector3Int(stX, revY, stZ); EnumShapeType shape = mapTips3.GetShape(pos); if (shape == 0) { continue; //空チップ } baseY = revY; res.Add(new MapNodePlate(shape, baseY, stX, stZ, mapTips3.mapSizeX, mapTips3.mapSizeZ)); isTriFloor = IsTriFloor(shape); break; } //三角床の場合は、下面もサーチ if (isTriFloor) { for (int y = baseY; y < mapTips3.mapSizeY; ++y) { int revY = (mapTips3.mapSizeY - y - 1); Vector3Int pos = new Vector3Int(stX, revY, stZ); EnumShapeType shape = mapTips3.GetShape(pos); if (shape != EnumShapeType.Box) { continue; } res.Add(new MapNodePlate(shape, revY, stX, stZ, mapTips3.mapSizeX, mapTips3.mapSizeZ)); break; } } return(res); }
TileFloor GetFloor(bool isSquare, int stX, int stZ, MapTips mapTips3) { //真上からブロックにぶつかるまで探す int baseY = -1; EnumShapeType baseShape = 0; int basePal = 0; bool isFind = false; for (int y = 0; y < mapTips3.mapSizeY; ++y) { int revY = (mapTips3.mapSizeY - y - 1); Vector3Int pos = new Vector3Int(stX, revY, stZ); EnumShapeType shape = mapTips3.GetShape(pos); int pal = mapTips3.GetEvent(pos); if (shape == 0) { continue; //空チップ } if (isSquare) { if (IsTriFloor(shape)) { continue; } } else { if (!IsTriFloor(shape)) { continue; } } baseY = revY + 1; baseShape = shape; basePal = pal; isFind = true; break; } if (isFind) { TileFloor res = new TileFloor(baseShape, basePal, baseY, stX, stZ); return(res); } else { return(null); } }
TileWall GetWall(bool isSquare, int stX, int stY, MapTips mapTips3) { //手前からブロックにぶつかるまで探す int baseZ = -1; EnumShapeType baseShape = EnumShapeType.Empty; int basePal = 0; bool isFind = false; for (int z = 0; z < mapTips3.mapSizeZ; ++z) { Vector3Int pos = new Vector3Int(stX, stY, z); EnumShapeType shape = mapTips3.GetShape(pos); int pal = mapTips3.GetEvent(pos); if (shape == 0) { continue; //空チップ } if (isSquare) { if (IsTriWall(shape)) { continue; } } else { if (!IsTriWall(shape)) { continue; } } baseZ = z; baseShape = shape; basePal = pal; isFind = true; break; } if (isFind) { TileWall res = new TileWall(baseShape, basePal, baseZ, stX, stY); return(res); } else { return(null); } }
public Sprite GetTipsSprite(Vector3Int pos, bool isEmpNull = false) { if (mapTips3_ == null) { return(null); } EnumShapeType shape = mapTips3_.GetShape(pos); if (isEmpNull && shape == 0) { return(null); } return(mapTipSprites_[(int)shape]); }
//貼り付け public void SetPaste(Vector3Int pos, MapTips tips) { for (int x = 0; x < tips.mapSizeX; ++x) { for (int y = 0; y < tips.mapSizeY; ++y) { for (int z = 0; z < tips.mapSizeZ; ++z) { Vector3Int tagpos = new Vector3Int(pos.x + x, pos.y + y, pos.z + z); if (this.IsSafePos(tagpos)) //はみでチェック { SetShape(tips.GetShape(x, y, z), tagpos); } } } } }