static public void play1(String id, Vector3 pos, int num, bool criatk = false, int type = -1) { if (offsetPos == null) { offsetPos = new List <Vector3>(); Vector3 v; for (int i = 0; i < 20; i++) { v = new Vector3(ConfigUtil.getRandom(-30, 30), ConfigUtil.getRandom(-30, 10), 0); offsetPos.Add(v); } } if (instacne == null) { instacne = GameObject.Find("fightText").transform; process = new TickItem(onUpdate); TickMgr.instance.addTick(process); mousePointCon = GameObject.Find("mouseTouchAni").transform; InterfaceMgr.setUntouchable(mousePointCon.gameObject); } GameObject root; FightTextTempSC sc; GameObject commonUIPrefab = GAMEAPI.ABUI_LoadPrefab(id); root = GameObject.Instantiate(commonUIPrefab) as GameObject; if (type != -1) { Sprite icon_Image = GAMEAPI.ABUI_LoadSprite("icon_rune_fight_" + type); if (icon_Image != null) { root.transform.FindChild("Text/Image").GetComponent <Image>().sprite = icon_Image; } } sc = root.GetComponent <FightTextTempSC>(); if (sc == null) { sc = root.AddComponent <FightTextTempSC>(); } if (id == MOUSE_POINT || id == MISS_TEXT) { // root.transform.SetParent(mousePointCon, false); root.transform.SetParent(instacne, false); sc.init(FightTextTempSC.TYPE_ANI); } else { root.transform.SetParent(instacne, false); sc.init(FightTextTempSC.TYPE_TEXT); } sc.play(pos + (id == MOUSE_POINT ? Vector3.zero : offsetPos[posIdx]), num, criatk); posIdx++; if (posIdx >= 20) { posIdx = 0; } }
private void onItemCardInfo(Variant d) { bool flag = d.ContainsKey("tp"); if (flag) { HttpAppMgr.instance.onGetRewardItems(d["tp"]); } else { bool flag2 = d.ContainsKey("tpchange"); if (flag2) { int random = ConfigUtil.getRandom(0, 20); DelayDoManager.singleton.AddDelayDo(delegate { this.sendLoadItemCardInfo(null); }, random, 0u); debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + random); } else { bool flag3 = d.ContainsKey("card_fetch"); if (flag3) { Variant variant = d["card_fetch"]; int num = variant["tp"]; string text = variant["cardid"]; Variant variant2 = variant["reward"]; bool flag4 = variant2.ContainsKey("money"); if (flag4) { flytxt.instance.fly("金币+ " + variant2["money"], 0, default(Color), null); } bool flag5 = variant2.ContainsKey("yb"); if (flag5) { flytxt.instance.fly("钻石+ " + variant2["yb"], 0, default(Color), null); } bool flag6 = variant2.ContainsKey("bndyb"); if (flag6) { flytxt.instance.fly("绑定钻石+ " + variant2["bndyb"], 0, default(Color), null); } bool flag7 = variant2.ContainsKey("itm"); if (flag7) { List <Variant> arr = variant2["itm"]._arr; for (int i = 0; i < arr.Count; i++) { a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(arr[i]["tpid"]); string colorStrByQuality = Globle.getColorStrByQuality(itemDataById.item_name, itemDataById.quality); flytxt.instance.fly("获得" + colorStrByQuality + "+" + arr[i]["cnt"], 0, default(Color), null); } } } bool flag8 = d.ContainsKey("cards"); if (flag8) { List <Variant> arr2 = d["cards"]._arr; for (int j = 0; j < arr2.Count; j++) { int num2 = arr2[j]["tp"]; string text2 = arr2[j]["cardid"]; bool flag9 = num2 == 4; if (flag9) { } } } bool flag10 = d.ContainsKey("tpawds"); if (flag10) { List <Variant> arr3 = d["tpawds"]._arr; for (int k = 0; k < arr3.Count; k++) { GiftCardType giftCardType = new GiftCardType(); giftCardType.init(arr3[k]); HttpAppMgr.instance.giftCard.addGiftType(giftCardType); } } HttpAppMgr.instance.giftCard.getAllCode(); } } }
private void onItemCardInfo(Variant d) { if (d.ContainsKey("tp"))//兑换完奖励 { HttpAppMgr.instance.onGetRewardItems(d["tp"]); return; } if (d.ContainsKey("tpchange"))//兑换码变化 { int sec = ConfigUtil.getRandom(0, 20); DelayDoManager.singleton.AddDelayDo(() => { sendLoadItemCardInfo(); }, sec); debug.Log("兑换码后台发生变!!!间隔发送请求礼品卡:" + sec); return; } if (d.ContainsKey("card_fetch")) { Variant card_fetch = d["card_fetch"]; int tp = card_fetch["tp"]; string cardid = card_fetch["cardid"]; Variant reward = card_fetch["reward"]; if (reward.ContainsKey("money")) { flytxt.instance.fly(ContMgr.getCont("comm_moneyadd") + reward["money"]); } if (reward.ContainsKey("yb")) { flytxt.instance.fly(ContMgr.getCont("comm_zuanshiadd") + reward["yb"]); } if (reward.ContainsKey("bndyb")) { flytxt.instance.fly(ContMgr.getCont("comm_bangzuanadd") + reward["bndyb"]); } if (reward.ContainsKey("itm")) { List <Variant> tpawds = reward["itm"]._arr; for (int i = 0; i < tpawds.Count; i++) { a3_ItemData one = a3_BagModel.getInstance().getItemDataById(tpawds[i]["tpid"]); string name = Globle.getColorStrByQuality(one.item_name, one.quality); flytxt.instance.fly(ContMgr.getCont("comm_get") + name + "+" + tpawds[i]["cnt"]); } } } //if (d.ContainsKey("fetched_cards")) //{ // Variant fetched_cards = d["fetched_cards"]; // int tp = fetched_cards["tp"]; // int tm = fetched_cards["tm"];//时间戳 //} if (d.ContainsKey("cards")) { List <Variant> cardsa = d["cards"]._arr; for (int i = 0; i < cardsa.Count; i++) { int tpa = cardsa[i]["tp"]; string cardida = cardsa[i]["cardid"]; if (tpa == 4) {//补偿卡礼包通过邮件领取 } } } if (d.ContainsKey("tpawds")) { List <Variant> tpawds = d["tpawds"]._arr; for (int i = 0; i < tpawds.Count; i++) { GiftCardType giftType = new GiftCardType(); giftType.init(tpawds[i]); HttpAppMgr.instance.giftCard.addGiftType(giftType); } } HttpAppMgr.instance.giftCard.getAllCode(); //if (d.ContainsKey("tpawds")) //{ // List<Variant> l = d["tpawds"]; // for (int i = 0; i < l.Count; i++) // { // } //} }
public static void play1(string id, Vector3 pos, int num, bool criatk = false, int type = -1) { bool flag = FightText.offsetPos == null; if (flag) { FightText.offsetPos = new List <Vector3>(); for (int i = 0; i < 20; i++) { Vector3 item = new Vector3((float)ConfigUtil.getRandom(-30, 30), (float)ConfigUtil.getRandom(-30, 10), 0f); FightText.offsetPos.Add(item); } } bool flag2 = FightText.instacne == null; if (flag2) { FightText.instacne = GameObject.Find("fightText").transform; FightText.process = new TickItem(new Action <float>(FightText.onUpdate)); TickMgr.instance.addTick(FightText.process); FightText.mousePointCon = GameObject.Find("mouseTouchAni").transform; InterfaceMgr.setUntouchable(FightText.mousePointCon.gameObject); } GameObject original = Resources.Load(id) as GameObject; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(original); bool flag3 = type != -1; if (flag3) { Sprite sprite = Resources.Load("icon/rune_fight/" + type, typeof(Sprite)) as Sprite; bool flag4 = sprite != null; if (flag4) { gameObject.transform.FindChild("Text/Image").GetComponent <Image>().sprite = sprite; } } FightTextTempSC fightTextTempSC = gameObject.GetComponent <FightTextTempSC>(); bool flag5 = fightTextTempSC == null; if (flag5) { fightTextTempSC = gameObject.AddComponent <FightTextTempSC>(); } bool flag6 = id == FightText.MOUSE_POINT || id == FightText.MISS_TEXT; if (flag6) { gameObject.transform.SetParent(FightText.instacne, false); fightTextTempSC.init(FightTextTempSC.TYPE_ANI); } else { gameObject.transform.SetParent(FightText.instacne, false); fightTextTempSC.init(FightTextTempSC.TYPE_TEXT); } fightTextTempSC.play(pos + ((id == FightText.MOUSE_POINT) ? Vector3.zero : FightText.offsetPos[FightText.posIdx]), num, criatk); FightText.posIdx++; bool flag7 = FightText.posIdx >= 20; if (flag7) { FightText.posIdx = 0; } }