예제 #1
0
    static protected int SortByDFM(UnityEngine.Transform a, UnityEngine.Transform b)
    {/* return string.Compare(a.name, b.name);*/
        int ranka = 0;
        int rankb = 0;

        if (a != null && b != null)
        {
            ItemClick ic = a.gameObject.GetComponent <ItemClick>();
            if (ic != null)
            {
                ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(ic.ID);
                if (itemconfig != null)
                {
                    //ranka = itemconfig.m_PropertyRank;
                    ranka = ic.fightScoreChange;
                }
            }
            ic = b.gameObject.GetComponent <ItemClick>();
            if (ic != null)
            {
                ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(ic.ID);
                if (itemconfig != null)
                {
                    //rankb = itemconfig.m_PropertyRank;
                    rankb = ic.fightScoreChange;
                }
            }
        }
        return(rankb - ranka);
    }
예제 #2
0
 public void ItemButton()
 {
     UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("GamePokey");
     if (go != null)
     {
         if (!NGUITools.GetActive(go))
         {
             ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(id);
             if (itemconfig != null)
             {
                 EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts);
                 if (ei != null)
                 {
                     go = UIManager.Instance.GetWindowGoByName("ItemProperty");
                     if (go != null && !NGUITools.GetActive(go))
                     {
                         ItemProperty ip = go.GetComponent <ItemProperty>();
                         if (ip != null)
                         {
                             ip.Compare(ei.id, ei.level, ei.propertyid, id, ei.level, propertyid, itemconfig.m_WearParts);
                             UIManager.Instance.ShowWindowByName("ItemProperty");
                         }
                     }
                 }
             }
         }
         else
         {
             UIManager.Instance.HideWindowByName("ItemProperty");
         }
     }
 }
