예제 #1
0
        public static Vector3 BoardToWorldPosition(CubicHexCoord boardPos)
        {
            var worldPos = boardPos.ToAxial().ToPixel();

            return(new Vector3 {
                x = worldPos.x, z = worldPos.y
            });
        }
예제 #2
0
        public void Round()
        {
            FloatCubic    floatCubic = new FloatAxial(1.2f, 2.2f).ToFloatCubic();
            CubicHexCoord rounded    = floatCubic.Round();
            AxialHexCoord axial      = rounded.ToAxial();

            Assert.That(axial.q, Is.EqualTo(1));
            Assert.That(axial.r, Is.EqualTo(2));
        }