1.在對應的文件def中添加方法類型與屬性
例如:在accounts.def中加入屬性playerName,與UserTest方法
<root>
<Properties>
<playerName>
<Type> UNICODE </Type>
<Flags> BASE </Flags>
<Persistent> true </Persistent>
<Index> UNIQUE </Index>
<Default> </Default>
</playerName>
</Properties>
<ClientMethods>
</ClientMethods>
<BaseMethods>
<UserTest>
<Exposed/>
</UserTest>
</BaseMethods>
<CellMethods>
</CellMethods>
</root>
聲明後再對應的Accounts.py文件中加入方法
def UserTest(self):
print("call success!");
2.找到服務端目錄中的Assets/gensdk.bat打開修改生成的目錄位置
注:此處使用的是unity的客戶端
3.執行gensdk之後就可以在客戶端調用該方法與該屬性