void Update() { if (scaleParticles) { GameObjectScaler.Scale(this.gameObject, 0.9f); } }
private void OnTimeFunction(float f) { if (!this.item_box.GetChild("tag_scale").visible) { this.item_box.GetChild("tag_scale").visible = true; GameObjectScaler.ScaleParticles(this.item_go, 3f); } this.item_box.GetChild("n1").visible = true; this.item_box.GetChild("n4").visible = true; // this.item_box.GetChild("n1").y = posY + 110; //this.item_box.GetChild("n1").x = Tools.offectSetX(80); OnFunOverHandler(f); }
public GameObject addEffect(string res, Vector2D position, float scale = 1) { GameObject go = ResFactory.getCacheEffect(res, this.clientRunTime); if (null == go) { MediatorSystem.log("effectLost", res); Debug.Log("没有资源" + res); return(go); } go.transform.SetParent(this.effectLayer, false); go.transform.localPosition = ViewUtils.logicToScene(position, this.clientRunTime.mapData.earthRadius, this.clientRunTime.mapData); Vector3 v = new Vector3(this.transform.position.x, go.transform.position.y, this.transform.position.z); go.transform.LookAt(v); if (1 != scale) { GameObjectScaler.Scale(go, scale); } return(go); }
private void List_Render1(int _index, GObject go) { GGraph btn_get = go.asCom.GetChild("n10").asGraph; int index = _index - 1; if (_index == 0 || _index == list1.numItems - 1) { go.width = 10; go.alpha = 0; return; } else { go.width = 190; go.alpha = 1; } go.name = index + ""; GButton btn = go.asButton; btn.RemoveEventListeners(); btn.onClick.Add(() => { if (index == (listData.Keys.Count - 1) && haveSuo != 0) { ViewManager.inst.ShowText(Tools.GetMessageById("17014", new string[] { Tools.GetEffortName(index) })); } else { this.onListItemClick(index); } }); GLoader img_coin = go.asCom.GetChild("n6").asLoader; GTextField l_coin = go.asCom.GetChild("n7").asTextField; GTextField l_time = go.asCom.GetChild("n2").asTextField; GTextField l_level = go.asCom.GetChild("n4").asTextField; GImage img2 = go.asCom.GetChild("n1").asImage; // GLoader l_imag = go.asCom.GetChild ("n9").asLoader; btn.enabled = true; btn_get.visible = false; GameObject asd; if (index == 0) { item0 = go.asCom; Time_Tick(0f); // l_imag.url = Tools.GetResourceUrl ("Image:bg_baoxiang"); Dictionary <string, object> cfg1 = (Dictionary <string, object>)cfg ["daily_box"]; img_coin.url = Tools.GetResourceUrl("Image2:n_icon_xm"); l_level.text = Tools.GetMessageById(cfg1 ["name"].ToString()); if (LocalStore.GetLocal(LocalStore.LOCAL_SHOPRED) == "1") { ModelManager.inst.userModel.Add_Notice(go.asCom, new Vector2(155, 5)); } else { ModelManager.inst.userModel.Remove_Notice(go.asCom); } object[] price = (object[])cfg1 ["price"]; int len = price.GetLength(0) - 3; int axb = ((int)price [len + 1]) * (int)user ["num"] + ((int)price [len + 2]); int pri = (int)user ["num"] > len ? axb : (int)price [(int)user ["num"]]; l_coin.text = pri + ""; // img_coin.y = 363; // img_coin.x = 69; img2.visible = true; go.asCom.GetChild("n13").visible = true; asd = EffectManager.inst.AddEffect(Tools.GetExploreBoxID(cfg1 ["picture"].ToString()), "stand", btn_get); GameObjectScaler.Scale(asd, 0.7f); // asd.transform.localScale *= 0.7f; } else { Dictionary <string, object> dic = (Dictionary <string, object>)listData [index + ""]; if (index == (listData.Keys.Count - 1) && haveSuo != 0) { go.grayed = true; btn_get.grayed = true; asd = EffectManager.inst.AddEffect(Tools.GetEggName(dic ["picture"].ToString()), "end", btn_get, null, true); EffectManager.inst.SetShaderSaturation(asd, -1); GameObjectScaler.ScaleParticles(asd, 0); EffectManager.inst.StopAnimation(asd); // Tools.StopAnimation (asd); } else { asd = EffectManager.inst.AddEffect(Tools.GetEggName(dic ["picture"].ToString()), "stand", btn_get); } // l_imag.url = Tools.GetResourceUrl ("Image:bg_baoxiang2"); img_coin.url = Tools.GetResourceUrl("Image2:n_icon_zs"); // img_coin.y = 363 - 25; // img_coin.x = 69 - 50; l_coin.text = (int)dic ["price"] + ""; l_time.text = ""; img2.visible = false; go.asCom.GetChild("n13").visible = false; l_level.text = Tools.GetMessageById(dic ["name"].ToString()); } GoWrapperCheck goc = go.displayObject.gameObject.AddComponent <GoWrapperCheck>(); goc.setItem(go, Tools.offectSetX(160f), Tools.offectSetX(160f + 720f), asd, GRoot.inst.scale.x); btn_get.visible = true; }
private void Get_Red(VoHttp vo) { Dictionary <string, object> data = (Dictionary <string, object>)vo.data; object[] da = data["res"] as object[]; reData = da; l_num.text = da.Length.ToString(); mc = new GameObject[da.Length]; for (int i = (da.GetLength(0) - 1); i >= 0; i--) { item_box = Tools.GetComponent(Config.RED_PEOPLE).asCom; item_box.GetChild("tag_scale").visible = false; this.item_box.GetChild("n1").visible = false; this.item_box.GetChild("n4").visible = false; item_go = EffectManager.inst.AddEffect(Config.EFFECT_GIFT, "stand", item_box.GetChild("n2").asGraph); GameObjectScaler.ScaleParticles(item_go, 0.3f); Dictionary <string, object> js = (Dictionary <string, object>)da [i]; //EffectManager.inst.StopAnimation (mc [i]); GTextField l = item_box.GetChild("n1").asTextField; GButton head = item_box.GetChild("n4").asCom.GetChild("n0").asButton; String dc_ = (string)js["head_use"]; if (js["uid"].ToString().StartsWith("bot")) { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_, false, true)); } else { Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(dc_)); } //l.visible = false; if (js ["uname"] != null) { //l.text = Tools.GetMessageById("12010",new string[] {js["uname"].ToString() }); l.text = js["uname"].ToString(); } else { // l.text = Tools.GetMessageById("12010", new string[] { js["uid"].ToString() }); l.text = js["uid"].ToString(); } //Debug.LogError("uname " + js["uname"].ToString()); // Debug.LogError("head_use " + js["head_use"].ToString()+" || "+"uid "+js["uid"].ToString()); //item.GetChild ("n2").asGraph.rotation = UnityEngine.Random.Range (-10f, 10f); mc[i] = item_go; aa[i] = item_box; item_box.SetPivot(0.5f, 0.5f); this.AddChild(item_box); item_box.scale = new Vector2(0.3f, 0.3f); // float half = Convert.ToSingle(da.GetLength(0)) / 2f + 0.5f; half = half - (i + 1); // item.x = Tools.offectSetX (((float)-half * 165f) + 430); //item.GetChild ("n1").y = 100; // item.y = i%2f * 30f + 100f; item_box.x = Tools.offectSetX(((float)i * 80) - 160f + 250f); item_box.y = i % 2f * 30f + 100f; // if (i == 0) { // item.x = -100; // item.y = -100; // } // item.TweenMove (new Vector2 (Tools.offectSetX (((float)i * 90) - 150f + 250f), i%2f * 30f + 100f), 0f); } // for (int j = (da.GetLength (0) - 1);j>=0;j--) { // float half = Convert.ToSingle (da.GetLength (0)) / 2f + 0.5f; // half = half - (j + 1); // aa [j].TweenScale (new Vector2 (0.5f, 0.5f), 0.5f); // GameObjectScaler.ScaleParticles ((aa [j]).displayObject.gameObject, 0.3f); // aa [j].TweenMove (new Vector2 (Tools.offectSetX (((float)j * 90) - 150f + 250f), j%2f * 30f + 100f), 0.5f); // } // step1 = false; step2 = false; // this.SetChildIndex(img_num, this.numChildren - 1); this.SetChildIndex(l_num, this.numChildren - 1); reData1 = DataChuLione((Dictionary <string, object>)((Dictionary <string, object>)reData [reNumIndex]) ["gifts_dict"]); len = reData1.Count - 1; // this.item_go = mc [reNumIndex]; this.item_box = aa [reNumIndex]; // ClickBtn.onClick.Add(Mask_Click); // OverFun(1); }