Ejemplo n.º 1
0
    void AssetLoadCallBack(GameObject ro, ParamData data)
    {
        if (role != null)
        {
            Destroy(role);
            role = null;
        }

        role = ro;
        ro.transform.parent = Mpos;
        float zoom = EntityAssetsData.GetData(ChallengeData.GetData((int)curId).assetsID_).zoom_;

        ro.transform.localPosition = Vector3.forward * -300f;
        ro.transform.localScale    = new Vector3(zoom, zoom, zoom);
        ro.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
        //EffectLevel el =ro.AddComponent<EffectLevel>();
        //el.target =ro.transform.parent.parent.GetComponent<UISprite>();
    }
Ejemplo n.º 2
0
    private void UpdateChallengeInfo(uint id)
    {
        if (hundredSystem.instance.ChallengeNum <= 1)
        {
            resetBtn.isEnabled = false;
        }
        else
        {
            resetBtn.isEnabled = true;
        }
        ChallengeData cData = ChallengeData.GetData((int)id);         //hundredSystem.instance.ChallengeNum);

        if (cData == null)
        {
            return;
        }
        nameLab.text    = LanguageManager.instance.GetValue("hundrednum").Replace("{n}", id.ToString());
        surplusLab.text = hundredSystem.instance.UseNum.ToString() + "/1";

        if (hundredSystem.instance.ResetNum == 0)
        {
            resetBtn.isEnabled = false;
        }
        //int num = EntityAssetsData.GetData (cData.assetsID_).assetsName_;
        GameManager.Instance.GetActorClone((ENTITY_ID)cData.assetsID_, 0, EntityType.ET_Player, AssetLoadCallBack, new ParamData(0), "UI");

        foreach (GameObject c in cellList)
        {
            grid.RemoveChild(c.transform);
            c.transform.parent = null;
            c.gameObject.SetActive(false);
            cellPoolList.Add(c);
        }
        cellList.Clear();

        for (int i = 0; i < cData.reward_.Length; i++)
        {
            ItemData   item = ItemData.GetData(int.Parse(cData.reward_[i]));
            GameObject obj  = null;
            if (cellPoolList.Count > 0)
            {
                obj = cellPoolList[0];
                cellPoolList.Remove(obj);
            }
            else
            {
                obj = Object.Instantiate(itemCell) as GameObject;
            }

            ItemCellUI cellUI = UIManager.Instance.AddItemCellUI(obj.GetComponent <BagCellUI>().pane, (uint)item.id_);
            cellUI.showTips = true;
            obj.GetComponent <BagCellUI>().countLab.text = item.name_;
            //HeadIconLoader.Instance.LoadIcon(item.icon_,obj.GetComponent<BagCellUI>().itemIcon);
            //if (!iconName_.Contains(item.icon_))
            //  iconName_.Add(item.icon_);
            grid.AddChild(obj.transform);
            obj.SetActive(true);
            obj.transform.localScale = Vector3.one;
            cellList.Add(obj);
        }
    }