This commit is contained in:
Oscar 2025-06-29 15:20:07 +03:00
parent 235d5ad90a
commit 33797c4bd2
2 changed files with 97 additions and 153 deletions

View File

@ -2003,8 +2003,8 @@
"__version": 1,
"Flags": 8,
"Name": "aim_matrix_01",
"Position": "5.801175,0.02993305,11.81102",
"Rotation": "0.0004931263,0.01212253,-0.03984565,0.9991322",
"Position": "5.801111,0.02995175,11.81102",
"Rotation": "0.0004943889,0.01214651,-0.03987019,0.9991309",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
@ -2020,7 +2020,7 @@
"__version": 1,
"Flags": 8,
"Name": "aim_matrix_02a",
"Position": "5.801222,0.02991927,9.842515",
"Position": "5.801111,0.02995175,9.842515",
"Rotation": "-0.00000000000000000000001185265,0.0000000000000001455021,-0.0000003871369,1",
"Scale": "1,1,1",
"Tags": "",
@ -2037,7 +2037,7 @@
"__version": 1,
"Flags": 8,
"Name": "aim_matrix_02b",
"Position": "9.738223,0.02991574,9.842513",
"Position": "9.738112,0.02994822,9.842513",
"Rotation": "-0.00000000000000000000001185278,0.0000000000000001455018,-0.0000003871369,1",
"Scale": "1,1,1",
"Tags": "",
@ -2054,9 +2054,9 @@
"__version": 1,
"Flags": 8,
"Name": "ankle_R",
"Position": "0.4099637,-4.377346,3.807714",
"Rotation": "0.6728511,0.2185302,-0.3316586,0.6241142",
"Scale": "1.000002,1.000002,1.000002",
"Position": "0.4100302,-4.377375,3.807477",
"Rotation": "0.6728492,0.2185338,-0.331655,0.6241168",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2071,9 +2071,9 @@
"__version": 1,
"Flags": 8,
"Name": "ankle_L",
"Position": "0.4083834,4.427513,3.806108",
"Rotation": "0.6245873,0.3321065,-0.2183179,0.6722599",
"Scale": "1.000002,1.000002,1.000002",
"Position": "0.4084258,4.427733,3.805744",
"Rotation": "0.62459,0.3321031,-0.2183215,0.6722578",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2088,9 +2088,9 @@
"__version": 1,
"Flags": 8,
"Name": "arm_lower_R",
"Position": "-2.547264,-8.923134,40.63697",
"Rotation": "0.4899803,0.3799562,-0.5738583,0.5350133",
"Scale": "1.000005,1.000005,1.000005",
"Position": "-3.008707,-8.824731,40.4323",
"Rotation": "0.5050367,0.3691235,-0.5563489,0.5469568",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2105,9 +2105,9 @@
"__version": 1,
"Flags": 8,
"Name": "arm_lower_L",
"Position": "-1.750551,9.532271,40.66884",
"Rotation": "0.5623499,0.549653,-0.4004578,0.4704017",
"Scale": "1.000005,1.000005,1.000005",
"Position": "-2.228652,9.882971,40.9258",
"Rotation": "0.5853199,0.5415037,-0.3759166,0.4720818",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2122,9 +2122,9 @@
"__version": 1,
"Flags": 8,
"Name": "hand_R",
"Position": "-2.141604,-10.7859,33.16971",
"Rotation": "0.4591243,0.357981,-0.6289517,0.5152419",
"Scale": "1.000005,1.000005,1.000005",
"Position": "-2.172958,-10.64168,32.98956",
"Rotation": "0.4757731,0.3476872,-0.6124312,0.5269551",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2139,9 +2139,9 @@
"__version": 1,
"Flags": 8,
"Name": "hand_L",
"Position": "-1.172323,11.39287,33.21243",
"Rotation": "0.5450745,0.6055658,-0.3768878,0.4406127",
"Scale": "1.000006,1.000006,1.000006",
"Position": "-1.219693,12.03288,33.5941",
"Rotation": "0.5670814,0.5978222,-0.3515686,0.4443274",
"Scale": "1.000004,1.000004,1.000004",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2156,9 +2156,9 @@
"__version": 1,
"Flags": 8,
"Name": "hold_R",
"Position": "-1.080492,-9.496073,27.01665",
"Rotation": "0.3306133,0.7358714,0.03682049,0.5897731",
"Scale": "1.000007,1.000007,1.000007",
"Position": "-0.7883303,-9.30685,26.91084",
"Rotation": "0.3272031,0.7209492,0.05092086,0.6087508",
"Scale": "1.000004,1.000004,1.000004",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2173,9 +2173,9 @@
"__version": 1,
"Flags": 8,
"Name": "hold_L",
"Position": "-0.232475,10.04705,27.05133",
"Rotation": "-0.2945676,0.7504238,-0.06180435,0.5884508",
"Scale": "1.000007,1.000007,1.000007",
"Position": "0.04976643,10.92346,27.44507",
"Rotation": "-0.2771101,0.7363522,-0.05780801,0.6145353",
"Scale": "1.000005,1.000005,1.000005",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2190,8 +2190,8 @@
"__version": 1,
"Flags": 8,
"Name": "IK_right_hand",
"Position": "-1.877152,-11.09612,33.26139",
"Rotation": "0.4669385,0.3415292,-0.6186609,0.5315872",
"Position": "-1.877301,-11.09597,33.26139",
"Rotation": "0.4669432,0.3415235,-0.6186677,0.5315788",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
@ -2207,8 +2207,8 @@
"__version": 1,
"Flags": 8,
"Name": "IK_left_hand",
"Position": "-1.000594,11.37386,33.24734",
"Rotation": "0.5583135,0.5952679,-0.361805,0.4505988",
"Position": "-1.000172,11.37387,33.24733",
"Rotation": "0.5583219,0.5952601,-0.3618124,0.4505928",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
@ -2224,8 +2224,8 @@
"__version": 1,
"Flags": 8,
"Name": "leg_lower_R",
"Position": "2.772165,-4.616689,16.09606",
"Rotation": "0.4796034,0.5184785,-0.5705701,0.419059",
"Position": "2.623527,-4.449461,16.12554",
"Rotation": "0.478933,0.5137205,-0.5696675,0.4268413",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
@ -2241,8 +2241,8 @@
"__version": 1,
"Flags": 8,
"Name": "leg_lower_L",
"Position": "3.125281,4.728096,16.01951",
"Rotation": "0.4123246,0.5739041,-0.5283694,0.4705829",
"Position": "2.702025,4.862529,16.10168",
"Rotation": "0.4172888,0.5644298,-0.5225407,0.4839838",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
@ -2258,9 +2258,9 @@
"__version": 1,
"Flags": 8,
"Name": "middle_of_both_hands",
"Position": "-1.823224,0.3255591,28.35205",
"Rotation": "0.01945717,0.7727925,-0.01508422,0.6341812",
"Scale": "1.000006,1.000006,1.000006",
"Position": "-1.578352,0.8261042,28.4829",
"Rotation": "0.02899907,0.7620096,-0.006098005,0.6468874",
"Scale": "1.000004,1.000004,1.000004",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2275,9 +2275,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_arm_upper_R_twist1",
"Position": "-1.501997,-7.934674,45.44918",
"Position": "-2.060012,-7.887674,45.2747",
"Rotation": "0,0,0,1",
"Scale": "1.000004,1.000004,1.000004",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2292,9 +2292,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_arm_lower_R_twist1",
"Position": "-2.344434,-9.854515,36.90334",
"Position": "-2.590833,-9.733206,36.71093",
"Rotation": "0,0,0,1",
"Scale": "1.000005,1.000005,1.000005",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2309,9 +2309,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_elbow_R_position",
"Position": "-2.509679,-8.933312,40.63103",
"Rotation": "-0.02667829,-0.6213159,0.7814974,0.05016763",
"Scale": "1.000005,1.000005,1.000005",
"Position": "-3.006476,-8.828684,40.42824",
"Rotation": "-0.03954167,-0.6258138,0.7781667,0.03535837",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2326,9 +2326,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_elbow_L_position",
"Position": "-1.712058,9.539062,40.66292",
"Rotation": "-0.05765348,0.7835048,-0.6165186,0.05197146",
"Scale": "1.000005,1.000005,1.000005",
"Position": "-2.225949,9.887045,40.92193",
"Rotation": "-0.04285666,0.7947758,-0.6016197,0.06744216",
"Scale": "1.000004,1.000004,1.000004",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2343,9 +2343,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_arm_upper_L_twist1",
"Position": "-0.803157,8.423775,45.47519",
"Position": "-1.377295,8.593513,45.70486",
"Rotation": "0,0,0,1",
"Scale": "1.000004,1.000004,1.000004",
"Scale": "1.000003,1.000003,1.000003",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2360,9 +2360,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_arm_lower_L_twist1",
"Position": "-1.461437,10.46257,36.94063",
"Position": "-1.724172,10.95793,37.25995",
"Rotation": "0,0,0,1",
"Scale": "1.000006,1.000006,1.000006",
"Scale": "1.000004,1.000004,1.000004",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2377,7 +2377,7 @@
"__version": 1,
"Flags": 8,
"Name": "driver_leg_upper_R_twist1",
"Position": "1.730297,-4.48612,23.25467",
"Position": "1.517084,-4.227791,23.2722",
"Rotation": "0,0,0,1",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
@ -2394,7 +2394,7 @@
"__version": 1,
"Flags": 8,
"Name": "driver_leg_upper_L_twist1",
"Position": "1.990266,4.612566,23.16419",
"Position": "1.634511,4.854898,23.25767",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
@ -2411,8 +2411,8 @@
"__version": 1,
"Flags": 8,
"Name": "driver_kneecap_R_position",
"Position": "3.266922,-4.671997,16.06072",
"Rotation": "0.5183465,0.4780885,-0.5319249,0.4688327",
"Position": "3.114136,-4.50394,16.09618",
"Rotation": "0.5177554,0.4726677,-0.5317499,0.4751385",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
@ -2428,9 +2428,9 @@
"__version": 1,
"Flags": 8,
"Name": "driver_kneecap_L_position",
"Position": "3.681194,4.787521,15.97822",
"Rotation": "0.7035776,0.04610748,0.02448951,0.7086981",
"Scale": "1.000001,1.000001,1.000001",
"Position": "3.194005,4.915414,16.06777",
"Rotation": "0.6992794,0.0425677,0.02928028,0.712979",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2445,7 +2445,7 @@
"__version": 1,
"Flags": 8,
"Name": "driver_leg_lower_R_twist1",
"Position": "1.591069,-4.497025,9.951909",
"Position": "1.516778,-4.413418,9.966509",
"Rotation": "0,0,0,1",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
@ -2462,7 +2462,7 @@
"__version": 1,
"Flags": 8,
"Name": "driver_leg_lower_L_twist1",
"Position": "1.766837,4.577821,9.912802",
"Position": "1.555227,4.645117,9.953716",
"Rotation": "0,0,0,1",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
@ -2479,9 +2479,9 @@
"__version": 1,
"Flags": 8,
"Name": "forward_reference_modelspace",
"Position": "0.07596781,0.1687929,43.37532",
"Position": "-0.4610697,0.2685448,43.42068",
"Rotation": "0,0,0,1",
"Scale": "1.000002,1.000002,1.000002",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2496,9 +2496,9 @@
"__version": 1,
"Flags": 8,
"Name": "eyes",
"Position": "7.030602,-0.5137365,62.65855",
"Rotation": "0.00009885425,0.03110732,-0.05690487,0.9978949",
"Scale": "1.000003,1.000003,1.000003",
"Position": "6.130131,-0.8121294,62.79951",
"Rotation": "0.01258205,0.02319822,-0.05610418,0.9980761",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2513,9 +2513,9 @@
"__version": 1,
"Flags": 8,
"Name": "eye_R_forward",
"Position": "6.650522,-3.838521,62.66974",
"Rotation": "0.00009885425,0.03110732,-0.05690487,0.9978949",
"Scale": "1.000003,1.000003,1.000003",
"Position": "5.753399,-4.136456,62.72418",
"Rotation": "0.01258205,0.02319822,-0.05610418,0.9980761",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2530,9 +2530,9 @@
"__version": 1,
"Flags": 8,
"Name": "eye_L_forward",
"Position": "7.410679,2.811049,62.64737",
"Rotation": "0.00009885425,0.03110732,-0.05690487,0.9978949",
"Scale": "1.000003,1.000003,1.000003",
"Position": "6.506861,2.512197,62.87486",
"Rotation": "0.01258205,0.02319822,-0.05610418,0.9980761",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2547,9 +2547,9 @@
"__version": 1,
"Flags": 8,
"Name": "forward_reference",
"Position": "1.332668,0.1156056,56.11215",
"Rotation": "0.00009885425,0.03110732,-0.05690487,0.9978949",
"Scale": "1.000003,1.000003,1.000003",
"Position": "0.5450233,-0.02901907,56.17298",
"Rotation": "0.01258205,0.02319822,-0.05610418,0.9980761",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
@ -2564,8 +2564,8 @@
"__version": 1,
"Flags": 8,
"Name": "foot_R",
"Position": "1.982118,-4.910692,0.1895606",
"Rotation": "0.0004845559,-0.00001421571,-0.08709803,0.9961996",
"Position": "1.98217,-4.910679,0.1892633",
"Rotation": "0.0004838407,-0.00001396239,-0.08709296,0.9962001",
"Scale": "1.000001,1.000001,1.000001",
"Tags": "",
"Enabled": true,
@ -2581,8 +2581,8 @@
"__version": 1,
"Flags": 8,
"Name": "foot_L",
"Position": "1.97871,4.966801,1.053631",
"Rotation": "-0.08723662,0.9961876,0.0004069805,0.00001473047",
"Position": "1.978757,4.966991,1.053268",
"Rotation": "-0.08723065,0.996188,0.0004077554,0.00001464479",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
@ -2598,9 +2598,9 @@
"__version": 1,
"Flags": 8,
"Name": "hat",
"Position": "2.566394,0.02586517,71.22197",
"Rotation": "0.00009885425,0.03110732,-0.05690487,0.9978949",
"Scale": "1.000003,1.000003,1.000003",
"Position": "1.518692,-0.4816169,71.29526",
"Rotation": "0.01258205,0.02319822,-0.05610418,0.9980761",
"Scale": "1.000002,1.000002,1.000002",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,

