You'll have to create primitive groups, then assign a material for each group. In Unity, you might have to turn off Split Geos by Group under the Cooking tab on the asset's Inspector UI.
See this video that shows setting multiple materials via primitive groups:
https://youtu.be/zzcBhuRLJZo?t=109 [youtu.be]