private void SetUI() { GameObject go = NDLoad.LoadWndItem("TrapViewItem", MyHead.trap); if (go != null) { TrapViewItem item = go.GetComponent <TrapViewItem>(); if (item != null) { item.SetBuildInfo(m_build, null, TrapState.Exit, 2); } } sdata.s_itemtypeInfo info = ItemM.GetItemInfo(m_build.fragmentTypeID); if (info != null) { NGUIUtil.Set2DSprite(MyHead.Spr2DItem, "Textures/item/" + info.icon); } else { NGUIUtil.DebugLog("m_build.fragmentTypeID =" + m_build.fragmentTypeID + "not found!"); } NGUIUtil.SetLableText(MyHead.LblItemNum, m_FragmentNum); NGUIUtil.SetLableText(MyHead.LblWoodNum, m_wood); NGUIUtil.SetLableText(MyHead.LblGoldNum, m_coin); }
/// <summary> /// 创建已召唤炮弹兵 /// </summary> private void CreateTrap(List <BuildInfo> BuildList, TrapState trapState) { if (trapState == TrapState.Exit) { m_canShengji = null; } if (BuildList == null || BuildList.Count == 0) { return; } if (MyHead.Parent == null) { NGUIUtil.DebugLog("ShipCanvasDialogWnd ListParent!!!"); return; } if (trapState == TrapState.CanNotSum) { CreateBanner(); } PdbbbItem pbbItem = null; int count = 0; for (int i = 0; i < BuildList.Count; i++) { if (count % 4 == 0) { pbbItem = null; GameObject go = NDLoad.LoadWndItem("PdbbbItem", MyHead.Parent.transform); pbbItem = go.GetComponent <PdbbbItem>(); } count++; if (pbbItem != null && pbbItem.MyHead.Table != null) { GameObject viewgo = NDLoad.LoadWndItem("TrapViewItem", pbbItem.MyHead.Table.transform); if (viewgo != null) { TrapViewItem item = viewgo.GetComponent <TrapViewItem>(); if (item != null) { item.SetBuildInfo(BuildList[i], this, trapState); if (null == m_canShengji && trapState == TrapState.Exit) { CanLevelResult LevResult = buildingM.GetLevelCanUP(BuildList[i]); if (LevResult == CanLevelResult.CanUp) { m_canShengji = item; } } } } } } }