예제 #3
0
 private void StoreItemClick(UnityEngine.GameObject goc)
 {
     foreach (storeInfo si in storeDic.Values)
     {
         if (si != null)
         {
             if (si.go == goc)
             {
                 if (si.CanBuyTime == 0)
                 {
                     //已卖完
                 }
                 else
                 {
                     //需要兑换
                     ArkCrossEngine.StoreConfig sc = ArkCrossEngine.StoreConfigProvider.Instance.GetDataById(si.ID);
                     if (sc != null)
                     {
                         ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(sc.m_ItemId);
                         if (itemconfig != null)
                         {
                             if (itemconfig.m_CanWear)
                             {
                                 EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts);
                                 if (ei != null)
                                 {
                                     UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("ItemProperty");
                                     if (go != null && !NGUITools.GetActive(go))
                                     {
                                         ItemProperty ip = go.GetComponent <ItemProperty>();
                                         if (ip != null)
                                         {
                                             ip.ExchangeGoodsCompare(currencySprite, si.ID, ei.id, ei.level, ei.propertyid, sc.m_ItemId, ei.level, ei.propertyid, itemconfig.m_WearParts, si.GetCurrency());
                                             UIManager.Instance.ShowWindowByName("ItemProperty");
                                         }
                                     }
                                 }
                             }
                             else
                             {
                                 UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("ItemProperty");
                                 if (go != null && !NGUITools.GetActive(go))
                                 {
                                     ItemProperty ip = go.GetComponent <ItemProperty>();
                                     if (ip != null)
                                     {
                                         ip.ExchangeGoodsSetItemProperty(currencySprite, si.ID, sc.m_ItemId, 0, 0, 0, si.GetCurrency());
                                         UIManager.Instance.ShowWindowByName("ItemProperty");
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #4
0
 public void WearButton()
 {
     ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(id);
     if (itemconfig != null)
     {
         ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_mount_equipment", "lobby", id, propertyid, itemconfig.m_WearParts);
     }
     UIManager.Instance.HideWindowByName("DynamicEquipment");
 }
예제 #5
0
 private float GetItemFightScore(int itemid, int propertyid, int itemlevel)
 {
     ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(itemid);
     if (itemconfig != null)
     {
         return(GetItemFightScore(itemconfig, propertyid, itemlevel));
     }
     return(0f);
 }
예제 #6
0
    private float GetItemFightScore(ArkCrossEngine.ItemConfig itemconfig, int propertyid, int itemlevel)
    {
        ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
        CharacterProperty       cp = ri.GetPlayerSelfInfo().GetActualProperty();

        if (itemconfig != null && ri != null && cp != null)
        {
            ArkCrossEngine.AppendAttributeConfig aac = ArkCrossEngine.AppendAttributeConfigProvider.Instance.GetDataById(propertyid);
            if (aac == null)
            {
                return(ArkCrossEngine.AttributeScoreConfigProvider.Instance.CalcAttributeScore(
                           itemconfig.m_AttrData.GetAddHpMax(cp.HpMax, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddEpMax(cp.EnergyMax, ri.Level, itemlevel),
                           itemconfig.m_AttrData.GetAddAd(cp.AttackBase, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddADp(cp.ADefenceBase, ri.Level, itemlevel),
                           itemconfig.m_AttrData.GetAddMDp(cp.MDefenceBase, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddCri(cp.Critical, ri.Level),
                           itemconfig.m_AttrData.GetAddPow(cp.CriticalPow, ri.Level), itemconfig.m_AttrData.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level),
                           itemconfig.m_AttrData.GetAddCrackPow(cp.CriticalCrackPow, ri.Level), itemconfig.m_AttrData.GetAddFireDam(cp.FireDamage, ri.Level),
                           itemconfig.m_AttrData.GetAddIceDam(cp.IceDamage, ri.Level), itemconfig.m_AttrData.GetAddPoisonDam(cp.PoisonDamage, 1),
                           itemconfig.m_AttrData.GetAddFireErd(cp.FireERD, ri.Level), itemconfig.m_AttrData.GetAddIceErd(cp.IceERD, ri.Level),
                           itemconfig.m_AttrData.GetAddPoisonErd(cp.PoisonERD, ri.Level)));
            }
            else
            {
                return(ArkCrossEngine.AttributeScoreConfigProvider.Instance.CalcAttributeScore(
                           itemconfig.m_AttrData.GetAddHpMax(cp.HpMax, ri.Level, itemlevel) + aac.GetAddHpMax(cp.HpMax, ri.Level),
                           itemconfig.m_AttrData.GetAddEpMax(cp.EnergyMax, ri.Level, itemlevel) + aac.GetAddEpMax(cp.EnergyMax, ri.Level),
                           itemconfig.m_AttrData.GetAddAd(cp.AttackBase, ri.Level, itemlevel) + aac.GetAddAd(cp.AttackBase, ri.Level),
                           itemconfig.m_AttrData.GetAddADp(cp.ADefenceBase, ri.Level, itemlevel) + aac.GetAddADp(cp.ADefenceBase, itemlevel),
                           itemconfig.m_AttrData.GetAddMDp(cp.MDefenceBase, ri.Level, itemlevel) + aac.GetAddMDp(cp.MDefenceBase, ri.Level),
                           itemconfig.m_AttrData.GetAddCri(cp.Critical, ri.Level) + aac.GetAddCri(cp.Critical, ri.Level),
                           itemconfig.m_AttrData.GetAddPow(cp.CriticalPow, ri.Level) + aac.GetAddPow(cp.CriticalPow, ri.Level),
                           itemconfig.m_AttrData.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level) + aac.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level),
                           itemconfig.m_AttrData.GetAddCrackPow(cp.CriticalCrackPow, ri.Level) + aac.GetAddCrackPow(cp.CriticalCrackPow, ri.Level),
                           itemconfig.m_AttrData.GetAddFireDam(cp.FireDamage, ri.Level) + aac.GetAddFireDam(cp.FireDamage, ri.Level),
                           itemconfig.m_AttrData.GetAddIceDam(cp.IceDamage, ri.Level) + aac.GetAddIceDam(cp.IceDamage, ri.Level),
                           itemconfig.m_AttrData.GetAddPoisonDam(cp.PoisonDamage, ri.Level) + aac.GetAddPoisonDam(cp.PoisonDamage, ri.Level),
                           itemconfig.m_AttrData.GetAddFireErd(cp.FireERD, ri.Level) + aac.GetAddFireDam(cp.FireERD, ri.Level),
                           itemconfig.m_AttrData.GetAddIceErd(cp.IceERD, ri.Level) + aac.GetAddIceErd(cp.IceERD, ri.Level),
                           itemconfig.m_AttrData.GetAddPoisonErd(cp.PoisonERD, ri.Level) + aac.GetAddPoisonErd(cp.PoisonERD, ri.Level)));
            }
        }
        return(0f);
    }
예제 #7
0
        public List <int> GetActiveImpacts()
        {
            List <int> result = new List <int>();
            int        level  = m_XSoulPartItem.Level;
            ItemConfig config = ItemConfigProvider.Instance.GetDataById(m_XSoulPartItem.ItemId);

            if (config == null || config.m_ActiveBuffOnLevel == null)
            {
                LogSystem.Debug("---ActiveImpactOnLevel is not configured!");
                return(result);
            }
            for (int i = 0; i + 1 < config.m_ActiveBuffOnLevel.Length; i += 2)
            {
                if (config.m_ActiveBuffOnLevel[i] <= level)
                {
                    result.Add(config.m_ActiveBuffOnLevel[i + 1]);
                }
            }
            return(result);
        }
예제 #8
0
        internal void UpdateEquipment(ItemDataInfo equip, bool bUpdateSuit = true)
        {
            if (equip == null || equip.ItemConfig == null)
            {
                return;
            }

            string wear_node_and_name = equip.ItemConfig.m_WearNodeAndName;
            string new_equip          = equip.ItemConfig.m_Model;

            GfxSystem.ChangeEquip(Actor, wear_node_and_name, new_equip);

            ItemConfig currentItem = m_User.GetEquipmentStateInfo().EquipmentInfo.Armor[equip.ItemConfig.m_WearParts].ItemConfig;

            // new item has display model or origal item has display model
            if (IsItemSuitNeedRefresh(equip.ItemConfig) ||
                (currentItem != null && IsItemSuitNeedRefresh(currentItem)))
            {
                UpdateSuit();
            }
        }
예제 #9
0
        public string GetLevelModel()
        {
            if (m_XSoulPartItem == null)
            {
                return("");
            }
            ItemConfig config = ItemConfigProvider.Instance.GetDataById(m_XSoulPartItem.ItemId);

            if (config == null)
            {
                return("");
            }
            if (m_ShowModelLevel > 0)
            {
                return(GetLevelModelImpl(m_ShowModelLevel, config));
            }
            else
            {
                return(GetLevelModelImpl(m_XSoulPartItem.Level, config));
            }
        }
예제 #10
0
 private void SetItemHeadProperty(int itemid, int itemlevel, int propertyid, UnityEngine.Transform whichtf, bool isUpgrade = false)
 {
     ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(itemid);
     if (itemconfig != null)
     {
         DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Item_Property, whichtf.gameObject, itemid);
         UnityEngine.Transform tf = whichtf.Find("LabelLv");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = "Lv." + itemlevel;
             }
         }
         tf = whichtf.Find("InlayLv");
         if (tf != null)
         {
             UILabel lbl = tf.gameObject.GetComponent <UILabel>();
             if (lbl != null)
             {
                 lbl.text = StrDictionaryProvider.Instance.Format(45, itemconfig.m_WearLevel);
                 RoleInfo role = LobbyClient.Instance.CurrentRole;
                 if (role != null)
                 {
                     if (role.Level >= itemconfig.m_WearLevel)
                     {//可穿戴
                         lbl.color = new UnityEngine.Color(0f, 251 / 255f, 75 / 255f);
                     }
                     else
                     {//不可穿戴
                         lbl.color = UnityEngine.Color.red;
                     }
                 }
             }
         }
         SetLabelProperty(itemconfig, itemlevel, propertyid, whichtf, isUpgrade);
     }
 }
예제 #11
0
 public void OnButtonClick()
 {
     UnityEngine.GameObject gogo = UIManager.Instance.GetWindowGoByName("GamePokey");
     if (gogo != null)
     {
         UnityEngine.Transform tf = gogo.transform.Find("RoleInfo");
         if (tf != null)
         {
             if (NGUITools.GetActive(tf.gameObject))
             {
                 return;
             }
         }
     }
     ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(ID);
     if (itemconfig != null)
     {
         UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("GamePokey");
         if (go != null)
         {
             EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts);
             if (ei != null)
             {
                 go = UIManager.Instance.GetWindowGoByName("ItemProperty");
                 if (go != null && !NGUITools.GetActive(go))
                 {
                     ItemProperty ip = go.GetComponent <ItemProperty>();
                     if (ip != null)
                     {
                         ip.Compare(ei.id, ei.level, ei.propertyid, ID, ei.level, PropertyId, itemconfig.m_WearParts);
                         UIManager.Instance.ShowWindowByName("ItemProperty");
                     }
                 }
             }
         }
     }
 }
예제 #12
0
 void SetInfo(int which, int id, int num = 1)
 {
     UnityEngine.Transform tf = transform.Find(which.ToString());
     if (tf != null)
     {
         TweenRotation tr = tf.gameObject.GetComponents <TweenRotation>()[1];
         if (tr != null)
         {
             tr.PlayForward();
         }
     }
     tf = transform.Find(which.ToString());
     if (tf != null)
     {
         UISprite us = tf.gameObject.GetComponent <UISprite>();
         if (us != null)
         {
             us.spriteName = "pai2";
         }
     }
     ArkCrossEngine.ItemConfig ic = ArkCrossEngine.LogicSystem.GetItemDataById(id);
     if (ic == null)
     {
         DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.CombatWin, tf.gameObject, 101001);
     }
     else
     {
         if (num > 1)
         {
             DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.CombatWin, tf.gameObject, id, num);
         }
         else
         {
             DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.CombatWin, tf.gameObject, id);
         }
     }
 }
예제 #13
0
 public void SetItemProperty(int itemid, int pos, int itemlevel, int propertyid, bool isUpgrade = false, bool hideBtnArea = false)
 {
     ShowActionButton(true);
     isCompareUI = false;
     ID          = itemid;
     property    = propertyid;
     position    = pos;
     level       = itemlevel;
     UnityEngine.Transform tfc = gameObject.transform.Find("SpriteBackLeft");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteBackRight");
     if (tfc != null)
     {
         tfc.localPosition = new UnityEngine.Vector3(0.0f, 0.0f, 0.0f);
         tfc = tfc.Find("line/Label");
         if (tfc != null)
         {
             UILabel ul = tfc.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text  = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(152);
                 ul.color = new UnityEngine.Color(1.0f, 0.52549f, 0.18039f);
             }
         }
     }
     tfc = transform.Find("SpriteBuy");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteSale");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteInlay");
     if (tfc != null)
     {
         //       UILabel ul = tfc.gameObject.GetComponent<UILabel>();
         //       if (ul != null) {
         //         ul.text = "镶嵌";
         //       }
         NGUITools.SetActive(tfc.gameObject, false);
     }
     tfc = transform.Find("SpriteUpdate/Label");
     if (tfc != null)
     {
         UILabel ul = tfc.gameObject.GetComponent <UILabel>();
         if (ul != null)
         {
             ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(121);
         }
     }
     tfc = transform.Find("SpriteUpdate/Up/money");
     if (tfc != null)
     {
         UILabel ul = tfc.gameObject.GetComponent <UILabel>();
         if (ul != null)
         {
             ArkCrossEngine.ItemLevelupConfig iluc = ArkCrossEngine.ItemLevelupConfigProvider.Instance.GetDataById(level);
             if (iluc != null)
             {
                 ul.text = (iluc.m_PartsList.Count > position ? iluc.m_PartsList[position] : 0).ToString();
             }
             else
             {
                 ul.text = "0";
             }
         }
     }
     tfc = transform.Find("SpriteUpdate");
     if (tfc != null)
     {
         UIButton ub = tfc.GetComponent <UIButton>();
         if (/*us != null &&*/ ub != null)
         {
             ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
             if (itemlevel >= ri.Level)
             {
                 ub.isEnabled = false;
                 if (spLevelUp != null)
                 {
                     spLevelUp.color = UnityEngine.Color.grey;
                 }
             }
             else
             {
                 ub.isEnabled = true;
                 if (spLevelUp != null)
                 {
                     spLevelUp.color = UnityEngine.Color.white;
                 }
             }
         }
     }
     ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemid);
     tfc = transform.Find("SpriteUpdate");
     if (tfc != null && ic != null)
     {
         if (!ic.m_CanUpgrade)
         {
             NGUITools.SetActive(tfc.gameObject, false);
             //hideBtnArea = true;
         }
         else
         {
             NGUITools.SetActive(tfc.gameObject, !hideBtnArea);
         }
     }
     tfc = transform.Find("SpriteBackRight/Sprite");
     if (tfc != null)
     {
         NGUITools.SetActive(tfc.gameObject, !hideBtnArea);
     }
     SetItemHeadProperty(itemid, itemlevel, propertyid, transform.Find("SpriteBackRight"), isUpgrade);
     CompareProperty(0, 0, 0, 0, 0, 0);
     CalculateUIPosition(transform.Find("SpriteBackRight"));
 }
