Esempio n. 1
0
    public void SetData(MercenaryWindow parent, HuaShanPVPData.MercenaryInfo data)
    {
        m_parent             = parent;
        LabelName.text       = data.name;
        LabelCost.text       = data.cost.ToString();
        LabelCombat.text     = data.combat.ToString();
        LabelProfession.text = Utils.GetProfessionNameByType((int)data.profession); //Utils.GetDicByID(CharacterDefine.PROFESSION_DICNUM[(int)data.profession]);
        LabelProfession.transform.FindChild("Sprite").GetComponent <UISprite>().spriteName = Utils.GetProfessionIcon(data.profession);
        UIToggleSel.value = false;

        switch (data.relationship)
        {
        case 0:
            LabelRelationShip.text = Utils.GetDicByID(1965);
            break;

        case 1:
            LabelRelationShip.text = Utils.GetDicByID(1966);
            break;

        case 2:
            LabelRelationShip.text = Utils.GetDicByID(1967);
            break;

        default:
            LabelRelationShip.text = "???";
            break;
        }


        m_data = data;
    }
Esempio n. 2
0
    public static void ShowMercenaryList(GC_MERCENARY_LIST_RES msg)
    {
        MercenaryList.Clear();

        HuaShanPVPData.MercenaryTimesLeft = msg.Lefttimes;
        //...
        for (int i = 0; i < msg.guidCount; i++)
        {
            MercenaryList.Add(new MercenaryInfo(
                                  msg.GetGuid(i), msg.GetName(i),
                                  msg.GetSource(i), msg.GetCost(i),
                                  msg.GetProfession(i), msg.GetCombat(i)));
        }

        if (MercenaryWindow.Instance() != null)
        {
            CallShowMercenaryList();
            CallShowMercenaryLeftTime();
        }
        else
        {
            UIManager.ShowUI(UIInfo.MercenaryWindowRoot, OnShowMercenaryMemberRoot);
        }
    }
Esempio n. 3
0
    public static MercenaryListItem CreateItem(GameObject grid, GameObject resItem, string name, MercenaryWindow parent, HuaShanPVPData.MercenaryInfo data)
    {
        GameObject curItem = Utils.BindObjToParent(resItem, grid, name);

        if (null != curItem)
        {
            MercenaryListItem curItemComponent = curItem.GetComponent <MercenaryListItem>();
            if (null != curItemComponent)
            {
                curItemComponent.SetData(parent, data);
            }

            return(curItemComponent);
        }

        return(null);
    }