Exemple #1
0
    //Dictionary<int, EquipData> edDic = new Dictionary<int, EquipData>();

    //ItemEquip item;

    //List<BackpackEquipVO> list = new List<BackpackEquipVO>();

    //Dictionary<int, BackpackEquipVO> equipDic = new Dictionary<int, BackpackEquipVO>();

    //Dictionary<int, BackpackEquipVO> allDic = new Dictionary<int, BackpackEquipVO>();

    //List<HeroDataVO> equipList = new List<HeroDataVO>();

    //string[] equipS;                                    //装备ID
    //int site;                                           //装备位
    #endregion

    void Awake()
    {
        instance = this;
        for (int i = 1; i <= 6; i++)
        {
            equip.Add(transform.FindChild("Equip" + i).GetComponent <ItemEquip>());
            itemEquipDicI.Add(i, transform.FindChild("Equip" + i).GetComponent <ItemEquip>());    //取装备位置
        }

        obj    = new object[FSDataNodeTable <HeroAttrNode> .GetSingleton().DataNodeList.Count];
        objDic = FSDataNodeTable <HeroAttrNode> .GetSingleton().DataNodeList;

        int index = 0;

        foreach (object hn in objDic.Values)
        {
            if (index < obj.Length)
            {
                obj[index] = hn;
                index++;
            }
        }

        for (int i = 0; i < obj.Length; i++)
        {
            HeroAttrNode herodata = (HeroAttrNode)obj[i];
            if (!herodataDic.ContainsKey(herodata.id))
            {
                herodataDic.Add(herodata.id, herodata);
            }
            equipAllList.Add(herodata);
        }
        jinjieEffect = transform.Find("UI_YXJJ_01");
    }
Exemple #2
0
        public void OnEquipmentClick()
        {
            UMengPlugin.UMengEvent(EventId.HOME_EQUIP,
                                   new Dictionary <string, object> {
                { "level", CommonData.MyUser.Level }
            });

            EquipPanel.Load();
        }
    public void Equip()
    {
        if (currentSlot == ItemSlot.Body)
        {
            GameObject EquipPanel = GameObject.FindGameObjectWithTag("Body");
            AttributeMatching(EquipPanel);
        }

        if (currentSlot == ItemSlot.Head)
        {
            GameObject EquipPanel = GameObject.FindGameObjectWithTag("Head");
            AttributeMatching(EquipPanel);
        }

        if (currentSlot == ItemSlot.Feet)
        {
            GameObject EquipPanel = GameObject.FindGameObjectWithTag("Feet");
            AttributeMatching(EquipPanel);
        }
        if (currentSlot == ItemSlot.Weapon)
        {
            GameObject EquipPanel;



            Attributes CurrentAttribute1 = WeaponSlot1.GetComponent <Attributes>();
            Attributes CurrentAttribute2 = WeaponSlot2.GetComponent <Attributes>();
            if (CurrentAttribute1.item_name == NewValue.item_name)
            {
                ResettingAttribute(CurrentAttribute1);
                ImageAssignation(CurrentAttribute1.Newicon, WeaponSlot1);
            }
            else if (CurrentAttribute2.item_name == NewValue.item_name)
            {
                ResettingAttribute(CurrentAttribute2);
                ImageAssignation(CurrentAttribute2.Newicon, WeaponSlot2);
            }
            else
            {
                if (WeaponSlot)
                {
                    EquipPanel = WeaponSlot1;
                    WeaponSlot = false;
                }
                else
                {
                    EquipPanel = WeaponSlot2;

                    WeaponSlot = true;
                }
                Attributes CurrentAttribute = EquipPanel.GetComponent <Attributes>();
                NewAttribute(CurrentAttribute, NewValue);

                ImageAssignation(CurrentAttribute.Newicon, EquipPanel);
            }
        }
    }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            EquipPanel tmp1 = new EquipPanel();

            tmp1.setSize(8, 4);

            string sql = string.Format("update character set Inventory=0x{0}{1}{2}{3}{4}{5}{6} where Name='{7}'", charPanel1.getEquipCodes(), equipPanel1.getEquipCodes(), equipPanel2.getEquipCodes(), equipPanel3.getEquipCodes(), tmp1.getEquipCodes(), tmp1.getEquipCodes(), equipPanel4.getEquipCodes(), CharName);

            DBLite.dbMu.Exec(sql);
            DBLite.dbMu.Close();
            MessageBox.Show("Inventory Edited", "Titan Editor", MessageBoxButtons.OK);
            Close();
        }
Exemple #5
0
    private void Awake()
    {
        Menu menu = FindObjectOfType <Menu>();

        _inventory  = menu.inventory;
        _parameters = menu.parameters;

        ShopPanel shopPanel = GetComponentInParent <ShopPanel>();

        _moneyAmountText = shopPanel.moneyText;

        ShopTabContent shopTabContent = GetComponentInParent <ShopTabContent>();

        _equipPanel = shopTabContent.equipPanel;
    }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        PlayerInfo.Coins = 500;

        PlayerInfo.Equipments = new Equipments();

        Equipments = PlayerInfo.Equipments;

        var index = 0;

        FieldInfo[] fields = typeof(Equipments).GetFields();

        foreach (var field in fields)
        {
            if (field.FieldType == typeof(Equipment))
            {
                Equipment equip = (Equipment)field.GetValue(Equipments);

                GameObject equipPanelPrefab = Instantiate(EquipPanelPrefab);
                equipPanelPrefab.transform.SetParent(Parent.transform);
                equipPanelPrefab.transform.localPosition = new Vector3(0, (index + 1) * -200, 0);

                EquipPanel equipPanel = equipPanelPrefab.GetComponent <EquipPanel>();
                equipPanel.DefineEquipment(equip);
                equipPanel.AfterButtonClick = AfterPanelButtonClick;
                Panels.Add(equipPanel);
            }
            index++;
        }

        var attr = PlayerInfo.AttributePoints;

        AirText.text    = attr.Air.ToString();
        FireText.text   = attr.Fire.ToString();
        LightText.text  = attr.Light.ToString();
        WaterText.text  = attr.Water.ToString();
        EarthText.text  = attr.Earth.ToString();
        HearthText.text = attr.Health.ToString();
        CoinText.text   = PlayerInfo.Coins.ToString();
    }
Exemple #7
0
 public void OnEquipClick()
 {
     EquipPanel.Load();
 }
Exemple #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            EquipPanel tmp1 = new EquipPanel();
            tmp1.setSize(8, 4);

            string sql = string.Format("update character set Inventory=0x{0}{1}{2}{3}{4}{5}{6} where Name='{7}'", charPanel1.getEquipCodes(), equipPanel1.getEquipCodes(), equipPanel2.getEquipCodes(), equipPanel3.getEquipCodes(), tmp1.getEquipCodes(), tmp1.getEquipCodes(), equipPanel4.getEquipCodes(), CharName);
            DBLite.dbMu.Exec(sql);
            DBLite.dbMu.Close();
            MessageBox.Show("Inventory Edited", "Titan Editor", MessageBoxButtons.OK);
            Close();
        }
Exemple #9
0
    public void Equip()
    {
        EquipPanel parent = transform.parent.GetComponent <EquipPanel>();

        parent.itemSlotGroup.Equip(item);
    }