3 Star 3 Fork 1

Gitee 极速下载/kbengine-unity3d-plugins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/kbengine/kbengine_unity3d_plugins
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
EntityCall.cs 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
kbe 提交于 7年前 . onStreamData相关事件触发
namespace KBEngine
{
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
/*
实体的EntityCall
关于EntityCall请参考API手册中对它的描述
https://github.com/kbengine/kbengine/tree/master/docs/api
*/
public class EntityCall
{
// EntityCall的类别
public enum ENTITYCALL_TYPE
{
ENTITYCALL_TYPE_CELL = 0, // CELL_ENTITYCALL
ENTITYCALL_TYPE_BASE = 1 // BASE_ENTITYCALL
}
public Int32 id = 0;
public string className = "";
public ENTITYCALL_TYPE type = ENTITYCALL_TYPE.ENTITYCALL_TYPE_CELL;
private NetworkInterface networkInterface_;
public Bundle bundle = null;
public EntityCall()
{
networkInterface_ = KBEngineApp.app.networkInterface();
}
public virtual void __init__()
{
}
bool isBase()
{
return type == ENTITYCALL_TYPE.ENTITYCALL_TYPE_BASE;
}
bool isCell()
{
return type == ENTITYCALL_TYPE.ENTITYCALL_TYPE_CELL;
}
/*
创建新的call
*/
public Bundle newCall()
{
if(bundle == null)
bundle = Bundle.createObject();
if(type == EntityCall.ENTITYCALL_TYPE.ENTITYCALL_TYPE_CELL)
bundle.newMessage(Message.messages["Baseapp_onRemoteCallCellMethodFromClient"]);
else
bundle.newMessage(Message.messages["Entity_onRemoteMethodCall"]);
bundle.writeInt32(this.id);
return bundle;
}
/*
向服务端发送这个call
*/
public void sendCall(Bundle inbundle)
{
if(inbundle == null)
inbundle = bundle;
inbundle.send(networkInterface_);
if(inbundle == bundle)
bundle = null;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/mirrors/kbengine-unity3d-plugins.git
git@gitee.com:mirrors/kbengine-unity3d-plugins.git
mirrors
kbengine-unity3d-plugins
kbengine-unity3d-plugins
master

搜索帮助