查看: 2247|回复: 0
打印 上一主题 下一主题

unity3d与php的数据交换及本地数据的读取与储存

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2012-4-11 10:39:57 |只看该作者 |倒序浏览
测试前需要先搭建本机测试环境 下面是英文简介:
This library can be used to exchange data between Unity and php or to load / save binary data to a local file (the position players, etc.) Below you will find a server files, dll and example project.
Put the library in the "Your Project / Assets / Plugins /», server files - to the server, set the path to the gateway:
Code:

Gateway.Init(serverURL, gatewayPath, gatewayName);
Gateway.SESSIONID = "DEBUG";//You can get this from JavaScript
Gateway.GetSender().Call(myo, "ServerToClient", "hashtable", OnGetAnswer);
/*full code attach.*/
/*or for save local*/
void Serialize()
{
UNpserializer unp = new UNPSerializer();
byte[] ba = unp.Encode(myo);
}
And we get the data in the C# format, in callback function.



Now supported by the serialization / deserialization:

    NULL
    BOOLEAN
    STRING
    INTEGER
    FLOAT
    ARRAY
    ARRAYLIST
    HASHTABLE
    DICTIONARY
    LIST
    VECTOR2
    VECTOR3
    VECTOR4
    COLOR
    QUATERNION
    MESH
    TEXTURE2D (from PNG)

Not support your classes - later it will be included.



For download the Mesh, you must first save the serialized Mesh - you can use the top menu editor "SaveMesh"





I welcome your feedback.





DEMO


    unp.zip (759.3 KB, 7 views)
    unp_server.zip (184.8 KB, 6 views)
    UNP_dll.zip (93.4 KB, 8 views)

来自互联网
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2025-7-14 16:45 , Processed in 0.162634 second(s), 28 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部