/// <summary> /// 过滤出装备列表中的时装列表,并删除原列表中的时装id /// </summary> /// <param name="modle_list"></param> /// <returns></returns> public static void GetModelFashionList(List <uint> all_model_list, List <uint> model_list, List <uint> fashion_list) { if (all_model_list == null || model_list == null || fashion_list == null) { return; } DBAvatarPart db = DBManager.Instance.GetDB <DBAvatarPart>(); if (db == null) { return; } for (int i = all_model_list.Count - 1; i >= 0; --i) { uint model_id = all_model_list[i]; if (db.IsFashion(model_id)) { fashion_list.Add(model_id); //all_modle_list.RemoveAt(i); } else { model_list.Add(model_id); } } }
public static Data GetAvatarPartData(uint avatarId) { DBAvatarPart dbAvatarPart = DBManager.GetInstance().GetDB <DBAvatarPart>(); Data data = null; if (dbAvatarPart.mData.TryGetValue(avatarId, out data)) { return(data); } return(null); }
/// <summary> /// 换装部件是否属于时装 /// </summary> /// <param name="avatarId"></param> /// <returns></returns> public bool IsFashion(uint avatarId) { DBAvatarPart dbAvatarPart = DBManager.GetInstance().GetDB <DBAvatarPart>(); Data data = null; if (dbAvatarPart.mData.TryGetValue(avatarId, out data)) { return(data.isFashion); } return(false); }
/// <summary> /// 将模型列表中的BODY替换成高模 /// </summary> public static List <uint> ReplaceModelList(List <uint> model_list, Actor.EVocationType vocation, bool newList = false) { // 暂时使用之前的model_list return(model_list); List <uint> modelList = null; if (newList) { modelList = new List <uint>(model_list); } else { modelList = model_list; } if (modelList == null) { GameDebug.LogError("[ReplaceModelList]ModelList is null"); return(null); } if (modelList.Count > 0) { for (int k = 0; k < modelList.Count; ++k) { DBAvatarPart dbAvatar = DBManager.GetInstance().GetDB <DBAvatarPart>(); DBAvatarPart.Data data = null; dbAvatar.mData.TryGetValue(modelList[k], out data); if (data != null) { if (data.part == DBAvatarPart.BODY_PART.BODY) { // 替换bodypart modelList[k] = modelList[k] * 100; } } } } else { DBAvatarDefault.Data defaultAvatar = null; if (DBManager.GetInstance().GetDB <DBAvatarDefault>().mData.TryGetValue(vocation, out defaultAvatar)) { modelList.Add(defaultAvatar.bodyId * 100); modelList.Add(defaultAvatar.weaponId); } } return(modelList); }
public IEnumerator SetFootprintId(uint footprintId) { if (footprintId <= 0) { Clear(); yield break; } if (mFootprintId == footprintId) { yield break; } DBFootprint.DBFootprintItem item = DBFootprint.GetFootprintItem(footprintId); if (item == null) { yield break; } mSceneEffectFile = item.SuitablePath(true); mSceneEffectDelayTime = item.DelayTime; mCDTime = item.CDTime; mMinDistance = item.MinDistance; mCreateTime = 0; //var avatarPart = DBManager.Instance.GetDB<DBAvatarPart>().mData[footprintId]; var avatarPart = DBAvatarPart.GetAvatarPartData(footprintId); if (avatarPart == null) { yield break; } mStandEffectFile = avatarPart.SuitablePath(true); if (mOwner == null || mOwner.transform == null) { yield break; } Vector3 pos = mOwner.transform.position; pos.y = PhysicsHelp.GetHeight(pos.x, pos.z); mLastEffectPos = pos; mFootprintId = footprintId; if (mOwner.IsUIModel()) { yield return(ResourceLoader.Instance.StartCoroutine(LoadStandEffect(mStandEffectFile))); } }
public static uint GetPartInList(List <uint> fashionList, DBAvatarPart.BODY_PART part) { DBAvatarPart db = DBManager.Instance.GetDB <DBAvatarPart>(); if (db == null) { return(0); } for (int i = 0; i < fashionList.Count; i++) { uint fashion = fashionList[i]; if (DBManager.Instance.GetDB <DBAvatarPart>().mData.ContainsKey(fashion)) { var item = DBManager.Instance.GetDB <DBAvatarPart>().mData[fashion]; if (item.part == part) { return(fashion); } } } return(0); }