DirectionalNetworkEntity
public abstract class DirectionalNetworkEntity : NetworkEntity
{
public Direction dir = Direction.down;
//...
This sub type of NetworkEntity introduces an enum attribute called dir to help NetworkEntities that have very specific directional needs.
For example a 2d platformer has left and right which may be 1 set of animations, but need flipping when facing the opposite direction or top down game like the early Zelda or Pokemon games where each movement direction had a specific animation for it. Currently this class is setup for 2 and 4 directional characters, but this is a good place to add 8 directional too if you need it.
If your game uses top down 360 rotation of either 2d or 3d Entities, then I do not recommend using this class.
Methods
public void DirectionVectorTo2Dir(SVector targetDir)
Takes a vector and works out whether to set dir to left or right based on it
public void DirectionVectorTo4Dir(SVector targetDir)
Takes a vector and works out whether to set dir to left, right, up or down based on it