亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在C#里面怎樣操作lua的table數據類型

在C#里面怎樣操作lua的table數據類型

C#
嗶嗶one 2019-03-04 10:04:21
在C#里面怎樣操作lua的table數據類型
查看完整描述

2 回答

?
飲歌長嘯

TA貢獻1951條經驗 獲得超3個贊

LuaInterface.LuaTable ob = XLuaManager.Inst.Call("CombineDef.GetCombineItems", mItemType, mItemId)[0] as LuaInterface.LuaTable;

XTools.Log("**** --- {0}", ob.Values.Count); //ob.Values[0];
// IEnumerator itr = ob.Keys.GetEnumerator();
// while(itr.MoveNext())
// {
// //KeyValuePair<XSkillType, int> pair = (KeyValuePair<XSkillType, int>)itr.Current;
// string nnn = (string)itr.Current;
// XTools.Log("---{0}", nnn);
// }
IEnumerator itr = ob.Values.GetEnumerator();
int i = 0;
while(itr.MoveNext())
{
LuaInterface.LuaTable tb = itr.Current as LuaInterface.LuaTable;
IEnumerator it2 = tb.Values.GetEnumerator();
XTools.Log("=={0}---key{1}", tb.Values.Count, i);
int j = 0;
while (it2.MoveNext())
{
//KeyValuePair<int, int> pair = (KeyValuePair<int, int>)it2.Current;
XTools.Log("---{0},{1}--------key:{2}{3}", it2.Current.GetType().ToString(), (double)it2.Current, i, ++j);
}
i++;
}
LuaInterface.LuaTable ob = XLuaManager.Inst.Call("CombineDef.GetCombineItems", mItemType, mItemId)[0] as string;

lua定義結構體:
Npc.BubbleProperty =
{
Silence = { Weight = 200 }, -- 沉默
Task = { Weight = 50, nIndex = "Task" },
-- 普通泡泡
Normal = { Weight = 50, nIndex = "Normal" }, -- 任務泡泡
};

local tbPos =
{
[1] = { nX = nX,
nY = nY };
[2] = { nX = nX - nSpan,
nY = nY };
[3] = { nX = nX + nSpan,
nY = nY };
[4] = { nX = nX,
nY = nY - nSpan };
[5] = { nX = nX,
nY = nY + nSpan };
[6] = { nX = nX - nSpan,
nY = nY + nSpan };
[7] = { nX = nX + nSpan,
nY = nY + nSpan };
[8] = { nX = nX + nSpan,
nY = nY - nSpan };
[9] = { nX = nX - nSpan,
nY = nY - nSpan };
};



查看完整回答
反對 回復 2019-03-16
?
慕斯王

TA貢獻1864條經驗 獲得超2個贊

大約是這個樣子的
Table TB = new Table();
TableRow TR = new TableRow();
TableCell TC = new TableCell();
TR.Cells.Add(TC);
TB.Rows.Add(TR);

查看完整回答
反對 回復 2019-03-16
  • 2 回答
  • 0 關注
  • 1861 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號