static void DropResourceBoxEffect(string name, sdata.s_itemtypeInfo item, Vector3 pos) { pos = BattleEnvironmentM.Local2WorldPos(pos); pos.x += 0.5f; pos.z = 0; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); EffectCamera.AddFollowList(gae.transform, pos); if (gae != null) { //先等待 GameObjectActionBoxWait gaw = new GameObjectActionBoxWait(2f); gae.AddAction(gaw); //open box GameObjectActionOpenBox gaopen = new GameObjectActionOpenBox(2.0f, item); gae.AddAction(gaopen); Animator ani = gae.gameObject.GetComponent <Animator>(); if (null != ani) { int nValue = (int)Random.value % 2; if (nValue == 0) { nValue = 2; } ani.SetInteger("iState", nValue); } } }
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); }
void BtnGetSoulStone_OnClickEventHandler(UIButton sender) { sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(m_Info.fragmentTypeID);//当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, null, m_Info, 4); }
public static void Drop(sdata.s_itemtypeInfo item, Vector3 pos) { if (item != null) { DropResourceBoxEffect("box", item, pos); } }
void BtnClick_OnClickHander(UIButton sender) { // ItemComeFromWnd wnd = WndManager.GetDialog<ItemComeFromWnd>(); sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(m_itemType); //当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, null, null, 1); }
private void SetItemReward(stage.StageResource Res) { if (Res == null) { return; } if (Res.rewards == null || Res.rewards.Count == 0) { return; } if (MyHead.Rewardtable == null) { return; } Dictionary <int, int> l = new Dictionary <int, int>(); for (int i = 0; i < Res.rewards.Count; i++) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(Res.rewards[i].itemtypeid); if (Info == null) { continue; } if (l.ContainsKey(Res.rewards[i].itemtypeid) == false) { l.Add(Res.rewards[i].itemtypeid, Res.rewards[i].superpose); } else { l[Res.rewards[i].itemtypeid] = l[Res.rewards[i].itemtypeid] + Res.rewards[i].superpose; } } // foreach (int key in l.Keys) { GameObject go = NDLoad.LoadWndItem("RewardItem", MyHead.Rewardtable.transform); if (go != null) { RewardItem item = go.GetComponent <RewardItem>(); if (item != null) { item.SetRewardItem(key, l[key]); } } } MyHead.Rewardtable.enabled = true; MyHead.Rewardtable.Reposition(); }
public void SetInfo(int itemID) { m_stageClickType = StageClickType.Item; sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(itemID); if (Info != null) { TipID = itemID; Name = Info.name; Level = Info.level; Description = Info.title; Money = Info.money; HaveCount = ItemDC.GetItemCount(itemID); Quality = Info.quality; } }
public void BtnSelect_OnClickEventHandler(UIButton sender) { if (m_canExist == true) //可召唤但未召唤的炮弹兵 { SummonHeroWnd wnd = WndManager.GetDialog <SummonHeroWnd>(); if (wnd != null) { wnd.SetData(Info, null, 1); } } else //不可召唤的炮弹兵 目前不做处理 { sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(Info.fragmentTypeID); //当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, Info, null, 3); } }
public void GetTrophies(List <ItemInfo> rewards) { if (rewards != null) { for (int i = 0; i < rewards.Count; i++) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(rewards[i].mItemtypeid); if (Info == null) { continue; } if (Info.gtype == 1 || Info.gtype == 2 || Info.gtype == 3) { m_lRewardInfo.Add(Info); } } } }
public void GetTrophies(stage.StageResource Res) { if (Res != null && Res.rewards != null) { for (int i = 0; i < Res.rewards.Count; i++) { sdata.s_itemtypeInfo Info = ItemM.GetItemInfo(Res.rewards[i].itemtypeid); if (Info == null) { continue; } if (Info.gtype == 1 || Info.gtype == 2 || Info.gtype == 3) { m_lRewardInfo.Add(Info); } } } }
public void BtnSelect_OnClickEventHandler(UIButton sender) { if (myParent != null && m_ItemType == 1 && m_TrapState == TrapState.Exit) { TrapShowWnd wnd = WndManager.GetDialog <TrapShowWnd>(); wnd.SetBuildInfo(m_Info, myParent.m_Build); } else if (m_TrapState == TrapState.CanSum) { SummonHeroWnd wnd = WndManager.GetDialog <SummonHeroWnd>(); if (wnd != null) { wnd.SetData(null, m_Info, 2); } } else if (m_TrapState == TrapState.CanNotSum) { sdata.s_itemtypeInfo itemInfo = ItemM.GetItemInfo(m_Info.fragmentTypeID); //当前灵魂石 ItemComeFromWnd wnd = WndManager.GetDialog <ItemComeFromWnd>(); wnd.SetData(itemInfo, null, m_Info, 5); } }
public GameObjectActionOpenBox(float duration, sdata.s_itemtypeInfo item) { m_Duration = duration; if (item != null) { if (item.gtype == 0) { m_itemtype = StageClickType.Item; } else if (item.gtype == 1) { m_itemtype = StageClickType.Role; } else if (item.gtype == 2) { m_itemtype = StageClickType.Room; } else if (item.gtype == 3) { m_itemtype = StageClickType.Captain; } m_itemID = item.icon; } }
/// <summary> /// 显示首次获得黑科技表现 /// </summary> private void ShowTrophiesAction() { if (CurSummonCaptianID == 0) { return; } CaptionInfo cInfo = new CaptionInfo(); GodSkillM.GetCaption(CurSummonCaptianID, ref cInfo); GodSkillInfo gInfo = new GodSkillInfo(); //黑科技抽取是1级,王振鑫确认 GodSkillM.GetGodSkill(cInfo.m_godskilltype1, 1, ref gInfo); string name = ""; name = gInfo.m_name; sdata.s_itemtypeInfo itypeInfo = new sdata.s_itemtypeInfo(); itypeInfo.gid = CurSummonCaptianID; itypeInfo.name = name; itypeInfo.gtype = 3; List <sdata.s_itemtypeInfo> lInfo = new List <sdata.s_itemtypeInfo>(); lInfo.Add(itypeInfo); TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>(); if (TropWnd) { TropWnd.ClearTropiesData(); TropWnd.AddTropiesData(lInfo); TropWnd.SetWndType(3); TropWnd.MyHead.LblDes.gameObject.SetActive(false); } }