Required on the same <MeshRenderer>. Points to a project .mat. A built-in material (builtin:Default-Material) can’t be copied.
Property that’s set
The shader properties tagged [MainTexture] and [MainColor]. If none are found, _MainTex and _Color.
Copy’s name
<original .mat name>_<path of the GameObject>.mat. The path joins with _ the key (or the name when there is none) of each GameObject from the root of the entry point down to that GameObject; a GameObject without a key directly inside a <For> puts the row keys before its name. Each GameObject gets a copy of its own
It’s an error when the copies of different GameObjects would get the same file name (names that differ only in upper and lower case, or only in characters a file name cannot have) and they set different images or colors. Rename one of them
Changes inside a prefab (<At>, a component change, <Slot> with path) can only be written in a part’s file. To change one from the entry point, make a part that wraps the <Prefab> and use that.
fill attaches the children added under the prefab’s root, one by one, to objects inside the prefab whose names match a pattern (mount points).
Assets/Example/Hall.mochi.xml
<Hallprefab="true">
<Rooms/>
</Hall>
<!-- file: Assets/Example/Rooms.mochi.xml -->
<Rooms>
<Prefabsrc="../Kit/KitRoom.prefab"fill="Mount*">
<Foreach="art"in="folder('../Gallery/art/')">
<Objectkey="{art.key}"name="{art.title}"/>
</For>
</Prefab>
</Rooms>
Patterns
* matches any run of characters, including none. It’s compared against the whole name.
Order of attachment
The order of a depth-first walk of the prefab’s hierarchy. Numbers in names aren’t read. In the example KitRoom.prefab, the order is Mount1, Mount0, Mount3, Mount2.
Children that are counted
Only children added under the prefab’s root. Children added with <At> and component changes aren’t counted.
The offset (x y z) from one instance to the next. It is turned by the rotation of the original instance (the rotation written, or the rotation of the prefab’s root when not written) before it is applied
Name of an added instance
Continues as original name (1), original name (2).
Same as the original
Rotation, scale, active, and Static, plus, of the changes inside the prefab, component changes, <At>’s active, and components added with add="true" (a value that points to an object inside the prefab or to another added component points to the one in the same instance).
Only on the original instance
Children added with <At> and <Slot path>, and children placed in the mounts of the original instance. A component change or a component added with add="true" that points to one of these, or to anything under them, is an error (MOCHI9001). Pointing to an object inside the prefab points to that instance’s own object in each instance; an object outside the prefab is shared by all instances.
Checking whether gap is present
Only done once there are more children than mount points.
While there are enough mount points, missing gap isn’t an error.