public static int ReadEntity(BinaryReader r) { int id = r.ReadInt32(); string prefabPath = r.ReadString(); byte[] data = PETools.Serialize.ReadBytes(r); if (!string.IsNullOrEmpty(prefabPath)) { PeEntity e = Create(id, prefabPath, Vector3.zero, Quaternion.identity, Vector3.one); e.Import(data); } return(id); }