Skip to content

Commit 21c4841

Browse files
committed
客户端插件使用工具生成,去掉反射的使用
kbengine/kbengine#532
1 parent 80ae906 commit 21c4841

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+15881
-99
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "Assets/Plugins/kbengine/kbengine_unity3d_plugins"]
2-
path = Assets/Plugins/kbengine/kbengine_unity3d_plugins
3-
url = https://github.com/kbengine/kbengine_unity3d_plugins
4-
51
[submodule "kbengine_demos_assets"]
62
path = kbengine_demos_assets
73
url = https://github.com/kbengine/kbengine_demos_assets.git

Assets/Plugins/kbengine.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.

Assets/Plugins/kbengine/kbengine_unity3d_plugins.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
/*
2+
Generated by KBEngine!
3+
Please do not modify this file!
4+
Please inherit this module, such as: (class Account : AccountBase)
5+
tools = kbcmd
6+
*/
7+
8+
namespace KBEngine
9+
{
10+
using UnityEngine;
11+
using System;
12+
using System.Collections;
13+
using System.Collections.Generic;
14+
15+
// defined in */scripts/entity_defs/Account.def
16+
public abstract class AccountBase : Entity
17+
{
18+
public EntityBaseEntityCall_AccountBase baseEntityCall = null;
19+
public EntityCellEntityCall_AccountBase cellEntityCall = null;
20+
21+
public UInt64 lastSelCharacter = 0;
22+
public virtual void onLastSelCharacterChanged(UInt64 oldValue) {}
23+
24+
public abstract void onCreateAvatarResult(Byte arg1, AVATAR_INFOS arg2);
25+
public abstract void onRemoveAvatar(UInt64 arg1);
26+
public abstract void onReqAvatarList(AVATAR_INFOS_LIST arg1);
27+
28+
public override void onGetBase()
29+
{
30+
baseEntityCall = new EntityBaseEntityCall_AccountBase();
31+
baseEntityCall.id = id;
32+
baseEntityCall.className = className;
33+
}
34+
35+
public override void onGetCell()
36+
{
37+
cellEntityCall = new EntityCellEntityCall_AccountBase();
38+
cellEntityCall.id = id;
39+
cellEntityCall.className = className;
40+
}
41+
42+
public override void onLoseCell()
43+
{
44+
cellEntityCall = null;
45+
}
46+
47+
public override EntityCall getBaseEntityCall()
48+
{
49+
return baseEntityCall;
50+
}
51+
52+
public override EntityCall getCellEntityCall()
53+
{
54+
return cellEntityCall;
55+
}
56+
57+
public override void onRemoteMethodCall(Method method, MemoryStream stream)
58+
{
59+
switch(method.methodUtype)
60+
{
61+
case 10005:
62+
Byte onCreateAvatarResult_arg1 = stream.readUint8();
63+
AVATAR_INFOS onCreateAvatarResult_arg2 = ((DATATYPE_AVATAR_INFOS)method.args[1]).createFromStreamEx(stream);
64+
onCreateAvatarResult(onCreateAvatarResult_arg1, onCreateAvatarResult_arg2);
65+
break;
66+
case 3:
67+
UInt64 onRemoveAvatar_arg1 = stream.readUint64();
68+
onRemoveAvatar(onRemoveAvatar_arg1);
69+
break;
70+
case 10003:
71+
AVATAR_INFOS_LIST onReqAvatarList_arg1 = ((DATATYPE_AVATAR_INFOS_LIST)method.args[0]).createFromStreamEx(stream);
72+
onReqAvatarList(onReqAvatarList_arg1);
73+
break;
74+
default:
75+
break;
76+
};
77+
}
78+
79+
public override void onUpdatePropertys(Property prop, MemoryStream stream)
80+
{
81+
switch(prop.properUtype)
82+
{
83+
case 40001:
84+
Vector3 oldval_direction = direction;
85+
direction = stream.readVector3();
86+
87+
if(prop.isBase())
88+
{
89+
if(inited)
90+
onDirectionChanged(oldval_direction);
91+
}
92+
else
93+
{
94+
if(inWorld)
95+
onDirectionChanged(oldval_direction);
96+
}
97+
98+
break;
99+
case 2:
100+
UInt64 oldval_lastSelCharacter = lastSelCharacter;
101+
lastSelCharacter = stream.readUint64();
102+
103+
if(prop.isBase())
104+
{
105+
if(inited)
106+
onLastSelCharacterChanged(oldval_lastSelCharacter);
107+
}
108+
else
109+
{
110+
if(inWorld)
111+
onLastSelCharacterChanged(oldval_lastSelCharacter);
112+
}
113+
114+
break;
115+
case 40000:
116+
Vector3 oldval_position = position;
117+
position = stream.readVector3();
118+
119+
if(prop.isBase())
120+
{
121+
if(inited)
122+
onPositionChanged(oldval_position);
123+
}
124+
else
125+
{
126+
if(inWorld)
127+
onPositionChanged(oldval_position);
128+
}
129+
130+
break;
131+
case 40002:
132+
stream.readUint32();
133+
break;
134+
default:
135+
break;
136+
};
137+
}
138+
139+
public override void callPropertysSetMethods()
140+
{
141+
ScriptModule sm = EntityDef.moduledefs[className];
142+
Dictionary<UInt16, Property> pdatas = sm.idpropertys;
143+
144+
Vector3 oldval_direction = direction;
145+
Property prop_direction = pdatas[1];
146+
if(prop_direction.isBase())
147+
{
148+
if(inited && !inWorld)
149+
onDirectionChanged(oldval_direction);
150+
}
151+
else
152+
{
153+
if(inWorld)
154+
{
155+
if(prop_direction.isOwnerOnly() && !isPlayer())
156+
{
157+
}
158+
else
159+
{
160+
onDirectionChanged(oldval_direction);
161+
}
162+
}
163+
}
164+
165+
UInt64 oldval_lastSelCharacter = lastSelCharacter;
166+
Property prop_lastSelCharacter = pdatas[3];
167+
if(prop_lastSelCharacter.isBase())
168+
{
169+
if(inited && !inWorld)
170+
onLastSelCharacterChanged(oldval_lastSelCharacter);
171+
}
172+
else
173+
{
174+
if(inWorld)
175+
{
176+
if(prop_lastSelCharacter.isOwnerOnly() && !isPlayer())
177+
{
178+
}
179+
else
180+
{
181+
onLastSelCharacterChanged(oldval_lastSelCharacter);
182+
}
183+
}
184+
}
185+
186+
Vector3 oldval_position = position;
187+
Property prop_position = pdatas[0];
188+
if(prop_position.isBase())
189+
{
190+
if(inited && !inWorld)
191+
onPositionChanged(oldval_position);
192+
}
193+
else
194+
{
195+
if(inWorld)
196+
{
197+
if(prop_position.isOwnerOnly() && !isPlayer())
198+
{
199+
}
200+
else
201+
{
202+
onPositionChanged(oldval_position);
203+
}
204+
}
205+
}
206+
207+
}
208+
}
209+
}

0 commit comments

Comments
 (0)