예제 #14
0
    protected virtual void OnDragDropRelease(UnityEngine.GameObject surface)
    {
        ChangeSlotState(false);
        UIDragDropContainer container = surface ? NGUITools.FindInParents <UIDragDropContainer>(surface) : null;

        if (container != null)
        {
            if (container.reparentTarget.name == "Equipment")
            {
                ItemClick ic = mTrans.gameObject.GetComponent <ItemClick>();
                if (ic != null)
                {
                    if (surface != null)
                    {
                        ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
                        if (roleInfo != null)
                        {
                            ArkCrossEngine.ItemConfig itemConfig = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(ic.ID);
                            if (itemConfig != null)
                            {
                                if (itemConfig.m_WearLevel > roleInfo.Level)
                                {
                                    string tip = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(46);
                                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_screen_tip", "ui", tip, UIScreenTipPosEnum.AlignCenter, new UnityEngine.Vector3(0f, 0f, 0f));
                                }
                                else
                                {
                                    int    slotid = 0;
                                    string str    = surface.transform.name;
                                    if (str != null)
                                    {
                                        char[] ch = str.ToCharArray();
                                        if (ch != null && ch.Length >= 5)
                                        {
                                            if (System.Int32.TryParse(ch[4].ToString(), out slotid))
                                            {
                                                EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(slotid);
                                                if (ei != null)
                                                {
                                                    ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_mount_equipment", "lobby", ic.ID, ic.PropertyId, slotid);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        if (mDragScrollView != null)
        {
            mDragScrollView.enabled = true;
        }

        if (mCollider != null)
        {
            mCollider.enabled = true;
        }
    }
예제 #15
0
    private void SetItemInformation(UnityEngine.GameObject go, int id, int propertyid)
    {
        ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(id);
        if (itemconfig == null)
        {
            return;
        }

        if (go != null)
        {
            DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Equip_List, go, id);
            UnityEngine.Transform tf;
            RoleInfo       roleInfo = LobbyClient.Instance.CurrentRole;
            ItemDataInfo[] equips   = null;
            if (roleInfo != null)
            {
                equips = roleInfo.Equips;
            }
            int _fightScore     = (int)GetItemFightScore(itemconfig, propertyid, 1);
            int _equipFingScore = 0;
            if (equips != null)
            {
                foreach (ItemDataInfo info in equips)
                {
                    ItemConfig equipConfig = LogicSystem.GetItemDataById(info.ItemId);
                    if (equipConfig != null)
                    {
                        if (equipConfig.m_WearParts == itemconfig.m_WearParts)
                        {
                            _equipFingScore = (int)GetItemFightScore(equipConfig, info.RandomProperty, info.Level);
                            _fightScore     = (int)GetItemFightScore(itemconfig, propertyid, info.Level);
                        }
                    }
                }
            }
            tf = go.transform.Find("Up");
            if (tf != null)
            {
                UISprite sp = tf.GetComponent <UISprite>();
                if (sp != null)
                {
                    sp.spriteName = _fightScore >= _equipFingScore ? "Up" : "down";
                }
            }
            tf = go.transform.Find("Up/value");
            if (tf != null)
            {
                UILabel label = tf.GetComponent <UILabel>();
                if (label != null)
                {
                    label.text  = Math.Abs(_fightScore - _equipFingScore).ToString();
                    label.color = _fightScore >= _equipFingScore ? new UnityEngine.Color(0, 251 / 255f, 75 / 255f) : new UnityEngine.Color(1, 0, 0);
                }
            }

            ItemClick script = go.GetComponent <ItemClick>();
            if (script != null)
            {
                script.fightScoreChange = _fightScore - _equipFingScore;
            }

            tf = go.transform.Find("LabelOccupation");
            if (tf != null)
            {
                UILabel ul = tf.gameObject.GetComponent <UILabel>();
                if (ul != null)
                {
                    ul.text = itemconfig.m_ItemType;
                }
            }
        }
    }
예제 #16
0
 public void AddItem(int[] item, int[] item_num, int[] item_append_property)
 {
     try
     {
         if (isFirstInitItems)
         {
             wingIdList.Clear();
             RoleInfo roleInfo = LobbyClient.Instance.CurrentRole;
             if (roleInfo != null)
             {
                 ItemDataInfo[] equips = roleInfo.Equips;
                 if (equips != null)
                 {
                     foreach (ItemDataInfo info in equips)
                     {
                         ItemConfig config = ItemConfigProvider.Instance.GetDataById(info.ItemId);
                         if (config != null)
                         {
                             if (config.m_WearParts == 7)
                             {
                                 //wingIdList.Add(info.ItemId);// todo 暂时注释
                                 //AddWingGo(config, info.ItemId, info.RandomProperty, true);
                             }
                         }
                     }
                 }
             }
             isFirstInitItems = false;
         }
         int count = item.Length;
         for (int i = 0; i < count; ++i)
         {
             int itemcell = item[i];
             int itemNum  = item_num[i];
             ArkCrossEngine.ItemConfig item_data = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemcell);
             if (null != item_data)
             {
                 if (item_data.m_CanWear)
                 {
                     //if (item_data.m_WearParts == 7) {//翅膀// todo 暂时注释
                     //  if (wingIdList.IndexOf(itemcell) == -1) {
                     //    wingIdList.Add(itemcell);
                     //    AddWingGo(item_data, itemcell, item_append_property[i], true);
                     //  }
                     //} else {
                     AddEquipGo(item_data, itemcell, item_append_property[i]);
                     //}
                 }
                 else if (item_data.m_CompoundItemId.Count > 0 && item_data.m_CompoundItemId[0] > 0)
                 {//可合成
                     ChipItem ci = null;
                     foreach (ChipItem citem in chipItemList)
                     {
                         if (citem.Id() == itemcell)
                         {
                             ci = citem;
                         }
                     }
                     if (ci == null)
                     {
                         AddChipGo(itemcell, item_append_property[i], itemNum);
                     }
                     else
                     {
                         //update
                         ci.UpdateView(itemNum);
                     }
                     CheckHasCompound();
                 }
             }
         }
         if (gridEquip != null)
         {
             UIGridForDFM ug = gridEquip.gameObject.GetComponent <UIGridForDFM>();
             if (ug != null)
             {
                 ug.sortRepositionForDF = true;
             }
         }
         if (gridWingTop != null)
         {
             UIGridForDFM ug = gridWingTop.gameObject.GetComponent <UIGridForDFM>();
             if (ug != null)
             {
                 ug.sortRepositionForDF = true;
             }
         }
         if (gridChip != null)
         {
             UIGridForDFM ug = gridChip.gameObject.GetComponent <UIGridForDFM>();
             if (ug != null)
             {
                 ug.sortRepositionForDF = true;
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
예제 #17
0
    private void NewEquipment(List <NewEquipInfo> neil)
    {
        try
        {
            if (neil != null && neil.Count > 0 && changeitemDic != null)
            {
                ArkCrossEngine.ItemConfig ic = null;
                for (int i = 0; i < neil.Count; i++)
                {
                    if (neil[i] != null)
                    {
                        ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(neil[i].ItemId);
                        if (ic != null)
                        {
                            if (changeitemDic.ContainsKey(ic.m_WearParts))
                            {
                                ChangeNewEquip cne = changeitemDic[ic.m_WearParts];
                                if (cne != null)
                                {
                                    float score = GetItemFightScore(neil[i].ItemId, neil[i].ItemRandomProperty, cne.needlevel);
                                    if (score > cne.fightscore)
                                    {
                                        changeitemDic[ic.m_WearParts] = new ChangeNewEquip(neil[i].ItemId, neil[i].ItemRandomProperty, score, cne.needlevel);
                                    }
                                }
                            }
                            else if (GetEquipmentInfo(ic.m_WearParts) != null)
                            {
                                EquipmentInfo ei     = GetEquipmentInfo(ic.m_WearParts);
                                float         score0 = GetItemFightScore(ei.id, ei.propertyid, ei.level);
                                float         score1 = GetItemFightScore(neil[i].ItemId, neil[i].ItemRandomProperty, ei.level);
                                if (score0 < score1)
                                {
                                    changeitemDic.Add(ic.m_WearParts, new ChangeNewEquip(neil[i].ItemId, neil[i].ItemRandomProperty, score1, ei.level));
                                }
                            }
                            else
                            {
                                float score2 = GetItemFightScore(neil[i].ItemId, neil[i].ItemRandomProperty, 1);
                                changeitemDic.Add(ic.m_WearParts, new ChangeNewEquip(neil[i].ItemId, neil[i].ItemRandomProperty, score2, 1));
                            }
                        }
                    }
                }

                /*
                 * foreach (NewEquipInfo nei in neil) {
                 * if (nei != null) {
                 * ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(nei.ItemId);
                 * if (ic != null) {
                 * if (changeitemDic.ContainsKey(ic.m_WearParts)) {
                 * ChangeNewEquip cne = changeitemDic[ic.m_WearParts];
                 * if (cne != null) {
                 * float score = GetItemFightScore(nei.ItemId, nei.ItemRandomProperty, cne.needlevel);
                 * if (score > cne.fightscore) {
                 *  changeitemDic[ic.m_WearParts] = new ChangeNewEquip(nei.ItemId, nei.ItemRandomProperty, score, cne.needlevel);
                 * }
                 * }
                 * } else if (GetEquipmentInfo(ic.m_WearParts) != null) {
                 * EquipmentInfo ei = GetEquipmentInfo(ic.m_WearParts);
                 * float score0 = GetItemFightScore(ei.id, ei.propertyid, ei.level);
                 * float score1 = GetItemFightScore(nei.ItemId, nei.ItemRandomProperty, ei.level);
                 * if (score0 < score1) {
                 * changeitemDic.Add(ic.m_WearParts, new ChangeNewEquip(nei.ItemId, nei.ItemRandomProperty, score1, ei.level));
                 * }
                 * } else {
                 * float score2 = GetItemFightScore(nei.ItemId, nei.ItemRandomProperty, 1);
                 * changeitemDic.Add(ic.m_WearParts, new ChangeNewEquip(nei.ItemId, nei.ItemRandomProperty, score2, 1));
                 * }
                 * }
                 * }
                 * }*/
                foreach (ChangeNewEquip cne in changeitemDic.Values)
                {
                    if (cne != null)
                    {
                        UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("DynamicEquipment");
                        if (go != null)
                        {
                            DynamicEquipment de = go.GetComponent <DynamicEquipment>();
                            if (de != null)
                            {
                                de.SetEquipment(new ChangeNewEquip(cne.id, cne.propertyid, 0, 0));
                                break;
                            }
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
        }
    }
예제 #18
0
    /// <summary>
    /// Start the dragging operation.
    /// </summary>

    void OnDragStart()
    {
        if (!enabled || mTouchID != int.MinValue)
        {
            return;
        }

        // If we have a restriction, check to see if its condition has been met first
        if (restriction != Restriction.None)
        {
            if (restriction == Restriction.Horizontal)
            {
                UnityEngine.Vector2 delta = UICamera.currentTouch.totalDelta;
                if (UnityEngine.Mathf.Abs(delta.x) < UnityEngine.Mathf.Abs(delta.y))
                {
                    return;
                }
            }
            else if (restriction == Restriction.Vertical)
            {
                UnityEngine.Vector2 delta = UICamera.currentTouch.totalDelta;
                if (UnityEngine.Mathf.Abs(delta.x) > UnityEngine.Mathf.Abs(delta.y))
                {
                    return;
                }
            }
            else if (restriction == Restriction.PressAndHold)
            {
                if (mPressTime + 1f > RealTime.time)
                {
                    return;
                }
            }
        }

        UnityEngine.GameObject gp = UIManager.Instance.GetWindowGoByName("GamePokey");
        if (gp != null)
        {
            UnityEngine.Transform root = UIDragDropRoot.root;
            if (root != null)
            {
                UnityEngine.GameObject item = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GamePokey/ItemDrag"));
                if (item != null)
                {
                    item = NGUITools.AddChild(root.gameObject, item);
                    UnityEngine.Vector2 v2 = UICamera.currentTouch.pos;
                    UnityEngine.Vector3 v3 = UICamera.mainCamera.ScreenToWorldPoint(new UnityEngine.Vector3(v2.x, v2.y, 0));
                    item.transform.position = v3;//UICamera.mainCamera.transform.InverseTransformPoint(v2.x, v2.y, 0);
                    ItemClick ic = GetComponent <ItemClick>();
                    if (ic != null)
                    {
                        DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Equip_slot, item, ic.ID);
                        ArkCrossEngine.ItemConfig config = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(ic.ID);
                        if (config != null)
                        {
                            m_pos = config.m_WearParts;
                        }
                        ChangeSlotState(true);
                    }
                    UIDragScrollView dragScrollView = item.GetComponent <UIDragScrollView>();
                    if (dragScrollView != null)
                    {
                        UIScrollView scroll = transform.parent.parent.GetComponent <UIScrollView>();
                        dragScrollView.scrollView = scroll;
                    }
                    UIDragDropItemForDFM drag = item.GetComponent <UIDragDropItemForDFM>();
                    if (drag != null)
                    {
                        if (mDragScrollView != null)
                        {
                            mDragScrollView.enabled = false;
                        }

                        if (mCollider != null)
                        {
                            mCollider.enabled = false;
                        }
                        drag.onRealse = OnDragDropRelease;
                        drag.StartDrag();
                    }
                }
            }
        }
    }
예제 #19
0
    public void SetSomething(int money, int diamond, int exp, int itemlist, int itemcount, UnityEngine.GameObject item)
    {
        golist.Clear();
        UnityEngine.Transform tfb = item.transform.Find("back");
        if (tfb != null)
        {
            if (money > 0)
            {
                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/AwardItem"));
                if (go != null)
                {
                    go = NGUITools.AddChild(tfb.gameObject, go);
                    if (go != null)
                    {
                        golist.Add(go);
                        DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Task_Award, go, DFMItemIconUtils.Instance.m_Money, money);
                    }
                }
            }
            if (diamond > 0)
            {
                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/AwardItem"));
                if (go != null)
                {
                    go = NGUITools.AddChild(tfb.gameObject, go);
                    if (go != null)
                    {
                        golist.Add(go);
                        DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Task_Award, go, DFMItemIconUtils.Instance.m_Diamond, diamond);
                    }
                }
            }
            if (exp > 0)
            {
                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/AwardItem"));
                if (go != null)
                {
                    go = NGUITools.AddChild(tfb.gameObject, go);
                    if (go != null)
                    {
                        golist.Add(go);
                        DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Task_Award, go, DFMItemIconUtils.Instance.m_Exp, exp);
                    }
                }
            }
            ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(itemlist);
            if (ic != null)
            {
                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/AwardItem"));
                if (go != null)
                {
                    go = NGUITools.AddChild(tfb.gameObject, go);
                    if (go != null)
                    {
                        golist.Add(go);
                        DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Task_Award, go, itemlist, itemcount);
                    }
                }
            }
        }
        int number = golist.Count;

        if (number == 0)
        {
            return;
        }
        int offset = 0;
        int start  = 0;

        if (number % 2 != 0)
        {
            UnityEngine.GameObject go = golist[0];
            if (go != null)
            {
                go.transform.localPosition = new UnityEngine.Vector3(0.0f, 10f, 0.0f);
                start  = 1;
                offset = 50;
            }
        }
        else
        {
            offset = -60;
        }
        for (int i = start; i < number; ++i)
        {
            int j = i;
            if (number % 2 == 0)
            {
                j = i + 1;
            }
            UnityEngine.GameObject go = golist[i];
            if (go != null)
            {
                if (j % 2 == 0)
                {
                    go.transform.localPosition = new UnityEngine.Vector3(j / 2 * (-120) - offset, 10, 0);
                }
                else
                {
                    go.transform.localPosition = new UnityEngine.Vector3((j / 2 + 1) * 120 + offset, 10f, 0.0f);
                }
            }
        }
    }
예제 #20
0
    private void SetAwardAndPosition(UnityEngine.Transform tf, int dropid, int missionId)
    {
        ArkCrossEngine.Data_SceneDropOut dsdo = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneDropOutById(dropid);
        UnityEngine.Vector3 pos = new UnityEngine.Vector3(80.0f, 0.0f, 0.0f);
        if (tf != null && dsdo != null)
        {
            if (dsdo.m_GoldSum > 0)
            {
                UnityEngine.Transform tt = tf.Find("Money");
                if (tt != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + dsdo.m_GoldSum;
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Money");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            if (dsdo.m_Exp > 0)
            {
                UnityEngine.Transform tt = tf.Find("Exp");
                RoleInfo roleInfo        = LobbyClient.Instance.CurrentRole;
                if (tt != null && roleInfo != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    tt.localPosition = pos;
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + roleInfo.GetMissionStateInfo().GetMissionsExpReward(missionId, roleInfo.Level);
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Exp");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            if (dsdo.m_Diamond > 0)
            {
                UnityEngine.Transform tt = tf.Find("Diamond");
                if (tt != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    tt.localPosition = pos;
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + dsdo.m_Diamond;
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Diamond");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            RoleInfo role_info = LobbyClient.Instance.CurrentRole;
            if (null != role_info)
            {
                List <int> rewardItemIdList = dsdo.GetRewardItemByHeroId(role_info.HeroId);
                if (null != rewardItemIdList && rewardItemIdList.Count > 0)
                {
                    int count = rewardItemIdList.Count;
                    pos = new UnityEngine.Vector3(pos.x + 30, pos.y, 0f);
                    for (int i = 0; i < count; ++i)
                    {
                        ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(rewardItemIdList[i]);
                        if (ic != null)
                        {
                            UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/Item"));
                            if (go != null)
                            {
                                go = NGUITools.AddChild(tf.gameObject, go);
                                if (go != null)
                                {
                                    go.transform.localPosition = pos;
                                    pos = go.transform.localPosition;
                                    pos = new UnityEngine.Vector3(pos.x + 65, pos.y, 0.0f);
                                    UnityEngine.Texture utt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName);
                                    UITexture           ut  = go.GetComponent <UITexture>();
                                    if (ut != null)
                                    {
                                        if (utt != null)
                                        {
                                            ut.mainTexture = utt;
                                        }
                                    }
                                    UnityEngine.Transform tt = go.transform.Find("Frame");
                                    if (tt != null)
                                    {
                                        UISprite us = tt.gameObject.GetComponent <UISprite>();
                                        if (us != null)
                                        {
                                            us.spriteName = "EquipFrame" + ic.m_PropertyRank;
                                        }
                                    }
                                    tt = go.transform.Find("Label");
                                    if (tt != null)
                                    {
                                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                                        if (ul != null)
                                        {
                                            ul.text = "X" + dsdo.m_ItemCountList[i];
                                        }
                                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
예제 #21
0
    void ManageExchangeGoods(int currency, bool refresh, ArkCrossEngine.Network.GeneralOperationResult result, int exchangeid, int exchangenum)
    {
        try
        {
            GfxSystem.PublishGfxEvent("ge_ui_connect_hint", "ui", false, false);
            if (currency != currencyId && currency != 0)
            {
                return;
            }
            if (refresh)
            {
                if (result == ArkCrossEngine.Network.GeneralOperationResult.LC_Succeed)
                {
                    DataDictionaryMgr <StoreConfig> storedata = ArkCrossEngine.StoreConfigProvider.Instance.StoreDictionaryMgr;
                    if (storedata != null)
                    {
                        MyDictionary <int, object> storedic = storedata.GetData();
                        if (storedic != null)
                        {
                            StoreConfig sc = null;
                            foreach (KeyValuePair <int, object> pair in storedic)
                            {
                                sc = pair.Value as StoreConfig;
                                if (sc != null)
                                {
                                    if (sc.m_Currency == currencyId || (currency == 0 && sc.m_Currency == currencyId))
                                    {
                                        AddItem(pair.Key, 0);
                                    }
                                }
                            }
                        }
                    }
                }
                else if (result == ArkCrossEngine.Network.GeneralOperationResult.LC_Failure_CostError)
                {
                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_show_dialog", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(123),
                                                                          ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(140), null, null, null, false);
                }
            }
            else
            {
                if (result == ArkCrossEngine.Network.GeneralOperationResult.LC_Succeed)
                {
                    AddItem(exchangeid, exchangenum);
                    ArkCrossEngine.StoreConfig sc = ArkCrossEngine.StoreConfigProvider.Instance.GetDataById(exchangeid);
                    if (sc != null)
                    {
                        ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(sc.m_ItemId);
                        if (ic != null)
                        {
                            GfxSystem.PublishGfxEvent("ge_screen_tip", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(1005)
                                                      + ic.m_ItemName + "X" + sc.m_ItemNum, UIScreenTipPosEnum.AlignCenter, UnityEngine.Vector3.zero);
                        }
                    }
                }
                else
                {
                    //提示
                    int sign = 1003;
                    switch (result)
                    {
                    case ArkCrossEngine.Network.GeneralOperationResult.LC_Failure_CostError:
                        sign = 1000;
                        break;

                    case ArkCrossEngine.Network.GeneralOperationResult.LC_Failure_Overflow:
                        sign = 1001;
                        break;

                    case ArkCrossEngine.Network.GeneralOperationResult.LC_Failure_LevelError:
                        sign = 1002;
                        break;

                    default:
                        sign = 1003;
                        break;
                    }
                    GfxSystem.PublishGfxEvent("ge_screen_tip", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(sign), UIScreenTipPosEnum.AlignCenter, UnityEngine.Vector3.zero);
                }
            }
            UIGrid ug = gridGo.GetComponent <UIGrid>();
            if (ug != null)
            {
                ug.repositionNow = true;
            }
        }
        catch (Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
        }
    }
예제 #22
0
        private UserInfo CreateArenaTarget(ArenaTargetInfo target)
        {
            if (target == null)
            {
                return(null);
            }
            int      image_res_id = target.HeroId;
            UserInfo image_player = m_UserMgr.AddUser(image_res_id);

            if (null != image_player)
            {
                image_player.SceneContext = m_SceneContext;
                int campid = NetworkSystem.Instance.CampId == (int)CampIdEnum.Blue ? (int)CampIdEnum.Red : (int)CampIdEnum.Blue;
                image_player.SetCampId(campid);
                Data_Unit unit = m_CurScene.StaticData.ExtractData(DataMap_Type.DT_Unit, GlobalVariables.GetUnitIdByCampId(campid)) as Data_Unit;
                if (null != unit)
                {
                    image_player.GetAiStateInfo().AiLogic = unit.m_AiLogic;
                    image_player.SetAIEnable(true);
                    image_player.GetMovementStateInfo().SetPosition(unit.m_Pos);
                    image_player.GetMovementStateInfo().SetFaceDir(unit.m_RotAngle);
                }
                image_player.SetLevel(target.Level);
                image_player.SetNickName(target.Nickname);
                image_player.SkillController = new SwordManSkillController(image_player, GfxModule.Skill.GfxSkillSystem.Instance);
                if (null != m_SpatialSystem)
                {
                    m_SpatialSystem.AddObj(image_player.SpaceObject);
                }
                /// skills
                if (null != target.Skills)
                {
                    image_player.GetSkillStateInfo().RemoveAllSkill();
                    int skill_ct = target.Skills.Count;
                    for (int i = 0; i < skill_ct; i++)
                    {
                        SkillInfo info = target.Skills[i];
                        if (null != info)
                        {
                            SkillCategory cur_skill_pos = SkillCategory.kNone;
                            if (info.Postions.Presets[0] == SlotPosition.SP_A)
                            {
                                cur_skill_pos = SkillCategory.kSkillA;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_B)
                            {
                                cur_skill_pos = SkillCategory.kSkillB;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_C)
                            {
                                cur_skill_pos = SkillCategory.kSkillC;
                            }
                            else if (info.Postions.Presets[0] == SlotPosition.SP_D)
                            {
                                cur_skill_pos = SkillCategory.kSkillD;
                            }
                            info.Category = cur_skill_pos;
                            image_player.GetSkillStateInfo().AddSkill(info);
                            WorldSystem.Instance.AddSubSkill(image_player, info.SkillId, cur_skill_pos, info.SkillLevel);
                        }
                    }
                }
                Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(image_player.GetLinkId());
                if (null != playerData && null != playerData.m_FixedSkillList &&
                    playerData.m_FixedSkillList.Count > 0)
                {
                    foreach (int skill_id in playerData.m_FixedSkillList)
                    {
                        SkillInfo info = new SkillInfo(skill_id, 1);
                        image_player.GetSkillStateInfo().AddSkill(info);
                    }
                }
                image_player.ResetSkill();
                /// equips
                if (null != target.Equips)
                {
                    int equip_ct = target.Equips.Length;
                    for (int i = 0; i < equip_ct; i++)
                    {
                        ItemDataInfo image_equip = target.Equips[i];
                        if (null != image_equip)
                        {
                            image_player.GetEquipmentStateInfo().ResetEquipmentData(i);
                            image_equip.ItemConfig = ItemConfigProvider.Instance.GetDataById(image_equip.ItemId);
                            if (null != image_equip.ItemConfig)
                            {
                                image_player.GetEquipmentStateInfo().SetEquipmentData(i, image_equip);
                            }
                        }
                    }
                }
                ///
                if (null != target.Legacys)
                {
                    int legacy_ct = target.Legacys.Length;
                    for (int i = 0; i < legacy_ct; i++)
                    {
                        ItemDataInfo image_legacy = target.Legacys[i];
                        if (null != image_legacy && image_legacy.IsUnlock)
                        {
                            image_player.GetLegacyStateInfo().ResetLegacyData(i);
                            image_legacy.ItemConfig = ItemConfigProvider.Instance.GetDataById(image_legacy.ItemId);
                            if (null != image_legacy.ItemConfig)
                            {
                                image_player.GetLegacyStateInfo().SetLegacyData(i, image_legacy);
                            }
                        }
                    }
                    image_player.GetLegacyStateInfo().UpdateLegacyComplexAttr();
                }
                foreach (ArenaXSoulInfo x in target.XSoulInfo)
                {
                    ItemDataInfo item = new ItemDataInfo();
                    item.ItemId     = x.ItemId;
                    item.Level      = x.Level;
                    item.Experience = x.Experience;
                    item.UpdateLevelByExperience();
                    ItemConfig config = ItemConfigProvider.Instance.GetDataById(item.ItemId);
                    if (config == null)
                    {
                        continue;
                    }
                    item.ItemConfig = config;
                    XSoulPartInfo part = new XSoulPartInfo((XSoulPart)config.m_WearParts, item);
                    part.ShowModelLevel = x.ModelLevel;
                    image_player.GetXSoulInfo().SetXSoulPartData((XSoulPart)config.m_WearParts, part);
                }
                image_player.SetPartnerInfo(target.ActivePartner);
                SetArenaCharacterCoefficient(image_player);
                UserAttrCalculator.Calc(image_player);
                image_player.SetHp(Operate_Type.OT_Absolute, image_player.GetActualProperty().HpMax);
                image_player.SetRage(Operate_Type.OT_Absolute, 0);
                image_player.SetEnergy(Operate_Type.OT_Absolute, image_player.GetActualProperty().EnergyMax);

                target.CreatedPartners.Clear();
                int total_hp = image_player.GetActualProperty().HpMax;
                //LogSystem.Error("---challenge target hp=" + image_player.GetActualProperty().HpMax);
                foreach (PartnerInfo partner in target.FightPartners)
                {
                    NpcInfo partner_npc = CreateParterner(image_player, partner);
                    if (partner_npc != null)
                    {
                        target.CreatedPartners.Add(partner.Id, partner_npc);
                        //LogSystem.Error("---parnter {0} hp={1}", partner.Id, partner_npc.GetBaseProperty().HpMax);
                        total_hp += partner_npc.GetBaseProperty().HpMax;
                    }
                }
                //LogSystem.Error("-----challenge target total hp=" + total_hp);
                EntityManager.Instance.CreateUserView(image_player.GetId());
                UserView image_view = EntityManager.Instance.GetUserViewById(image_player.GetId());
                image_view.UpdateEquipment();
                image_view.UpdateXSoulEquip();
            }
            SyncGfxUserInfo(image_player.GetId());
            return(image_player);
        }
예제 #23
0
    private void SetLabelProperty(ArkCrossEngine.ItemConfig itemconfig, int itemlevel, int propertyid, UnityEngine.Transform whichtf, bool isUpgrade = false)
    {
        if (itemconfig == null || whichtf == null)
        {
            return;
        }
        ArkCrossEngine.AppendAttributeConfig aac = ArkCrossEngine.AppendAttributeConfigProvider.Instance.GetDataById(propertyid);
        int    level = 1;
        string str   = "[ffffff]";
        float  data  = 0.0f;

        data = itemconfig.m_AttrData.GetAddHpMax(1.0f, level, itemlevel);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(101) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_HpMaxType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddAd(1.0f, level, itemlevel);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(102) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_AdType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddADp(1.0f, level, itemlevel);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(103) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_ADpType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddMDp(1.0f, level, itemlevel);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(104) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_MDpType) + "\n");
        }

        int proNum = str.Split('\n').Length - 1;

        switch (itemconfig.m_DamageType)
        {
        case ArkCrossEngine.ElementDamageType.DC_Fire:
            str += ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(118);
            break;

        case ArkCrossEngine.ElementDamageType.DC_Ice:
            str += ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(119);
            break;

        case ArkCrossEngine.ElementDamageType.DC_Poison:
            str += ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(120);
            break;

        case ArkCrossEngine.ElementDamageType.DC_None:
            break;

        default: break;
        }
        str += "[-]";
        UnityEngine.Transform tf = whichtf.Find("Container/DragThing/Property");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                //播放升级特效
                if (isUpgrade == true)
                {
                    for (int i = 0; i < proNum; i++)
                    {
                        PlayParticle(ul.transform.position - new UnityEngine.Vector3(0f, 0.1f * i + 0.05f, 0f));
                    }
                    //播放图标特效
                    if (upgradeEffect != null)
                    {
                        UnityEngine.GameObject ef = ResourceSystem.NewObject(upgradeEffect) as GameObject;
                        if (ef != null && upEffGO != null)
                        {
                            ef.transform.position = new UnityEngine.Vector3(upEffGO.transform.position.x, upEffGO.transform.position.y, upEffGO.transform.position.z);
                            Destroy(ef, duration);
                        }
                    }
                }
                ul.text = str;
            }
        }
        str = "";
        if (aac != null)
        {
            data = aac.GetAddCri(1.0f, level);
            if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
            {
                str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(105) + "+" + UnityEngine.Mathf.FloorToInt(data * 100) + "%\n");
            }
            data = aac.GetAddPow(1.0f, level);
            if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
            {
                str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(106) + "+" + UnityEngine.Mathf.FloorToInt(data * 100) + "%\n");
            }
            data = aac.GetAddBackHitPow(1.0f, level);
            if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
            {
                str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(107) + "+" + UnityEngine.Mathf.FloorToInt(data * 100) + "%\n");
            }
            data = aac.GetAddCrackPow(1.0f, level);
            if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
            {
                str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(108) + "+" + UnityEngine.Mathf.FloorToInt(data * 100) + "%\n");
            }
        }
        data = itemconfig.m_AttrData.GetAddFireDam(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(109) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_FireDamType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddIceDam(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(110) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_IceDamType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddPoisonDam(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(111) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_PoisonDamType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddFireErd(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(112) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_FireErdType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddIceErd(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(113) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_IceErdType) + "\n");
        }
        data = itemconfig.m_AttrData.GetAddPoisonErd(1.0f, level);
        if (UnityEngine.Mathf.Abs(data - 0) > float.Epsilon)
        {
            str += (ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(114) + UIManager.GetItemProtetyStr(data, itemconfig.m_AttrData.m_PoisonErdType) + "\n");
        }
        if (str != "")
        {
            str = "\n[00ff00]" + str + "[-]";
        }
        tf = whichtf.Find("Container/DragThing/StarRock");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                ul.text = str;
            }
        }
        tf = whichtf.Find("Container/DragThing/Bula");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                ul.text = itemconfig.m_Description;
            }
        }
    }
예제 #24
0
        public void RefreshItemSkills(SendImpactToSelfDelegation sendImpactToSelf, StopMyImpactDelegation stopImpact)
        {
            //标记所有物品带的技能与buff
            for (int i = 0; i < GetSkillStateInfo().GetAllSkill().Count; i++)
            {
                if (GetSkillStateInfo().GetAllSkill()[i].IsItemSkill)
                {
                    GetSkillStateInfo().GetAllSkill()[i].IsMarkToRemove = true;
                }
            }
            for (int i = 0; i < GetSkillStateInfo().GetAllImpact().Count; i++)
            {
                if (GetSkillStateInfo().GetAllImpact()[i].m_IsItemImpact)
                {
                    GetSkillStateInfo().GetAllImpact()[i].m_IsMarkToRemove = true;
                }
            }

            /*
             * foreach (SkillInfo info in GetSkillStateInfo().GetAllSkill()) {
             * if (info.IsItemSkill) {
             *  info.IsMarkToRemove = true;
             * }
             * }
             * foreach (ImpactInfo info in GetSkillStateInfo().GetAllImpact()) {
             * if (info.m_IsItemImpact) {
             *  info.m_IsMarkToRemove = true;
             * }
             * }*/
            //刷新物品带的技能与buff
            EquipmentStateInfo equipInfo = GetEquipmentStateInfo();

            for (int ix = 0; ix < EquipmentStateInfo.c_EquipmentCapacity; ++ix)
            {
                ItemDataInfo itemInfo = equipInfo.GetEquipmentData(ix);
                if (null != itemInfo && itemInfo.ItemNum == 1 && null != itemInfo.ItemConfig)
                {
                    ItemConfig cfg = itemInfo.ItemConfig;
                    if (null != cfg.m_AddSkillOnEquiping)
                    {
                        for (int i = 0; i < cfg.m_AddSkillOnEquiping.Length; i++)
                        {
                            SkillInfo skillInfo = GetSkillStateInfo().GetSkillInfoById(cfg.m_AddSkillOnEquiping[i]);
                            if (null == skillInfo)
                            {
                                skillInfo                = new SkillInfo(cfg.m_AddSkillOnEquiping[i]);
                                skillInfo.IsItemSkill    = true;
                                skillInfo.IsMarkToRemove = false;
                                GetSkillStateInfo().AddSkill(skillInfo);
                            }
                            else
                            {
                                skillInfo.IsMarkToRemove = false;
                            }
                        }

                        /*
                         * foreach (int id in cfg.m_AddSkillOnEquiping) {
                         * SkillInfo skillInfo = GetSkillStateInfo().GetSkillInfoById(id);
                         * if (null == skillInfo) {
                         *  skillInfo = new SkillInfo(id);
                         *  skillInfo.IsItemSkill = true;
                         *  skillInfo.IsMarkToRemove = false;
                         *  GetSkillStateInfo().AddSkill(skillInfo);
                         * } else {
                         *  skillInfo.IsMarkToRemove = false;
                         * }
                         * }*/
                    }
                    if (null != cfg.m_AddBuffOnEquiping && null != sendImpactToSelf)
                    {
                        //此分支为服务器端处理,参数为加impact的回调,这个回调里包括加impact并发消息给客户端(现在ImpactSystem是这样实现的)
                        for (int i = 0; i < cfg.m_AddBuffOnEquiping.Length; i++)
                        {
                            ImpactInfo impactInfo = GetSkillStateInfo().GetImpactInfoById(cfg.m_AddBuffOnEquiping[i]);
                            if (null == impactInfo)
                            {
                                impactInfo = sendImpactToSelf(cfg.m_AddBuffOnEquiping[i]);
                                if (null != impactInfo)
                                {
                                    impactInfo.m_IsItemImpact   = true;
                                    impactInfo.m_IsMarkToRemove = false;
                                }
                            }
                            else
                            {
                                impactInfo.m_IsMarkToRemove = false;
                            }
                        }

                        /*
                         * foreach (int id in cfg.m_AddBuffOnEquiping) {
                         * ImpactInfo impactInfo = GetSkillStateInfo().GetImpactInfoById(id);
                         * if (null == impactInfo) {
                         *  impactInfo = sendImpactToSelf(id);
                         *  if (null != impactInfo) {
                         *    impactInfo.m_IsItemImpact = true;
                         *    impactInfo.m_IsMarkToRemove = false;
                         *  }
                         * } else {
                         *  impactInfo.m_IsMarkToRemove = false;
                         * }
                         * }*/
                    }
                }
            }
            //移除不再有效的技能与buff
            List <int> removeSkills = new List <int>();

            for (int i = 0; i < GetSkillStateInfo().GetAllSkill().Count; i++)
            {
                if (GetSkillStateInfo().GetAllSkill()[i].IsItemSkill && GetSkillStateInfo().GetAllSkill()[i].IsMarkToRemove)
                {
                    removeSkills.Add(GetSkillStateInfo().GetAllSkill()[i].SkillId);
                }
            }
            for (int i = 0; i < removeSkills.Count; i++)
            {
                GetSkillStateInfo().RemoveSkill(removeSkills[i]);
            }

            /*
             * foreach (SkillInfo info in GetSkillStateInfo().GetAllSkill()) {
             * if (info.IsItemSkill && info.IsMarkToRemove) {
             *  removeSkills.Add(info.SkillId);
             * }
             * }
             * foreach (int id in removeSkills) {
             * GetSkillStateInfo().RemoveSkill(id);
             * }*/
            removeSkills.Clear();

            List <int> removeImpacts = new List <int>();

            for (int i = 0; i < GetSkillStateInfo().GetAllImpact().Count; i++)
            {
                if (GetSkillStateInfo().GetAllImpact()[i].m_IsItemImpact && GetSkillStateInfo().GetAllImpact()[i].m_IsMarkToRemove)
                {
                    removeImpacts.Add(GetSkillStateInfo().GetAllImpact()[i].m_ImpactId);
                }
            }
            for (int i = 0; i < removeImpacts.Count; i++)
            {
                if (null != stopImpact)
                {
                    stopImpact(removeImpacts[i]);
                }
            }

            /*
             * foreach (ImpactInfo info in GetSkillStateInfo().GetAllImpact()) {
             * if (info.m_IsItemImpact && info.m_IsMarkToRemove) {
             *  removeImpacts.Add(info.m_ImpactId);
             * }
             * }
             * foreach (int id in removeImpacts) {
             * if (null != stopImpact)
             *  stopImpact(id);
             * }*/
            removeImpacts.Clear();
        }
예제 #25
0
    public void Compare(int leftitem, int leftlevel, int leftpropertyid, int rightitem, int rightlevel, int rightpropertyid, int pos)
    {
        UnityEngine.Transform tf = null;
        isCompareUI = true;
        ID          = rightitem;
        property    = rightpropertyid;
        position    = pos;
        if (leftitem == 0)
        {
            tf = gameObject.transform.Find("SpriteBackLeft");
            if (tf != null)
            {
                NGUITools.SetActive(tf.gameObject, false);
            }
            tf = transform.Find("SpriteBackRight");
            if (tf != null)
            {
                tf.localPosition = new UnityEngine.Vector3(0.0f, 0.0f, 0.0f);
                tf = tf.Find("line/Label");
                if (tf != null)
                {
                    UILabel ul = tf.gameObject.GetComponent <UILabel>();
                    if (ul != null)
                    {
                        ul.text  = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(153);
                        ul.color = UnityEngine.Color.white;
                    }
                }
            }
        }
        else
        {
            tf = gameObject.transform.Find("SpriteBackLeft");
            if (tf != null)
            {
                tf.localPosition = leftLocalPos;
                NGUITools.SetActive(tf.gameObject, true);
            }
            tf = transform.Find("SpriteBackRight");
            if (tf != null)
            {
                tf.localPosition = rightLocalPos;
                tf = tf.Find("line/Label");
                if (tf != null)
                {
                    UILabel ul = tf.gameObject.GetComponent <UILabel>();
                    if (ul != null)
                    {
                        ul.text  = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(152);
                        ul.color = UnityEngine.Color.white;
                    }
                }
            }
        }
        tf = transform.Find("SpriteInlay/Label");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(116);
            }
            NGUITools.SetActive(tf.parent.gameObject, true);
        }
        //     tf = transform.Find("SpriteUpdate/Label");
        //     if (tf != null) {
        //       UILabel ul = tf.gameObject.GetComponent<UILabel>();
        //       if (ul != null) {
        //         ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(117);
        //       }
        //     }
        //     tf = transform.Find("SpriteUpdate/xiaohao");
        //     if (tf != null) {
        //       UILabel ul = tf.gameObject.GetComponent<UILabel>();
        //       if (ul != null) {
        //         ul.text = "";//ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(154);
        //       }
        //     }
        tf = transform.Find("SpriteUpdate");///Sprite
        if (tf != null)
        {
            NGUITools.SetActive(tf.gameObject, false);
        }
        tf = transform.Find("SpriteBuy");
        if (tf != null)
        {
            NGUITools.SetActive(tf.gameObject, false);
        }
        tf = transform.Find("SpriteSale");
        if (tf != null)
        {
            NGUITools.SetActive(tf.gameObject, true);
        }

        ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(rightitem);
        if (itemconfig != null)
        {
            tf = transform.Find("SpriteSale/sale/money");
            if (tf != null)
            {
                UILabel ul = tf.gameObject.GetComponent <UILabel>();
                if (ul != null)
                {
                    ul.text = itemconfig.m_SellingPrice.ToString();
                }
            }
            tf = transform.Find("SpriteBackRight");
            DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Item_Property, tf.gameObject, rightitem);

            //tf = transform.Find("SpriteBackRight/LabelLv");
            //if (tf != null) {
            //  UILabel ul = tf.gameObject.GetComponent<UILabel>();
            //  if (ul != null) {
            //    ul.text = "Lv." + rightlevel;
            //  }
            //}

            //       tf = transform.Find("SpriteUpdate");
            //       if (tf != null) {
            //         NGUITools.SetActive(tf.gameObject, true);
            //         UIButton ub = tf.gameObject.GetComponent<UIButton>();
            //         if (ub != null) {
            //           ub.normalSprite = "db_cs";
            //         }
            //       }
            SetItemHeadProperty(leftitem, leftlevel, leftpropertyid, transform.Find("SpriteBackLeft"));
            SetItemHeadProperty(rightitem, rightlevel, rightpropertyid, transform.Find("SpriteBackRight"));
        }
        CompareProperty(leftitem, leftlevel, leftpropertyid, rightitem, rightlevel, rightpropertyid);
        CalculateUIPosition(transform.Find("SpriteBackLeft"));
        CalculateUIPosition(transform.Find("SpriteBackRight"));
    }
예제 #26
0
    void SetMailIntroduceInfo(ArkCrossEngine.MailInfo mi)
    {
        UnityEngine.Transform tfo = transform.Find("MetalFrame/RoleInfo/DragThing");
        if (tfo != null)
        {
            tfo.localPosition = new UnityEngine.Vector3(0.0f, 11.0f, 0.0f);
        }
        else
        {
            return;
        }
        UnityEngine.Transform tf = tfo.Find("Label");
        if (tf != null)
        {
            if (mi != null)
            {
                nowread = mi.m_MailGuid;
                UILabel ul = tf.gameObject.GetComponent <UILabel>();
                if (ul != null)
                {
                    string str = "";
                    //str += (mi.m_Title + "\n");
                    str    += (mi.m_SendTime.ToString("yyyy/MM/dd/HH/mm/ss") + "\n");
                    str    += mi.m_Text;
                    ul.text = str;
                }
                bool sign = false;
                UnityEngine.Vector3 pos = tf.localPosition;
                pos = new UnityEngine.Vector3(pos.x, pos.y - ul.localSize.y - 15, 0.0f);
                if (mi.m_Money != 0)
                {
                    sign = true;
                    tf   = tfo.Find("Money");
                    if (tf != null)
                    {
                        UnityEngine.GameObject go = tf.gameObject;
                        if (go != null)
                        {
                            UISprite us = go.GetComponent <UISprite>();

                            UnityEngine.Transform tf2 = go.transform.Find("Amount");
                            if (tf2 != null)
                            {
                                UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                if (ul1 != null)
                                {
                                    ul1.text = "X " + mi.m_Money;
                                }
                            }
                            go.transform.localPosition = pos;
                            NGUITools.SetActive(go, true);
                            if (us != null)
                            {
                                pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                            }
                        }
                    }
                }
                if (mi.m_Gold != 0)
                {
                    sign = true;
                    tf   = tfo.Find("Diamond");
                    if (tf != null)
                    {
                        UnityEngine.GameObject go = tf.gameObject;
                        if (go != null)
                        {
                            UISprite us = go.GetComponent <UISprite>();

                            UnityEngine.Transform tf2 = go.transform.Find("Amount");
                            if (tf2 != null)
                            {
                                UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                if (ul1 != null)
                                {
                                    ul1.text = "X " + mi.m_Gold;
                                }
                            }
                            go.transform.localPosition = pos;
                            NGUITools.SetActive(go, true);
                            if (us != null)
                            {
                                pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                            }
                        }
                    }
                }
                //         if (mi.m_Gold != 0) {
                //           sign = true;
                //           tf = tfo.Find("Exp");
                //           if (tf != null) {
                //             UnityEngine.GameObject go = tf.gameObject;
                //             if (go != null) {
                //               UISprite us = go.GetComponent<UISprite>();
                //
                //               UnityEngine.Transform tf2 = go.transform.Find("Amount");
                //               if (tf2 != null) {
                //                 UILabel ul1 = tf2.gameObject.GetComponent<UILabel>();
                //                 if (ul1 != null) {
                //                   ul1.text = "X " + mi.m_Gold;
                //                 }
                //               }
                //               go.transform.localPosition = pos;
                //               NGUITools.SetActive(go, true);
                //               if (us != null) {
                //                 pos = new UnityEngine.Vector3(pos.x, pos.y - us.localSize.y - 15, 0.0f);
                //               }
                //             }
                //           }
                //         }
                if (mi.m_Items != null)
                {
                    foreach (ArkCrossEngine.MailItem mailitem in mi.m_Items)
                    {
                        if (mailitem != null)
                        {
                            sign = true;
                            ArkCrossEngine.ItemConfig ic = ArkCrossEngine.LogicSystem.GetItemDataById(mailitem.m_ItemId);
                            if (ic != null)
                            {
                                UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/Mail/MailAward"));
                                if (go != null)
                                {
                                    UITexture ut = go.GetComponent <UITexture>();
                                    if (ut != null)
                                    {
                                        UnityEngine.Texture tt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName);
                                        if (tt != null)
                                        {
                                            ut.mainTexture = tt;
                                        }
                                    }
                                    UnityEngine.Transform tf2 = go.transform.Find("Amount");
                                    if (tf2 != null)
                                    {
                                        UILabel ul1 = tf2.gameObject.GetComponent <UILabel>();
                                        if (ul1 != null)
                                        {
                                            ul1.text = "X " + mailitem.m_ItemNum;
                                        }
                                    }
                                    go = NGUITools.AddChild(tfo.gameObject, go);
                                    if (go != null)
                                    {
                                        go.transform.localPosition = pos;
                                        golist.Add(go);
                                    }
                                    pos = new UnityEngine.Vector3(pos.x, pos.y - ut.localSize.y - 15, 0.0f);
                                }
                            }
                        }
                    }
                }
                if (sign)
                {
                    tf = transform.Find("MetalFrame/RoleInfo/DragThing/ReceiveButton");
                    if (tf != null)
                    {
                        tf.localPosition = new UnityEngine.Vector3(0.0f, pos.y, 0.0f);
                        NGUITools.SetActive(tf.gameObject, true);
                    }
                }
            }
        }
        tf = transform.Find("sp_hongdi1/Label");
        if (tf != null)
        {
            UILabel ul = tf.gameObject.GetComponent <UILabel>();
            if (ul != null)
            {
                ul.text = mi.m_Title;
            }
        }
        //     tf = transform.Find("sp_hongdi2/Label");
        //     if (tf != null) {
        //       UILabel ul = tf.gameObject.GetComponent<UILabel>();
        //       if (ul != null) {
        //         ul.text = mi.m_Title;
        //       }
        //     }
    }
예제 #27
0
 private void CompareProperty(int leftitem, int leftitemlevel, int leftpropertyid, int rightitem, int rightitemlevel, int rightpropertyid)
 {
     if (isCompareUI)
     {
         int    level = 1;
         float  dataL = 0.0f;
         float  dataR = 0.0f;
         string str   = "";
         ArkCrossEngine.ItemConfig itemconfigL = ArkCrossEngine.LogicSystem.GetItemDataById(leftitem);
         ArkCrossEngine.ItemConfig itemconfigR = ArkCrossEngine.LogicSystem.GetItemDataById(rightitem);
         if (itemconfigL != null && itemconfigR != null)
         {
             ArkCrossEngine.AppendAttributeConfig aacL = ArkCrossEngine.AppendAttributeConfigProvider.Instance.GetDataById(leftpropertyid);
             ArkCrossEngine.AppendAttributeConfig aacR = ArkCrossEngine.AppendAttributeConfigProvider.Instance.GetDataById(rightpropertyid);
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddHpMax(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_HpMaxType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddHpMax(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_HpMaxType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(101) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_HpMaxType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddAd(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_AdType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddAd(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_AdType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(102) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_AdType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddADp(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_ADpType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddADp(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_ADpType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(103) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_ADpType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddMDp(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_MDpType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddMDp(1.0f, level, leftitemlevel), itemconfigR.m_AttrData.m_MDpType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(104) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_MDpType) + "[-]\n");
             }
             dataL = (aacL == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacL.GetAddCri(1.0f, level) * 100) /*/ 100.0f*/);
             dataR = (aacR == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacR.GetAddCri(1.0f, level) * 100) /*/ 100.0f*/);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(105) + ((dataR - dataL) > 0.0f ? "+" : "") + UnityEngine.Mathf.FloorToInt((dataR - dataL) /** 100*/) + "%[-]\n");
             }
             dataL = (aacL == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacL.GetAddPow(1.0f, level) * 100) /*/ 100.0f*/);
             dataR = (aacR == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacR.GetAddPow(1.0f, level) * 100) /*/ 100.0f*/);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(106) + ((dataR - dataL) > 0.0f ? "+" : "") + UnityEngine.Mathf.FloorToInt((dataR - dataL) /** 100*/) + "%[-]\n");
             }
             dataL = (aacL == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacL.GetAddBackHitPow(1.0f, level) * 100) /*/ 100.0f*/);
             dataR = (aacR == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacR.GetAddBackHitPow(1.0f, level) * 100) /*/ 100.0f*/);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(107) + ((dataR - dataL) > 0.0f ? "+" : "") + UnityEngine.Mathf.FloorToInt((dataR - dataL) /** 100*/) + "%[-]\n");
             }
             dataL = (aacL == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacL.GetAddCrackPow(1.0f, level) * 100) /*/ 100.0f*/);
             dataR = (aacR == null ? 0.0f : UnityEngine.Mathf.FloorToInt(aacR.GetAddCrackPow(1.0f, level) * 100) /*/ 100.0f*/);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(108) + ((dataR - dataL) > 0.0f ? "+" : "") + UnityEngine.Mathf.FloorToInt((dataR - dataL) /** 100*/) + "%[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddFireDam(1.0f, level), itemconfigR.m_AttrData.m_FireDamType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddFireDam(1.0f, level), itemconfigR.m_AttrData.m_FireDamType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(109) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_FireDamType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddIceDam(1.0f, level), itemconfigR.m_AttrData.m_IceDamType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddIceDam(1.0f, level), itemconfigR.m_AttrData.m_IceDamType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(110) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_IceDamType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddPoisonDam(1.0f, level), itemconfigR.m_AttrData.m_PoisonDamType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddPoisonDam(1.0f, level), itemconfigR.m_AttrData.m_PoisonDamType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(111) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_PoisonDamType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddFireErd(1.0f, level), itemconfigR.m_AttrData.m_FireErdType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddFireErd(1.0f, level), itemconfigR.m_AttrData.m_FireErdType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(112) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_FireErdType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddIceErd(1.0f, level), itemconfigR.m_AttrData.m_IceErdType);
             dataR = UIManager.GetItemPropertyData(itemconfigR.m_AttrData.GetAddIceErd(1.0f, level), itemconfigR.m_AttrData.m_IceErdType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(113) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_IceErdType) + "[-]\n");
             }
             dataL = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddPoisonErd(1.0f, level), itemconfigR.m_AttrData.m_PoisonErdType);
             dataR = UIManager.GetItemPropertyData(itemconfigL.m_AttrData.GetAddPoisonErd(1.0f, level), itemconfigR.m_AttrData.m_PoisonErdType);
             if (UnityEngine.Mathf.Abs(dataR - dataL) > float.Epsilon)
             {
                 str += (((dataR - dataL) > 0.0f ? "[00ffea]" : "[ff0000]") + ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(114) + UIManager.GetItemProtetyStr((dataR - dataL), itemconfigR.m_AttrData.m_PoisonErdType) + "[-]\n");
             }
         }
         if (str.Length != 0)
         {
             str = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(100) + "\n" + str;
         }
         str += itemconfigR.m_Description;
         UnityEngine.Transform tfr = transform.Find("SpriteBackRight/Container/DragThing/Bula");
         if (tfr != null)
         {
             UILabel ul = tfr.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = str;
             }
         }
     }
     //     else {
     //       UnityEngine.Transform tfr = transform.Find("SpriteBackRight/Container/DragThing/Bula");
     //       if (tfr != null) {
     //         UILabel ul = tfr.gameObject.GetComponent<UILabel>();
     //         if (ul != null) {
     //           ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(115);
     //         }
     //       }
     //     }
 }