public static void Set(EntityBase entity, Material mat, int slot = 0)
{
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
if (entity == null)
throw new ArgumentNullException("entity");
if (mat == null)
throw new ArgumentNullException("mat");
#endif
NativeMaterialMethods.SetMaterial(entity.GetIEntity(), mat.Handle, slot);
}