Miscellaneous
Short list of various helpful components.
PlayerAppearanceManager
Manager that can change appearance of player's entities and units. Add this anywhere in the scene, reference the players and their appearance profiles (PlayerVisualProfile
). Base profile contains list of materials and color, but you can subclass it and extend the appearance properties further.
Alternatively, you can use per-player component the PlayerAppearanceModule.

You can use built-in EntityHealthBarAppearance and EntityAppearanceMaterial for updating visuals. Or implement your own using IEntityAppearance
interface to apply the appearance changes based on configured profiles.
Note: In next update, appearance will receive its own player module to better handle appearance changes.
ObjectPoolManager
Reusable pool manager used for frequently created and destroyed objects like projectiles. Keep in mind such objects must handle resetting of their state once they are reused.
Example of reuse
public class MyPooledObject : MonoBehaviour, IReusePoolObject
{
public void PrepareForReuse()
{
// Reset any necessary values here.
}
}
By default the manager attaches PoolObjectOnDisable
component to the object to automatically pool it back once it gets disabled (not destroyed).
This is an example how to use it in two lines:
// Use any ID you'd like, if using prefab instance ID can be suitable.
var prefabId = projectilePrefab.GetInstanceID();
var newProjectileObject = ObjectPoolManager.Global.CreateOrReturnFromPool(prefabId, projectilePrefab);
// Then use the new projectile here
MaterialBlinkEffect
Reusable component for quick color change on material and then fade back into original one.
This is used in demo units when taking damage.
BillboardObject
Component used for orientation of game objects towards the camera, like health or building bars.
It has 3 modes:
None (disabled) - Applies no changes to orientation
LookAt - Simple look at towards the camera, not ideal for top down perspective
Flat - HUD like orientation, looks like a canvas orienting element
Last updated