Beispiel #1
0
        private void RegenerateInTeamHeroModels()
        {
            DespawnCharacter();
            for (int i = 0; i < 9; i++)
            {
                FormationPosition formationPosition = (FormationPosition)(i + 1);
                uint roleID = ManageHeroesProxy.instance.GetCharacterInstanceIDAt(formationPosition);
                //uint cachedRoleID = 0;
                //_cachedFormationDic.TryGetValue(formationPosition, out cachedRoleID);

                //if (roleID != cachedRoleID)
                //{
                TransformUtil.ClearChildren(roleModelRoots[i], true);
                if (!ManageHeroesProxy.instance.IsPositionEmpty(formationPosition))
                {
                    if (GameProxy.instance.IsPlayer(roleID))
                    {
                        PlayerInfo      playerInfo      = GameProxy.instance.PlayerInfo;
                        CharacterEntity characterEntity = CharacterEntity.CreatePlayerEntityAsUIElement(playerInfo, roleModelRoots[i], false, false);
                        _characters.Add(characterEntity);
                    }
                    else
                    {
                        HeroInfo   heroInfo   = HeroProxy.instance.GetHeroInfo(roleID);
                        HeroEntity heroEntity = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, roleModelRoots[i], false, false);
                        _characters.Add(heroEntity);
                    }
                }
                _cachedFormationDic.AddOrReplace(formationPosition, roleID);
                //}
                formationBaseImages[i].SetSprite(roleID > 0 || ManageHeroesProxy.instance.CurrentFormationTeamInfo.formationInfo.formationData.GetPosEnalbe(formationPosition) ? _formationOccupiedSprite : _formationNormalSprite);
                roleShadows[i].gameObject.SetActive(roleID > 0);
            }
        }
Beispiel #2
0
        private IEnumerator RefreshRoleModelCoroutine()
        {
            DespawnCharacter();
            TransformUtil.ClearChildren(roleModelRoot, true);
            yield return(new WaitForSeconds(0.4f));

            PlayerInfo playerInfo = _roleInfo as PlayerInfo;
            HeroInfo   heroInfo   = _roleInfo as HeroInfo;

            if (playerInfo != null)
            {
                CharacterEntity characterEntity = CharacterEntity.CreatePlayerEntityAsUIElement(playerInfo, roleModelRoot, true, true);
                Action.Controller.ActionController.instance.PlayerAnimAction(characterEntity, AnimatorUtil.VICOTRY_ID);
            }
            else if (heroInfo != null)
            {
                bool canClick = true;
                if (_roleInfo.heroData.hero_type == 4)//boss
                {
                    canClick = false;
                }
                _characterEntity = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, roleModelRoot, canClick, true);
                if (canClick)
                {
                    Action.Controller.ActionController.instance.PlayerAnimAction(_characterEntity, AnimatorUtil.VICOTRY_ID);
                }
            }
        }
 private void RegenerateInTeamHeroModels()
 {
     DespawnCharacter();
     for (int i = 0; i < 9; i++)
     {
         TransformUtil.ClearChildren(roleModelRoots[i], true);
         FormationPosition formationPosition = (FormationPosition)(i + 1);
         if (!ExpeditionFormationProxy.instance.IsPositionEmpty(formationPosition))
         {
             uint roleID = ExpeditionFormationProxy.instance.GetCharacterInstanceIDAt(formationPosition);
             if (GameProxy.instance.IsPlayer(roleID))
             {
                 PlayerInfo   playerInfo   = GameProxy.instance.PlayerInfo;
                 PlayerEntity playerEntity = CharacterEntity.CreatePlayerEntityAsUIElement(playerInfo, roleModelRoots[i], false, false);
                 _characters.Add(playerEntity);
             }
             else
             {
                 HeroInfo   heroInfo   = HeroProxy.instance.GetHeroInfo(roleID);
                 HeroEntity heroEntity = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, roleModelRoots[i], false, false);
                 _characters.Add(heroEntity);
             }
             roleShadows[i].gameObject.SetActive(true);
             formationBaseButtons[i].GetComponent <Image>().SetSprite(_formationOccupiedSprite);
         }
         else
         {
             roleShadows[i].gameObject.SetActive(false);
             formationBaseButtons[i].GetComponent <Image>().SetSprite(ExpeditionFormationProxy.instance.FormationTeamInfo.formationInfo.formationData.GetPosEnalbe(formationPosition) ? _formationOccupiedSprite : _formationNormalSprite);
         }
     }
 }
Beispiel #4
0
 private void ResetHero()
 {
     textHeroName.text = Localization.Get(_heroInfo.heroData.name);
     for (int i = 0; i < heroStars.Length; i++)
     {
         heroStars[i].SetActive(i < _heroInfo.advanceLevel);
     }
     DespawnCharacter();
     TransformUtil.ClearChildren(heroModelRootTransform, true);
     _characterEntity = CharacterEntity.CreateHeroEntityAsUIElement(_heroInfo, heroModelRootTransform, false, true);
 }
Beispiel #5
0
        private void ResetHeroModels()
        {
            HeroInfo heroInfo = HeroAdvanceProxy.instance.advanceHeroInfo;

            for (int i = 0; i < beforeAdvanceStarImages.Length; i++)
            {
                beforeAdvanceStarImages[i].gameObject.SetActive(false);
                if (heroInfo.advanceLevel > i)
                {
                    beforeAdvanceStarImages[i].gameObject.SetActive(true);
                }
            }
            beforeAdvanceLeveText.text = heroInfo.level.ToString();
            beforeAdvanceRoleTypeImage.SetSprite(UIUtil.GetRoleTypeSmallIconSprite(heroInfo.heroData.roleType));
            beforeAdvanceRoleTypeImage.SetNativeSize();
            DespawnCharacter(_characterEntity1);
            TransformUtil.ClearChildren(beforeAdvanceModelRootTransform, true);
            _characterEntity1 = CharacterEntity.CreateHeroEntityAsUIElement(heroInfo, beforeAdvanceModelRootTransform, false, true);

            DespawnCharacter(_characterEntity2);
            if (!heroInfo.IsMaxAdvanceLevel)
            {
                HeroInfo mockAfterAdvanceHeroInfo = new HeroInfo(heroInfo.instanceID, heroInfo.heroData.id,
                                                                 heroInfo.breakthroughLevel, heroInfo.strengthenLevel,
                                                                 heroInfo.advanceLevel + 1);

                for (int i = 0; i < afterAdvanceStarImages.Length; i++)
                {
                    afterAdvanceStarImages[i].gameObject.SetActive(false);
                    if (mockAfterAdvanceHeroInfo.advanceLevel > i)
                    {
                        afterAdvanceStarImages[i].gameObject.SetActive(true);
                    }
                }
                afterAdvanceLeveText.text = "1";
                afterAdvanceRoleTypeImage.SetSprite(UIUtil.GetRoleTypeSmallIconSprite(mockAfterAdvanceHeroInfo.heroData.roleType));
                afterAdvanceRoleTypeImage.SetNativeSize();
                TransformUtil.ClearChildren(afterAdvanceModelRootTransform, true);
                _characterEntity2 = CharacterEntity.CreateHeroEntityAsUIElement(mockAfterAdvanceHeroInfo, afterAdvanceModelRootTransform, false, true);
                arrowGameObject.SetActive(true);
            }
            else
            {
                //				centerPartGameObject.SetActive(false);
                afterAdvanceHeroRootGameObject.SetActive(false);
                TransformUtil.ClearChildren(afterAdvanceModelRootTransform, true);
                LeanTween.moveLocalX(beforeAdvanceHeroRootGameObject, 0, 0.2f);
                arrowGameObject.SetActive(false);
            }
        }
Beispiel #6
0
        private void OnWorldBossInfoUpdateHandler()
        {
            HeroData bossData = HeroData.GetHeroDataByID(WorldBossProxy.instance.BossID);

            if (!_isBossModelLoaded)
            {
                DespawnCharacter();
                TransformUtil.ClearChildren(bossModelRoot, true);
                _characterEntity   = CharacterEntity.CreateHeroEntityAsUIElement(bossData.modelNames[bossData.starMax - 1], bossModelRoot, false, true);
                _isBossModelLoaded = true;
            }
            worldBossLevelText.text = string.Format(Localization.Get("ui.world_boss_view.boss_level"), WorldBossProxy.instance.BossLevel.ToString());
            worldBossNameText.text  = Localization.Get(bossData.name);
            bossHPText.text         = WorldBossProxy.instance.BossCurrHP + "/" + WorldBossProxy.instance.BossHPUpperLimit;
            bossHpSlider.value      = WorldBossProxy.instance.BossCurrHP * 1.0f / WorldBossProxy.instance.BossHPUpperLimit;

            RefreshDamageRankingInfo();
            RefreshInspireEffect();
            CheckAndResetViewState();
        }