C# custom attributes

Suppose you do not want always check the distance between player and some object and instead of it you just want to mark your function like [DistanceAttribute(2f)] where 2f is allowable distance and your function will be runned only if that distance between player and object will be Less or Equal of 2 and method will run automatically without any “if” over and over.

Continue reading “C# custom attributes”

C# preprocessor directives or how to split your code (free project)

I’m pretty sure you do not want to include Server code to the Client build, for instance – your server code contains important SQL passwords or any sort of account infromation, instead of lead two different projects you could simply mark your code #if Server and #if Client.

Continue reading “C# preprocessor directives or how to split your code (free project)”