View File

@ -197,71 +197,22 @@ public class Inventar : Component
if ( item == null || !Items.Contains( item ) )
return;
// Проверяем, является ли предмет одеждой
if ( item.Definition is ClothingItemDefinition clothingDef )
{
// Для одежды создаем специальный физический объект
DropClothingItem( item, position, clothingDef );
}
else
{
// Для остальных предметов используем стандартный префаб
if ( item.Definition.Prefab != null )
{
GameObject gO = item.Definition.Prefab.Clone( position );
GameObject gO = item.Definition.Prefab.Clone( position );
if ( gO.Components.TryGet<InventoryItem>( out var inventoryItem ) )
{
inventoryItem.Count = item.Count;
inventoryItem.Definition = item.Definition;
// Копируем патроны из оригинального предмета
inventoryItem.MagazineAmmo = item.MagazineAmmo;
}
gO.NetworkSpawn();
}
else
{
Log.Warning( $"Префаб не найден для предмета: {item.Definition.Name}" );
}
if ( gO.Components.TryGet<InventoryItem>( out var inventoryItem ) )
{
inventoryItem.Count = item.Count;
inventoryItem.Definition = item.Definition;
// Копируем патроны из оригинального предмета
inventoryItem.MagazineAmmo = item.MagazineAmmo;
}
gO.NetworkSpawn();
// Удаляем весь предмет из инвентаря
RemoveItem( item, item.Count );
}
/// <summary>
/// Выбрасывает предмет одежды как физический объект
/// </summary>
private void DropClothingItem( InventoryItem item, Vector3 position, ClothingItemDefinition clothingDef )
{
// Пытаемся найти подходящий префаб для одежды
GameObject clothingPrefab = GameObject.GetPrefab( "prefabs/item_parcel.prefab" );
GameObject clothingObject = null;
clothingObject = clothingPrefab.Clone( position );
// Добавляем компонент InventoryItem
if ( clothingObject.Components.TryGet<InventoryItem>( out var inventoryItem ) )
{
inventoryItem.Count = item.Count;
inventoryItem.Definition = item.Definition;
}
// Добавляем компонент PickupItem для подбора
if ( clothingObject.Components.TryGet<PickupItem>( out var pickupItem ) )
{
// Устанавливаем правильную метку для одежды
var slotName = GetSlotDisplayName( clothingDef.Slot );
pickupItem.Label = $"{clothingDef.Name} ({slotName})";
}
clothingObject.NetworkSpawn();
Log.Info( $"Выброшена одежда: {clothingDef.Name} ({clothingDef.Slot})" );
}
/// <summary>
/// Получает отображаемое название слота
/// </summary>
@ -320,19 +271,19 @@ public class Inventar : Component
OnChanged?.Invoke();
}
// Публичный метод для уведомления об изменениях извне класса
// Публичный метод для уведомления об изменениях извне класса
public void NotifyChanged()
{
OnChanged?.Invoke();
}
// Публичный метод для уведомления о добавлении предмета извне класса
// Публичный метод для уведомления о добавлении предмета извне класса
public void NotifyItemAdded( InventoryItem item )
{
OnItemAdded?.Invoke( item );
}
// Методы для получения информации о вместимости
// Методы для получения информации о вместимости
public int GetUsedSlots()
{
return Items.Count;
@ -423,19 +374,12 @@ public class Inventar : Component
int droppedCount = 0;
// Сначала снимаем все экипированные предметы и добавляем их в список для выбрасывания
// Сначала снимаем все экипированные предметы
foreach ( var equippedItem in equippedItemsToDrop )
{
if ( equippedItem != null )
{
// Снимаем предмет
UnEquipItem( equippedItem );
// Добавляем в список для выбрасывания, если его там еще нет
if ( !itemsToDrop.Contains( equippedItem ) )
{
itemsToDrop.Add( equippedItem );
}
}
}
@ -445,7 +389,7 @@ public class Inventar : Component
if ( item != null && item.Count > 0 )
{
// Выбираем случайную позицию в радиусе разброса
var scatteredPosition = dropPosition + Vector3.Random * scatterRadius + Vector3.Up * 10f;
var scatteredPosition = dropPosition + Vector3.Random * scatterRadius + Vector3.Up * 100f;
DropItem( item, scatteredPosition );
droppedCount++;
}