static FunHelper() { Task.Factory.StartNew(() => { while (true) { Action a; ActionQueue.TryDequeue(out a); a?.Invoke(); if (a == null) { Thread.Sleep(1); } } }); Task.Factory.StartNew(() => { while (true) { Func <string> f; FunQueue.TryDequeue(out f); f?.Invoke(); if (f == null) { Thread.Sleep(1); } } }); }
// private bool isBegin = false; public override void Init() { this.Create(Config.VIEW_ROLEPHOTO); #if UNITY_IOS HEAD_WH = 256; #endif initQueue = new FunQueue(); FindeObject(); InitDate(); }
public override void Init() { base.Init(); Create(Config.SCENE_FIGTHTBOX); userModel = ModelManager.inst.userModel; roleModel = ModelManager.inst.roleModel; fightModel = ModelManager.inst.fightModel; initQueue = new FunQueue(); viewFight = this.GetChild("n0").asCom; viewFight.scale = new Vector2(0.8f, 0.8f); rankScore = viewFight.GetChild("n2").asCom; openTitle = viewFight.GetChild("n3").asTextField; rankImg = this.GetChild("n2").asLoader; mask = this.GetChild("n1").asGraph; g1 = this.GetChild("n5").asGraph; g2 = this.GetChild("n3").asGraph; g3 = this.GetChild("n4").asGraph; g4 = this.GetChild("n7").asGraph; g5 = this.GetChild("n10").asGraph; g6 = this.GetChild("n37").asGraph; AddGlobalListener(MainEvent.EXPLORE_GIFT, OpenView); openTitle.text = Tools.GetMessageById("24209"); rankScoreBg = rankScore.GetChild("n1").asLoader; rankScoreValue = rankScore.GetChild("n2").asTextField; addRankScore = viewFight.GetChild("n4").asTextField; tip = this.GetChild("n8").asTextField; mvp = this.GetChild("n9").asCom; //mvp.GetChild("n4").asTextField.text = Tools.GetMessageById("24223"); GLoader mvp_ = mvp.GetChild("n1").asLoader; Tools.GetResourceUrlForMVP(mvp_, "mvp"); mvp.visible = false; //effectType1 = Config.EFFECT_LOSE; //animateType1 = "mvp"; //animateDir1 = "los/lose_"; //animateType1_go = EffectManager.inst.AddEffect(effectType1, animateType1, g1, null, false, 75, animateDir1); //GameObject go = Tools.GetPrefab("Effect/" + effectType1); //GameObject go1 = go.transform.Find(animateDir1 + "/pPlane11" + "/pPlane12").gameObject; //GameObject go2 = go1.transform.Find("text").gameObject; //GTextField text = new GTextField(); //text.x = go2.transform.position.x; //text.y = go2.transform.position.y; //text.text = "mvp"; //go2.AddComponent<MeshFilter>(); //go2.AddComponent<MeshRenderer>(); //view.AddChild(text); //rankScoreBg = rankScore.GetChild("n1").asLoader; //rankScoreValue = rankScore.GetChild("n2").asTextField; //addRankScore = viewFight.GetChild("n4").asTextField; //rankScoreValue.text = "0"; //rankScoreStart = 150; //rankScoreEnd = 50 /*(int)info["rank_score"]*/; //num = Math.Abs(rankScoreStart - rankScoreEnd); //addRankScore.text = "+" + 100; //rankScoreBg.url = userModel.GetRankImg(rankScoreStart); //rankImg.url = userModel.GetRankImg(rankScoreStart); //rankScoreValue.text = "100"; //switch (isRankUp(rankScoreEnd)) //{ // case 0: // addRankScore.text = "+" + num; // break; // case 1: // addRankScore.text = "-" + num; // break; //} //effectType1 = Config.EFFECT_WIN; //animateType1 = null; //animateDir1 = null; //isMvp = true; //rewardName = "Bag102/bag102"; //effectType2 = "Bag102/bag102"; //animateType2 = "102"; //animateDir2 = null; //initQueue.Init(new List<Action> { // Effect1, // Effect2, // Effect3, // Effect4, // Effect5, // Effect6 //}); InitData(); }