標籤:android style http io os 使用 ar strong for
自:http://game.ceeger.com/forum/read.php?tid=13479
如果你的工程只能以.Net 2.0而不能以.Net 2.0 subset運行,請看另外一個方法。
地址:http://game.ceeger.com/forum/read.php?tid=13479&fid=27
===============================================================
在此感謝下ganqiang87童鞋,本來之前試過這個方法的 但是不行,可是後來他說可以。我就試了下另外一個模式,結果就成了。
步驟:
1. 下載protobuf-net源碼, 把其中“protobuf-net”檔案夾 拷貝到unity 即可 . (我從svn下載好之後有很多檔案夾的,比如protobuf-net,protobuf-net_IKVM,protobuf-net_MonoDroid,protobuf-net_Phone7 ,ProtoGen,QuickStart 等等 ,只複製那個protobuf-net就可以 。)
地址:http://code.google.com/p/protobuf-net/source/checkout
通過svn下載。
================================================================================
注意: 現在protobuf-net google官網已經不存在源碼了, 作者已經把代碼轉移到github上去了
新地址: https://github.com/mgravell/protobuf-net
================================================================================
2. 建立一個新的檔案smcs.rsp ,內容是-unsafe
3. 把工程設定為.Net 2.0 subset
4. 重啟Unity
這樣就搞定了。
需要注意的是:
你的工程必須是.Net 2.0 subset, 如果是.Net 2.0是無法在ios上用這個方法的。(看文章開頭的紅字)
如果你之前使用dll的方式,而要轉換成源碼的方式 , 是很簡單的(反之也一樣)。 具體可以看一下源碼中的Serializer類,函數名都一樣。
提供包下載(裡麵包括了protobuf-net源碼和smcs.rsp ,直接匯入到工程就可以使用):http://pan.ceeger.com/viewfile.php?file_id=1832
(轉)[原創]在ios android裝置上使用 Protobuf (使用源碼方式)