예제 #1
0
            // 构造对象
            public ArmorPartObject(PlayerArmorCmpt character, ArmorPartData data, ItemObject item)
            {
                _character  = character;
                _data       = data;
                _item       = item;
                _armorID[0] = item.instanceId;

                _boneGroup = -1;
                _boneIndex = -1;

                if (data.type == ArmorType.Decoration)
                {
                    _character._decorationCount++;
                }
                _durability = _item.GetCmpt <Durability>();

                SyncAttachedBone();

                // 添加防御效果
                AddDefence();

                if (_character.hasModelLayer)
                {
                    CreateModel();
                }

                _character.TriggerAddOrRemoveEvent();
            }
예제 #2
0
            // 移除装甲部件
            public void RemoveArmorPart()
            {
                if (_data.type == ArmorType.Decoration)
                {
                    _character._decorationCount--;
                    _character._boneNodes[_boneGroup][_boneIndex].decoration = null;
                }
                else
                {
                    _character._boneNodes[_boneGroup][_boneIndex].normal = null;
                }

                DestroyModel();
                RemoveDefence();
                _character.TriggerAddOrRemoveEvent();
            }