public byte[] Generate(object obj) { var s = obj as Direction; var w = new NetworkWriter(); w.WriteFloat(s.x); w.WriteFloat(s.y); return(w.Buffer()); }