Exemplo n.º 1
0
        public static Vector3 GetSnappedPos(Camera cam, Vector3 scale, LayerMask layerMask)
        {
            var pos      = MousePositioning.MouseToWorldPos(cam, layerMask);
            var posRound = new Vector3(
                Mathf.Round(pos.x) + 0.5f,
                Mathf.Round(pos.y),
                Mathf.Round(pos.z) + 0.5f);

            return(posRound);
        }
Exemplo n.º 2
0
        public static Vector3 GetSnappedPos(Camera cam, Vector3 scale)
        {
            var pos      = MousePositioning.MouseToWorldPos(cam);
            var posRound = new Vector3(
                Mathf.Round(pos.x - scale.x / 2f) + scale.x / 2f,
                Mathf.Round(pos.y),
                Mathf.Round(pos.z - scale.z / 2f) + scale.z / 2f);

            return(posRound);
        }