Beispiel #1
0
 void Update()
 {
     if (scaleParticles)
     {
         GameObjectScaler.Scale(this.gameObject, 0.9f);
     }
 }
Beispiel #2
0
    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;
    }