
Symphonie SimpleAvatar is a Unity package that offers a not overly powerful but easy-to-use solution for assembling character avatars.If you encounter any difficulties or want to learn more about us!| Discord |Items worn by the character in the video are NOT included in this pack!When you already have either SimpleAvatar or SimpleJiggle, you can get Capybara | Stylized Critters for just $15!----Symphonie 👕SimpleAvatarSymphonie SimpleAvatar is a Unity package that offers a not overly powerful but easy-to-use solution for assembling character avatars.Key FeaturesAvatar Assembly: Components like `Avatar` and `Avatar Part` are provided for spawning and assembling avatar parts, managing the hierarchy of avatar components, and dismantling and deleting avatar parts.Reference Replacement: Multiple methods are available for replacing UnityEngine.Object references after avatar parts are assembled. This is ideal for features like equipment physics effects. If reflection-based methods don't work, manual methods using code or Visual Scripting are provided as alternatives.Usage1. Add the `Avatar` component to your base character model (or skeleton).2. Add the `AvatarPart` component to your models you want to assemble into the character. Save them as prefabs, ensuring they share the same hierarchy structure.3. Call `Avatar.SpawnAndAssemble()` with the prefab, and see the model mixed in.4. Call `Avatar.DismantleAndDelete()` with the previously returned `AssembledAvatarPart` reference or the same prefab you used. The part model will disappear!Technical StuffWhy Reference Replacement?When you merge avatar parts into a single hierarchy, some scripts or components might still reference the original, temporary instantiated avatar part hierarchy. This can lead to unexpected behavior, as those references are no longer relevant in the final merged structure.The Reference Replacement feature ensures that all references are updated to point to the objects in the merged hierarchy instead of the temporary one. This is especially useful for scenarios like:Equipment or physics effects that need to interact with the final, assembled avatar.Scripts that rely on specific object references in the hierarchy.By providing both automatic (reflection-based) and manual (code or Visual Scripting) methods for reference replacement, Symphonie SimpleAvatar offers flexibility to handle a wide range of use cases, ensuring your avatar system works seamlessly.Manually, How?There are three ways to manually replace references:Implement the `IReferenceReplaceable` interface in your code.Create a class that implements the `IReferenceReplacer` interface and add the `ReferenceReplacer` attribute to it to specify which type this custom replacer will handle reference replacement for.3. Add the `ReferenceReplaceCallback` component to every GameObject that has components requiring reference replacement. Use code or visual scripts to listen to the `OnReplaceReference` event of the `ReferenceReplaceCallback` component. During the event, the `GetReplacedObject` method of `ReferenceReplaceCallback` will provide the replaced references. Key FeaturesAvatar Assembly: Components like `Avatar` and `Avatar Part` are provided for spawning and assembling avatar parts, managing the hierarchy of avatar components, and dismantling and deleting avatar parts.Reference Replacement: Multiple methods are available for replacing UnityEngine.Object references after avatar parts are assembled. This is ideal for features like equipment physics effects. If reflection-based methods don't work, manual methods using code or Visual Scripting are provided as alternatives.