Esempio n. 1
0
        private void FocusHeroPicked(COM_PLAYERCAMP listCamp, int listIndex)
        {
            if (this._heroWrapDict == null)
            {
                return;
            }
            HeroInfoItem heroInfoItem = null;

            DictionaryView <uint, HeroInfoItem> .Enumerator enumerator = this._heroWrapDict.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, HeroInfoItem> current = enumerator.get_Current();
                HeroInfoItem value = current.get_Value();
                if (value.listCamp == listCamp && value.listIndex == listIndex)
                {
                    heroInfoItem = value;
                    break;
                }
            }
            if (heroInfoItem != null)
            {
                MonoSingleton <CameraSystem> .get_instance().ToggleFreeDragCamera(false);

                MonoSingleton <CameraSystem> .get_instance().SetFocusActor(heroInfoItem.HeroInfo.actorHero);

                this._pickedHero = heroInfoItem.HeroInfo.actorHero;
                this._heroInfoHud.SetPickHero(heroInfoItem.HeroInfo);
                if (listCamp == 1)
                {
                    this._camp1BaseList.SelectElement(listIndex, false);
                    this._camp2BaseList.SelectElement(-1, false);
                }
                else if (listCamp == 2)
                {
                    this._camp2BaseList.SelectElement(listIndex, false);
                    this._camp1BaseList.SelectElement(-1, false);
                }
                else
                {
                    this._camp1BaseList.SelectElement(-1, false);
                    this._camp2BaseList.SelectElement(-1, false);
                }
            }
            else
            {
                this._pickedHero.Release();
                this._camp1BaseList.SelectElement(-1, false);
                this._camp2BaseList.SelectElement(-1, false);
            }
        }
