| | |
| | | {
|
| | | showPoint = _showPoint;
|
| | | job = _job;
|
| | | PutOnClothes(_job, _clothes, suitID);
|
| | |
|
| | | var jobConfig = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | var clothesResId = 0;
|
| | | if (_clothes == 0)
|
| | | {
|
| | | clothesResId = jobConfig.BaseEquip[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_clothes);
|
| | | clothesResId = item == null ? clothesResId = jobConfig.BaseEquip[0] : item.ChangeOrd;
|
| | | }
|
| | | PutOnClothes(_job, clothesResId, suitID);
|
| | |
|
| | | var weaponResId = 0;
|
| | | if (_weaponId == 0)
|
| | | {
|
| | | weaponResId = jobConfig.BaseEquip[1];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_weaponId);
|
| | | weaponResId = item == null ? weaponResId = jobConfig.BaseEquip[1] : item.ChangeOrd;
|
| | | }
|
| | | PutOnWeapon(_job, _weaponId);
|
| | | PutOnSecondary(_job, _secondaryId);
|
| | | PutOnWing(_wingsId);
|
| | |
|
| | | var secondaryResId = 0;
|
| | | if (_secondaryId == 0)
|
| | | {
|
| | | if (job == 1)
|
| | | {
|
| | | secondaryResId = clothesId + 2900;
|
| | | }
|
| | | else
|
| | | {
|
| | | secondaryResId = jobConfig.BaseEquip[2];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_secondaryId);
|
| | | secondaryResId = item == null ? jobConfig.BaseEquip[2] : item.ChangeOrd;
|
| | | }
|
| | | PutOnSecondary(_job, secondaryResId);
|
| | |
|
| | | var wingsResId = 0;
|
| | | if (_wingsId != 0)
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(_wingsId);
|
| | | wingsResId = item == null ? 0 : item.ChangeOrd;
|
| | | }
|
| | | PutOnWing(wingsResId);
|
| | |
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | | public GameObject Show(GameObject clothesModel, int job, int weaponResId, int wingsResId, int secondaryResId, Transform showPoint)
|
| | | {
|
| | | this.showPoint = showPoint;
|
| | | this.job = job;
|
| | | this.clothesModel = clothesModel;
|
| | | PutOnWeapon(job, weaponResId);
|
| | | PutOnSecondary(job, secondaryResId);
|
| | | PutOnWing(wingsResId);
|
| | |
|
| | | return clothesModel;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | clothesModel = null;
|
| | | clothesId = 0;
|
| | | weaponId = 0;
|
| | | wingsId = 0;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnClothes(int _job, int itemID, int suitID)
|
| | | public void PutOnClothes(int _job, int clothesResId, 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 oldClothes = clothesId;
|
| | | if (oldClothes == newClothes)
|
| | | if (clothesId == clothesResId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (oldClothes != 0)
|
| | | if (clothesId != 0)
|
| | | {
|
| | | UnloadClothes();
|
| | | }
|
| | |
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(newClothes, true);
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(clothesResId, true);
|
| | | if (!_prefab)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | clothesResId = config.BaseEquip[0];
|
| | | }
|
| | |
|
| | | LoadClothes(newClothes);
|
| | | clothesId = newClothes;
|
| | | LoadClothes(clothesResId);
|
| | | clothesId = clothesResId;
|
| | |
|
| | | if (clothesModel)
|
| | | {
|
| | |
| | | wingsModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | |
|
| | | LoadClothesEffect(itemID, suitID);
|
| | | LoadClothesEffect(suitID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnWeapon(int _job, int itemID)
|
| | | public void PutOnWeapon(int _job, int resoureceId)
|
| | | {
|
| | | var newWeapon = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | newWeapon = config.BaseEquip[1];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newWeapon = item == null ? config.BaseEquip[1] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var oldWeapon = weaponId;
|
| | | if (oldWeapon == newWeapon)
|
| | | if (oldWeapon == resoureceId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | weaponModel = null;
|
| | | }
|
| | |
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWeapon, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resoureceId, true);
|
| | |
|
| | | if (!prefab)
|
| | | {
|
| | | newWeapon = config.BaseEquip[1];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWeapon, true);
|
| | | resoureceId = config.BaseEquip[1];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resoureceId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | weaponId = newWeapon;
|
| | | weaponId = resoureceId;
|
| | | }
|
| | |
|
| | | public void PutOnSecondary(int _job, int itemID)
|
| | | public void PutOnSecondary(int _job, int secondaryResId)
|
| | | {
|
| | | var newSecondary = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | if (job == 1)
|
| | | {
|
| | | // 这里不再读取默认的副手装备,而是根据套装读取默认的手臂装备
|
| | | newSecondary = clothesId + 2900;
|
| | | }
|
| | | else
|
| | | {
|
| | | newSecondary = config.BaseEquip[2];
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newSecondary = item == null ? config.BaseEquip[2] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var oldSecondary = secondaryId;
|
| | | if (oldSecondary == newSecondary)
|
| | | if (oldSecondary == secondaryResId)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | secondaryModel = null;
|
| | | }
|
| | |
|
| | | if (newSecondary != 0)
|
| | | if (secondaryResId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newSecondary, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId, true);
|
| | | if (!prefab)
|
| | | {
|
| | | newSecondary = config.BaseEquip[2];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newSecondary, true);
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | | secondaryResId = config.BaseEquip[2];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryResId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | secondaryId = newSecondary;
|
| | | secondaryId = secondaryResId;
|
| | | }
|
| | |
|
| | | public void PutOnWing(int itemID)
|
| | | public void PutOnWing(int resourceId)
|
| | | {
|
| | | var newWings = 0;
|
| | | if (itemID != 0)
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newWings = item == null ? 0 : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var config = Config.Instance.Get<JobSetupConfig>(job);
|
| | |
|
| | | var oldWings = wingsId;
|
| | | if (newWings == oldWings)
|
| | | if (resourceId == oldWings)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | wingsModel = null;
|
| | | }
|
| | |
|
| | | if (newWings != 0)
|
| | | if (resourceId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWings, true);
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resourceId, true);
|
| | |
|
| | | if (!prefab)
|
| | | {
|
| | | newWings = config.BaseEquip[3];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWings, true);
|
| | | resourceId = config.BaseEquip[3];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(resourceId, true);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | |
| | | wingsAnimator = wingsModel.GetComponent<Animator>();
|
| | | if (wingsAnimator == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("翅膀资源{0}没有动画控制器", itemID);
|
| | | DebugEx.LogErrorFormat("翅膀资源{0}没有动画控制器", resourceId);
|
| | | }
|
| | | wingsAnimator.enabled = true;
|
| | | wingsAnimator.Play("UI_Idle", 0);
|
| | | }
|
| | | }
|
| | |
|
| | | wingsId = newWings;
|
| | | wingsId = resourceId;
|
| | | }
|
| | |
|
| | | private PlayerSuitModel SuitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | | private PlayerPackModel PlayerBackModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public void LoadClothesEffect(int clothedID, int suitLevel)
|
| | | public void LoadClothesEffect(int suitLevel)
|
| | | {
|
| | | UnloadClothedEffect();
|
| | |
|