Like stated in the previous text, game to function properly
need a scene controller object.
Scene controller object can be found in the 'Resources' folder with several version for
several character types.
'SCENECONTROLLER' is used on third-person character type.
'SCENECONTROLLER_TOPDOWN' is used on top-down character type.
You can load a scene controller object by using
'Tools/Combat Framework/Setup Scene Requirements'.
One of the components on a scene controller object is 'DecalManager' component.
'DecalManager' hold all information on assigned scene physics materials and how that material, what made an impact with a bullet, will react.
It holds material info by name, so when bullet makes an impact with some physics material, 'DecalManager' checks if that material name is found in its list of stored names and if it is, then it sets assigned bullethole decal, play impact sound and play assigned particle effect.
If a material is not found, then it sets default bullethole texture, sound and effect.
'DecalManager' holds a list of material info which contains:
- material name,
- texture to be set as bullethole,
- impact and drop sound to play and
- particle effect to start.
Also, default bullethole, sounds and particle effect can be set
to play on not found materials.
Usage:
To create bullet decal on some physics material, let's say metal, then do these steps:
- add a new item to the 'Material Impact Info' list.
- enter the name of a metal material ( 'Metal' )
- add textures to list of bullethole texture array.
From thatarray, one will be chosen at random upon impact.
- add audio clips to impact sounds clip array. From that array, one will be chosen at random upon impact.
- add an audio clip to drop clip array. From that array, one will be chosen at random when discarded empty shell hits the ground with a material.
- add root game object of particle system/s that will be started upon impact.
Here is tutorial on weapon setup and it includes how to set decals with DecalManager: