| | |
| | | [SerializeField, Header("展示时间")] float m_DisplayTime = 15f;
|
| | | [SerializeField, Header("特效位置")] Vector3 m_EffectPosition = Vector3.zero;
|
| | |
|
| | | UI3DShowHero showHero = new UI3DShowHero();
|
| | | GameObject clothesModel;
|
| | | Animator clothesAnimator;
|
| | |
|
| | | Transform showPoint;
|
| | |
|
| | | List<SFXController> closthesSFXList = new List<SFXController>();
|
| | |
|
| | | static RealmBossShow m_Instance = null;
|
| | | public static RealmBossShow Instance
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | var _hero = showHero.Show(_job, _clothesId, _suitLevel, _weaponId, _wingsId, _secondaryId, m_HeroStage);
|
| | | showPoint = m_HeroStage;
|
| | | var _hero = ShowHero(_job, _clothesId, _suitLevel, _weaponId, _wingsId, _secondaryId);
|
| | | if (_hero != null)
|
| | | {
|
| | | showHero.SitDown();
|
| | | SitDown();
|
| | | LayerUtility.SetLayer(m_HeroStage.gameObject, LayerUtility.BossShow, true);
|
| | | }
|
| | | }
|
| | |
| | | showCamera.enabled = false;
|
| | | m_Effect.gameObject.SetActive(false);
|
| | | transform.localPosition = new Vector3(0, 4000, 5000);
|
| | | showHero.Dispose();
|
| | | if (m_Effect != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | m_Effect = null;
|
| | | }
|
| | |
|
| | | for (int i = closthesSFXList.Count - 1; i >= 0; i--)
|
| | | {
|
| | | if (closthesSFXList[i] != null)
|
| | | {
|
| | | Destroy(closthesSFXList[i].gameObject);
|
| | | }
|
| | | }
|
| | | closthesSFXList.Clear();
|
| | |
|
| | | if (clothesModel != null)
|
| | | {
|
| | | Destroy(clothesModel);
|
| | | clothesModel = null;
|
| | | clothesAnimator = null;
|
| | | }
|
| | | }
|
| | |
|
| | | GameObject ShowHero(int _job, int _clothes, int suitID, int _weaponId, int _wingsId, int _secondaryId)
|
| | | {
|
| | | PutOnClothes(_job, _clothes, suitID);
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | | public void SitDown()
|
| | | {
|
| | | if (clothesModel != null)
|
| | | {
|
| | | var animator = clothesModel.GetComponent<Animator>();
|
| | | animator.Play(GAStaticDefine.State_SitDown);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnClothes(int _job, int itemID, int suitID)
|
| | | {
|
| | | var newClothes = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newClothes = item == null ? newClothes = config.BaseEquip[0] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(newClothes);
|
| | | if (!_prefab)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | }
|
| | |
|
| | | LoadClothes(newClothes);
|
| | |
|
| | | LoadClothesEffect(_job, itemID, suitID);
|
| | | }
|
| | |
|
| | | private void LoadClothes(int resID)
|
| | | {
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(resID);
|
| | | if (clothesModel == null)
|
| | | {
|
| | | clothesModel = Instantiate(prefab, Constants.Special_Hide_Position, Quaternion.identity);
|
| | | }
|
| | |
|
| | | clothesModel.transform.SetParent(null);
|
| | | clothesModel.transform.localScale = Vector3.one;
|
| | |
|
| | | LayerUtility.SetLayer(clothesModel, LayerUtility.Player, false);
|
| | | var skinnedMeshRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>(true);
|
| | | LayerUtility.SetLayer(skinnedMeshRenderer.gameObject, LayerUtility.Player, false);
|
| | | clothesModel.SetActive(true);
|
| | | clothesModel.transform.SetParentEx(showPoint, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | clothesAnimator = clothesModel.GetComponent<Animator>();
|
| | |
|
| | | if (clothesAnimator == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("角色资源: {0} 没有动画控制器", resID);
|
| | | }
|
| | |
|
| | | // 动画状态机修改
|
| | | if (clothesAnimator)
|
| | | {
|
| | | RuntimeAnimatorController _controller = AnimatorControllerLoader.Load(AnimatorControllerLoader.controllerUISuffix, resID);
|
| | | clothesAnimator.runtimeAnimatorController = _controller;
|
| | | clothesAnimator.enabled = true;
|
| | | }
|
| | | }
|
| | |
|
| | | public void LoadClothesEffect(int job,int clothedID, int suitLevel)
|
| | | {
|
| | | var _equipModel = ModelCenter.Instance.GetModel<PlayerPackModel>().GetSinglePackModel(PackType.rptEquip);
|
| | | if (_equipModel == null)
|
| | | {
|
| | | if (DTC0309_tagPlayerLoginInfo.equipSuitID > 0)
|
| | | {
|
| | | PutOnEffect(DTC0309_tagPlayerLoginInfo.equipSuitID);
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | int _suitCount = 0;
|
| | |
|
| | | int _start = (int)RoleEquipType.retHat;
|
| | | int _end = (int)RoleEquipType.retShoes;
|
| | |
|
| | | ItemModel _itemModel = null;
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retClothes);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | int _rank = _itemModel.chinItemModel.LV;
|
| | |
|
| | | for (int i = _start; i <= _end; ++i)
|
| | | {
|
| | | _itemModel = _equipModel.GetItemModelByIndex(i);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (_itemModel.chinItemModel.SuiteiD <= 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (i == (int)RoleEquipType.retClothes)
|
| | | {
|
| | | _rank = _itemModel.chinItemModel.LV;
|
| | | }
|
| | |
|
| | | var suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>();
|
| | | if (suitModel.suitModelDict.ContainsKey(i))
|
| | | {
|
| | | if (suitModel.suitModelDict[i].ContainsKey(1)
|
| | | || suitModel.suitModelDict[i].ContainsKey(2))
|
| | | {
|
| | | if (_itemModel.chinItemModel.LV >= _rank)
|
| | | {
|
| | | _suitCount += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (_suitCount == 5)
|
| | | {
|
| | | int _type = 1;
|
| | |
|
| | | int _suitEffectID = _type * 1000 + job * 100 + _rank;
|
| | |
|
| | | PutOnEffect(_suitEffectID);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnEffect(int id)
|
| | | {
|
| | | SuitEffectConfig _suitEffect = Config.Instance.Get<SuitEffectConfig>(id);
|
| | |
|
| | | // 上特效
|
| | | if (_suitEffect != null)
|
| | | {
|
| | | Transform _parent = null;
|
| | | SFXController _sfx = null;
|
| | | for (int i = 0; _suitEffect.bindbones != null && i < _suitEffect.bindbones.Length; ++i)
|
| | | {
|
| | | if (string.IsNullOrEmpty(_suitEffect.bindbones[i])
|
| | | || _suitEffect.effectIds[i] == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | _parent = clothesModel.transform.GetChildTransformDeeply(_suitEffect.bindbones[i]);
|
| | |
|
| | | if (_parent == null)
|
| | | {
|
| | | Debug.LogErrorFormat("套装: {0} 配置的骨骼节点: {1} 不存在", id, _suitEffect.bindbones[i]);
|
| | | continue;
|
| | | }
|
| | |
|
| | | _sfx = SFXPlayUtility.Instance.PlayBattleEffect(_suitEffect.effectIds[i], _parent);
|
| | | closthesSFXList.Add(_sfx);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |