// mount/unmount buff public static SkBuffInst MountBuff(SkEntity target, int buffId, List <int> idxList, List <float> valList) // To save memory ,idxList should be increase step by step { int maxIdx = 0; int n = idxList != null ? idxList.Count : 0; for (int i = 0; i < n; i++) { if (idxList[i] > maxIdx) { maxIdx = idxList[i]; } } SkAttribs buffAttribs = new SkAttribs(null, maxIdx + 1); for (int i = 0; i < n; i++) { int idx = idxList[i]; buffAttribs.sums[idx] = buffAttribs.raws[idx] = valList[i]; } //lz-2016.08.22 引导检测玩家进入buff Pathea.PeEntity entity = target.GetComponent <Pathea.PeEntity>(); if (null != entity && entity.IsMainPlayer) { InGameAidData.CheckInBuff(buffId); } return(SkBuffInst.Mount(target._attribs.pack as SkPackage, SkBuffInst.Create(buffId, buffAttribs, target._attribs))); }
// Override protected override void PushIn(params int[] ids) { List <ItemToPack> lstItems = new List <ItemToPack>(); int n = ids.Length; for (int i = 0; i < n;) { if (IsBuff(ids[i])) { SkBuffInst.Mount(this, SkBuffInst.Create(ids[i], null, _parentAttribs)); i += 2; } //Ignore cnt else { lstItems.Add(new ItemToPack(ids[i], ids[i + 1])); i += 2; } } if (lstItems.Count > 0) { _parentAttribs.OnPutInPakAttribs(lstItems); } }