RobotecAI / robotec-o3de-tools

Toolset for demo recordings in O3DE
5 stars 1 forks source link

Implement PrefabVariantComponent in LevelModificationTools #15

Closed michalpelka closed 4 months ago

michalpelka commented 4 months ago

LevelModificationTools

Tool that allows to change level's content during game via scripts or buses. It allows to test behavior in Editor.

PrefabVariantComponent

PrefabVariantComponent allows to choose a variant of the object during simulation using scripting. A good example is replacing a tree spiece for an orchard. The variant of the object should be contained as O3DE prefab. The list of variants is configured with a map reflected in the component. The Group ID allows to have multiple entries that will change variants together.

PrefabVariantComponent

The default prefab variant can be set - the chosen prefab will be loaded automatically on component activation. The Peek button allows the level designer to take a look at a given variant, without need to start simulation. It will affect all components with the same Group ID. The Prefab Editor Component handles a PrefabVariantRequestsBus. This bus has a method SetPrefabVariant that allows to change of a variant. The key to this bus is the above-mentioned Group ID.