Exemple #1
0
        public void Prepare(WeaponPartsStruct attachments)
        {
            Reset();
            _attachmentList.Add(attachments.UpperRail);
            _attachmentList.Add(attachments.LowerRail);
            _attachmentList.Add(attachments.Muzzle);
            _attachmentList.Add(attachments.Magazine);
            _attachmentList.Add(attachments.Stock);
            for (var i = 0; i < _attachmentList.Count; i++)
            {
                if (_attachmentList[i] < 1)
                {
                    continue;
                }

                var modifiedInfos = _attachConfigManager.GetModifyInfos(_attachmentList[i]);
                if (null == modifiedInfos)
                {
                    continue;
                }

                foreach (var info in modifiedInfos)
                {
                    _attachAttributeDic[info.Type] += info.Val;
                }
            }
        }
Exemple #2
0
        public WeaponPartsStruct Clone()
        {
            var result = new WeaponPartsStruct();

            result.UpperRail = UpperRail;
            result.LowerRail = LowerRail;
            result.Magazine  = Magazine;
            result.Stock     = Stock;
            result.Muzzle    = Muzzle;
            return(result);
        }