Esempio n. 2
0
        private void FocusHeroPicked(COM_PLAYERCAMP listCamp, int listIndex)
        {
            if (this._heroWrapDict != null)
            {
                HeroInfoItem item = null;
                DictionaryView <uint, HeroInfoItem> .Enumerator enumerator = this._heroWrapDict.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    KeyValuePair <uint, HeroInfoItem> current = enumerator.Current;
                    HeroInfoItem item2 = current.Value;
                    if ((item2.listCamp == listCamp) && (item2.listIndex == listIndex))
                    {
                        item = item2;
                        break;
                    }
                }
                if (item != null)
                {
                    MonoSingleton <CameraSystem> .instance.ToggleFreeDragCamera(false);

                    MonoSingleton <CameraSystem> .instance.SetFocusActor(item.HeroInfo.actorHero);

                    this._pickedHero = item.HeroInfo.actorHero;
                    this._heroInfoHud.SetPickHero(item.HeroInfo);
                    if (listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                    {
                        this._camp1BaseList.SelectElement(listIndex, false);
                        this._camp2BaseList.SelectElement(-1, false);
                    }
                    else if (listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                    {
                        this._camp2BaseList.SelectElement(listIndex, false);
                        this._camp1BaseList.SelectElement(-1, false);
                    }
                    else
                    {
                        this._camp1BaseList.SelectElement(-1, false);
                        this._camp2BaseList.SelectElement(-1, false);
                    }
                }
                else
                {
                    this._pickedHero.Release();
                    this._camp1BaseList.SelectElement(-1, false);
                    this._camp2BaseList.SelectElement(-1, false);
                }
            }
        }
Esempio n. 3
0
 private void InitCampInfoUIList(COM_PLAYERCAMP listCamp, List <HeroKDA> heroList, CUIListScript baseInfoUIList, CUIListScript equipInfoUIList, CUIListScript sideInfoList = null)
 {
     if (null == baseInfoUIList || heroList == null || heroList.get_Count() == 0)
     {
         return;
     }
     baseInfoUIList.SetElementAmount(5);
     equipInfoUIList.SetElementAmount(5);
     if (sideInfoList != null)
     {
         sideInfoList.SetElementAmount(5);
     }
     for (int i = 0; i < 5; i++)
     {
         GameObject gameObject  = baseInfoUIList.GetElemenet(i).gameObject;
         GameObject gameObject2 = equipInfoUIList.GetElemenet(i).gameObject;
         GameObject gameObject3 = null;
         if (sideInfoList != null)
         {
             gameObject3 = sideInfoList.GetElemenet(i).gameObject;
         }
         if (i < heroList.get_Count())
         {
             HeroKDA      heroKDA = heroList.get_Item(i);
             HeroInfoItem value   = new HeroInfoItem(listCamp, i, heroKDA, gameObject, gameObject2);
             if (gameObject3 != null)
             {
                 HeroInfoSideItem value2 = new HeroInfoSideItem(listCamp, heroKDA, i, gameObject3);
                 this._heroWrapSideDict.Add(heroKDA.actorHero.handle.ObjID, value2);
             }
             this._heroWrapDict.Add(heroKDA.actorHero.handle.ObjID, value);
         }
         else
         {
             HeroInfoItem.MakeEmpty(gameObject, gameObject2);
             if (sideInfoList != null)
             {
                 HeroInfoSideItem.MakeEmpty(gameObject3);
             }
         }
     }
 }
Esempio n. 4
0
        private void OnSkillCDChanged(ref DefaultSkillEventParam _param)
        {
            if (this._heroInfoHud != null && _param.actor.handle.ObjID == this._heroInfoHud.PickedHeroID)
            {
                this._heroInfoHud.TheSkillHud.ValidateCD(_param.slot);
            }
            HeroInfoItem heroInfoItem = null;

            if (this._heroWrapDict.TryGetValue(_param.actor.handle.ObjID, out heroInfoItem))
            {
                heroInfoItem.ValidateCD(_param.slot, _param.actor);
            }
            if (WatchForm.IsNeedShowCampMidInterface())
            {
                HeroInfoSideItem heroInfoSideItem = null;
                if (this._heroWrapSideDict.TryGetValue(_param.actor.handle.ObjID, out heroInfoSideItem) && _param.slot == SkillSlotType.SLOT_SKILL_3)
                {
                    heroInfoSideItem.ValidateSkill3();
                }
            }
        }
Esempio n. 5
0
 private void InitCampInfoUIList(COM_PLAYERCAMP listCamp, List <HeroKDA> heroList, CUIListScript baseInfoUIList, CUIListScript equipInfoUIList)
 {
     if (((null != baseInfoUIList) && (heroList != null)) && (heroList.Count != 0))
     {
         baseInfoUIList.SetElementAmount(5);
         equipInfoUIList.SetElementAmount(5);
         for (int i = 0; i < 5; i++)
         {
             GameObject gameObject    = baseInfoUIList.GetElemenet(i).gameObject;
             GameObject equipInfoItem = equipInfoUIList.GetElemenet(i).gameObject;
             if (i < heroList.Count)
             {
                 HeroKDA      okda = heroList[i];
                 HeroInfoItem item = new HeroInfoItem(listCamp, i, okda, gameObject, equipInfoItem);
                 this._heroWrapDict.Add(okda.actorHero.handle.ObjID, item);
             }
             else
             {
                 HeroInfoItem.MakeEmpty(gameObject, equipInfoItem);
             }
         }
     }
 }
Esempio n. 6
0
 private void InitCampInfoUIList(COM_PLAYERCAMP listCamp, List <HeroKDA> heroList, CUIListScript baseInfoUIList, CUIListScript equipInfoUIList)
 {
     if (null == baseInfoUIList || heroList == null || heroList.get_Count() == 0)
     {
         return;
     }
     baseInfoUIList.SetElementAmount(5);
     equipInfoUIList.SetElementAmount(5);
     for (int i = 0; i < 5; i++)
     {
         GameObject gameObject  = baseInfoUIList.GetElemenet(i).gameObject;
         GameObject gameObject2 = equipInfoUIList.GetElemenet(i).gameObject;
         if (i < heroList.get_Count())
         {
             HeroKDA      heroKDA      = heroList.get_Item(i);
             HeroInfoItem heroInfoItem = new HeroInfoItem(listCamp, i, heroKDA, gameObject, gameObject2);
             this._heroWrapDict.Add(heroKDA.actorHero.get_handle().ObjID, heroInfoItem);
         }
         else
         {
             HeroInfoItem.MakeEmpty(gameObject, gameObject2);
         }
     }
 }
Esempio n. 7
0
        private void FocusHero(COM_PLAYERCAMP listCamp, int listIndex)
        {
            if (this._heroWrapDict == null)
            {
                return;
            }
            HeroInfoItem heroInfoItem = null;

            DictionaryView <uint, HeroInfoItem> .Enumerator enumerator = this._heroWrapDict.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, HeroInfoItem> current = enumerator.Current;
                HeroInfoItem value = current.get_Value();
                if (value.listCamp == listCamp && value.listIndex == listIndex)
                {
                    heroInfoItem = value;
                    break;
                }
            }
            if (heroInfoItem != null)
            {
                COM_PLAYERCAMP horizonCamp = Singleton <WatchController> .GetInstance().HorizonCamp;

                if (horizonCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT && horizonCamp != heroInfoItem.HeroInfo.actorHero.handle.TheActorMeta.ActorCamp)
                {
                    MonoSingleton <CameraSystem> .instance.MobaCamera.SetAbsoluteLockLocation((Vector3)heroInfoItem.HeroInfo.actorHero.handle.location);

                    this.FreeFocus();
                }
                else
                {
                    MonoSingleton <CameraSystem> .instance.ToggleFreeDragCamera(false);

                    MonoSingleton <CameraSystem> .instance.SetFocusActor(heroInfoItem.HeroInfo.actorHero);
                }
                if (heroInfoItem != null && heroInfoItem.HeroInfo != null && this._camp1BaseList != null && this._camp2BaseList != null)
                {
                    this._focusHero = heroInfoItem.HeroInfo.actorHero;
                    if (this._heroInfoHud != null)
                    {
                        this._heroInfoHud.SetPickHero(heroInfoItem.HeroInfo);
                    }
                    if (listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                    {
                        this._camp1BaseList.SelectElement(listIndex, false);
                        this._camp2BaseList.SelectElement(-1, false);
                    }
                    else if (listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                    {
                        this._camp2BaseList.SelectElement(listIndex, false);
                        this._camp1BaseList.SelectElement(-1, false);
                    }
                    else
                    {
                        this._camp1BaseList.SelectElement(-1, false);
                        this._camp2BaseList.SelectElement(-1, false);
                    }
                }
            }
            else
            {
                this.FreeFocus();
            }
        }