Ejemplo n.º 1
0
        public Vector3 ToWorldPos(MyVector3Int myV3Int, int longX, int longY)
        {
            var bottomV3Int = myV3Int.ToVector3Int();
            var leftV3Int   = new Vector3Int(0, longY - 1, 0) + bottomV3Int;
            var rightV3Int  = new Vector3Int(longX - 1, 0, 0) + bottomV3Int;
            var topV3Int    = new Vector3Int(rightV3Int.x, leftV3Int.y, 0);

            var posX = (tileMap.CellToWorld(leftV3Int).x + tileMap.CellToWorld(rightV3Int).x) / 2.0f;
            var posY = (tileMap.CellToWorld(bottomV3Int).z + (tileMap.CellToWorld(topV3Int + new Vector3Int(1, 1, 0)).z)) / 2.0f;

            return(new Vector3(posX, 0, posY));
        }
Ejemplo n.º 2
0
        public Vector3 GetPos(MyVector3Int myV3Int)
        {
            var v3Int = myV3Int.ToVector3Int();

            return(GetPos(v3Int));
        }