So, I wanted to share with you how the system is designed to work, currently. After importing the package, there will be guided steps, but this is just a subtle breakdown.
All control is managed by a Game Configuration Data File (Scriptable Object). It basically contains the links to 3 other Scriptable Object files for Serializing all Game and User Settings. These consist of the following:
Game Attachment Configuration - All Attachment Settings, icons, functionality
Game Weapon Configuration - All Weapons defined to work within the system
User Weapon Configuration - User Attachment settings on a per weapon basis.
The Game Attachment Configuration is linked to an Item Inventory (1 to 1). The Game Weapon Configuration is linked to the Game Attachment Configuration and it's linked ItemInventory. The Game Attachment Configuration is built by scanning your current project for all ItemPickup prefabs in the Project Hierarchy, and creates a unique weapon refernence for each uniquie set of Item Definition Amounts that have a length of 2, and are members of the specifgied Item Inventory in the Game Attachment Configuration. It's assumed that the Weapon Item Definition Amount is 1, and the other Ammunition Item Definition Amount is greater than 1. Once a Weapon Item Pickup Prefab is located, the system will create a new Prefab based on the contents of the Item Pickup Prefab, removing all Opsive and Collider Components. The ItemPickup prfab is not changed in anyway, and there is no linking between the 2 prefabs, as to not cause issue with your weapons. This will be used for creating a Weapon Structure Mapping, for determining where Attachments should spawn to, based on the configuration in the Game Weapon Configuration. Currently, it's a manual process of dragging the transforms of the Weapon game objects into their designated Weapon Structrure Assignments. This includes objects such as Barrels, Barrel Ends, Clips, Triggers, Upper and Lower Receivers. Any required transforms that are missing or unassigned will be resolved by creating Placeholder Prefabs into the Weapon game object structure of the Configuration Prefab. then you can drag these missing Structrues to proper locations and positions in the Scene view.
Once all this is done, the system will add a Weapon Attachment Rig to the Configuration Prefab, and this is what will get added dynamically at runtime, without breaking any Prefab relationships.
Once this is done, the system is setup to only allow changes to the Game * Configuration Data Files while in the Unity Editor, and not in any form of Build, including Developer Builds. This is due to the Unity Editor scripting and controls put in place to prevent someone from Changing Game Configured Data. I'm creating a runtime environment, just for the Editor, so that you can Assign/Unnasign Attachnments to Weapons. Set them as the Default, whether they're enabled by Default, and this is on a per Weapon Configuration.
The last Scriptable Object is the User Weapon Configuration, and it stores the Users Preferences on an Attachment per Weapon level. This means that they can have a different configuration for an attachment on different weapons, and their settings are stored. This includes whether or not an attachment is selected, or if it was Activated, and preserves these settings in between Game Sessions and Scene Changes.
There's a lot more to it, than this, but it's coming along nicely. I'm still working the UI, and getting screen shots, and have have to link those from my website in the next few days. I've been putting in late nights, just to get the system ready for release. Hopefully, I will have a video of the system working, and how to use it, soon...
Rob