Пример #1
0
    protected void AssignToOrientation(IBlockPlaceOrientator orientator, RaycastHit hit)
    {
        Vector3 normal;

        if (orientationMode == OrientationMode.WorldNormal)
        {
            normal = (hit.point - planetCenter.position).normalized;
        }
        else
        {
            normal = orientator.NormalFromRay(hit);
        }

        AlignToTriangle(normal, Vector3.forward);

        objectToPlace.Rotate(new Vector3(0, angleAroundNormal, 0), Space.Self);
    }