upd
This commit is contained in:
parent
de85b85b13
commit
5c9be94aba
11
Assets/Items/cloth_pijama.clitem
Normal file
11
Assets/Items/cloth_pijama.clitem
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"ClothUrl": "pukes/pyjamatop",
|
||||
"Slot": "Body",
|
||||
"Name": "Pyjama Top",
|
||||
"Description": null,
|
||||
"Prefab": null,
|
||||
"ImageTexture": null,
|
||||
"ImageUrl": "https://cdn.sbox.game/asset/pukes.pyjamatop/thumb.png.9405387bc9d8e406",
|
||||
"__references": [],
|
||||
"__version": 0
|
||||
}
|
||||
11
Assets/Items/cloth_pijama_bottom.clitem
Normal file
11
Assets/Items/cloth_pijama_bottom.clitem
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"ClothUrl": "pukes/pyjamabottoms",
|
||||
"Slot": "Body",
|
||||
"Name": "Pyjama Bottoms",
|
||||
"Description": "Pyjama Bottoms",
|
||||
"Prefab": null,
|
||||
"ImageTexture": null,
|
||||
"ImageUrl": "https://cdn.sbox.game/asset/pukes.pyjamatop/thumb.png.9405387bc9d8e406",
|
||||
"__references": [],
|
||||
"__version": 0
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
18
Assets/Items/pistol_test.weapon
Normal file
18
Assets/Items/pistol_test.weapon
Normal file
File diff suppressed because one or more lines are too long
@ -1995,7 +1995,7 @@
|
||||
"Flags": 8,
|
||||
"Name": "aim_matrix_02a",
|
||||
"Position": "5.864844,0.005568608,9.842515",
|
||||
"Rotation": "-0.00000000000000000000001185265,0.0000000000000001455021,-0.0000003871369,1",
|
||||
"Rotation": "-0.00000000000000000000001185265,0.0000000000000001455021,-0.000000387137,1",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2012,7 +2012,7 @@
|
||||
"Flags": 8,
|
||||
"Name": "aim_matrix_02b",
|
||||
"Position": "9.801846,0.005565077,9.842513",
|
||||
"Rotation": "-0.00000000000000000000001185278,0.0000000000000001455018,-0.0000003871369,1",
|
||||
"Rotation": "-0.00000000000000000000001185277,0.0000000000000001455018,-0.000000387137,1",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2028,8 +2028,8 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "ankle_R",
|
||||
"Position": "0.4099646,-4.377359,3.807756",
|
||||
"Rotation": "0.6728516,0.2185292,-0.3316596,0.6241136",
|
||||
"Position": "0.409983,-4.377514,3.807766",
|
||||
"Rotation": "0.6728485,0.2185345,-0.3316539,0.624118",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2045,8 +2045,8 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "ankle_L",
|
||||
"Position": "0.4083393,4.427768,3.806167",
|
||||
"Rotation": "0.6245928,0.3320992,-0.2183265,0.6722555",
|
||||
"Position": "0.4083189,4.428035,3.806114",
|
||||
"Rotation": "0.6245992,0.3320901,-0.2183362,0.6722509",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2062,9 +2062,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "arm_lower_R",
|
||||
"Position": "-2.567823,-9.414575,40.7076",
|
||||
"Rotation": "0.4924873,0.3660672,-0.5479427,0.5685155",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Position": "-2.1681,-9.431196,41.19865",
|
||||
"Rotation": "0.4944381,0.37219,-0.5413064,0.5692039",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2079,9 +2079,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "arm_lower_L",
|
||||
"Position": "-2.410847,9.395028,40.69125",
|
||||
"Rotation": "0.5735433,0.5426417,-0.3705063,0.4891964",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Position": "-2.005183,9.136837,41.20834",
|
||||
"Rotation": "0.5773867,0.5358267,-0.3725455,0.4906366",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2096,9 +2096,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "hand_R",
|
||||
"Position": "-1.554352,-11.43732,33.34042",
|
||||
"Rotation": "0.4642905,0.3432117,-0.604311,0.5490432",
|
||||
"Scale": "1.000007,1.000007,1.000007",
|
||||
"Position": "-1.112873,-11.34385,33.80799",
|
||||
"Rotation": "0.4663244,0.3495446,-0.5979788,0.5502559",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2113,9 +2113,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "hand_L",
|
||||
"Position": "-1.358666,11.39837,33.32423",
|
||||
"Rotation": "0.5545862,0.5991901,-0.3473969,0.4612166",
|
||||
"Scale": "1.000006,1.000006,1.000006",
|
||||
"Position": "-0.8630744,11.08804,33.84074",
|
||||
"Rotation": "0.5587665,0.5926774,-0.3494848,0.4630054",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2130,9 +2130,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "hold_R",
|
||||
"Position": "-0.1356873,-10.24809,27.23935",
|
||||
"Rotation": "0.3025265,0.7237881,0.05324486,0.6178782",
|
||||
"Scale": "1.000008,1.000008,1.000008",
|
||||
"Position": "0.3033191,-10.05647,27.72632",
|
||||
"Rotation": "0.3018348,0.7246752,0.06230799,0.6163273",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2147,9 +2147,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "hold_L",
|
||||
"Position": "0.03949806,10.18287,27.22342",
|
||||
"Rotation": "-0.2958933,0.7264506,-0.0589573,0.6174469",
|
||||
"Scale": "1.000007,1.000007,1.000007",
|
||||
"Position": "0.5723044,9.822827,27.75871",
|
||||
"Rotation": "-0.2925257,0.7254868,-0.06610834,0.6194572",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2165,7 +2165,7 @@
|
||||
"Flags": 8,
|
||||
"Name": "IK_right_hand",
|
||||
"Position": "-1.684358,-11.3081,33.23968",
|
||||
"Rotation": "0.4603033,0.3490922,-0.6097354,0.5426587",
|
||||
"Rotation": "0.4603032,0.3490922,-0.6097353,0.5426588",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2198,9 +2198,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "leg_lower_R",
|
||||
"Position": "2.852134,-4.64673,16.07982",
|
||||
"Rotation": "0.4771746,0.5220156,-0.5701445,0.4180185",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Position": "3.02255,-4.632833,16.04495",
|
||||
"Rotation": "0.4713203,0.5268413,-0.5716739,0.4165147",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2215,8 +2215,8 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "leg_lower_L",
|
||||
"Position": "2.710925,4.660064,16.10588",
|
||||
"Rotation": "0.4209704,0.5689973,-0.5179102,0.4804112",
|
||||
"Position": "2.155716,4.636949,16.19732",
|
||||
"Rotation": "0.4311262,0.5604271,-0.5056977,0.494289",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
@ -2232,9 +2232,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "middle_of_both_hands",
|
||||
"Position": "-1.265596,-0.021348,28.53136",
|
||||
"Rotation": "0.003585241,0.7594557,-0.003357793,0.6505405",
|
||||
"Scale": "1.000006,1.000006,1.000006",
|
||||
"Position": "-0.7482702,-0.11094,29.00881",
|
||||
"Rotation": "0.004989519,0.7527336,-0.001331221,0.6583049",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2249,9 +2249,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_arm_upper_R_twist1",
|
||||
"Position": "-1.681034,-8.291717,45.52214",
|
||||
"Position": "-1.2787,-8.364439,46.02543",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2266,9 +2266,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_arm_lower_R_twist1",
|
||||
"Position": "-2.061087,-10.42595,37.02401",
|
||||
"Position": "-1.640486,-10.38752,37.50332",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000006,1.000006,1.000006",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2283,9 +2283,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_elbow_R_position",
|
||||
"Position": "-2.574409,-9.417637,40.70373",
|
||||
"Rotation": "-0.03302322,-0.6136653,0.7886796,0.01757571",
|
||||
"Scale": "1.000006,1.000006,1.000006",
|
||||
"Position": "-2.180049,-9.433502,41.19473",
|
||||
"Rotation": "-0.02861762,-0.6189936,0.7847716,0.01270967",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2300,9 +2300,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_elbow_L_position",
|
||||
"Position": "-2.417371,9.398232,40.68735",
|
||||
"Rotation": "-0.05309913,0.7858217,-0.6108508,0.08078353",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Position": "-2.017065,9.139403,41.20432",
|
||||
"Rotation": "-0.04637044,0.7844297,-0.613399,0.0791298",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2317,9 +2317,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_arm_upper_L_twist1",
|
||||
"Position": "-1.545969,8.256403,45.50608",
|
||||
"Position": "-1.169505,8.015933,46.03245",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000005,1.000005,1.000005",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2334,9 +2334,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_arm_lower_L_twist1",
|
||||
"Position": "-1.884756,10.3967,37.00774",
|
||||
"Position": "-1.434129,10.11244,37.52454",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000006,1.000006,1.000006",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2351,9 +2351,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_leg_upper_R_twist1",
|
||||
"Position": "1.835075,-4.537014,23.24235",
|
||||
"Position": "1.876673,-4.498212,23.18756",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2368,9 +2368,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_leg_upper_L_twist1",
|
||||
"Position": "1.777929,4.543681,23.27972",
|
||||
"Position": "1.445647,4.562048,23.39719",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2385,9 +2385,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_kneecap_R_position",
|
||||
"Position": "3.351182,-4.701256,16.04174",
|
||||
"Rotation": "0.5169078,0.4808557,-0.5317466,0.4677923",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Position": "3.568419,-4.690867,16.00689",
|
||||
"Rotation": "0.5159015,0.4807676,-0.5308076,0.4700548",
|
||||
"Scale": "0.9999997,0.9999997,0.9999997",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2402,9 +2402,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_kneecap_L_position",
|
||||
"Position": "3.176064,4.711613,16.06872",
|
||||
"Rotation": "0.7050594,0.04671752,0.02711059,0.7070882",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Position": "2.509118,4.677139,16.16555",
|
||||
"Rotation": "0.7047989,0.04552961,0.03070755,0.7072784",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2419,9 +2419,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_leg_lower_R_twist1",
|
||||
"Position": "1.63105,-4.512045,9.943793",
|
||||
"Position": "1.716266,-4.505174,9.926357",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000003,1.000003,1.000003",
|
||||
"Scale": "1,1,1",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2436,9 +2436,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "driver_leg_lower_L_twist1",
|
||||
"Position": "1.55963,4.543931,9.956005",
|
||||
"Position": "1.282023,4.53249,10.00171",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2453,9 +2453,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "forward_reference_modelspace",
|
||||
"Position": "-0.4114534,0.001021107,43.38918",
|
||||
"Position": "-0.2125276,-0.06392401,43.42877",
|
||||
"Rotation": "0,0,0,1",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2470,9 +2470,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "eyes",
|
||||
"Position": "5.407951,-0.1355422,63.24592",
|
||||
"Rotation": "-0.0007134229,-0.01552102,-0.01144814,0.9998137",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "5.906095,-0.3021989,63.2759",
|
||||
"Rotation": "-0.0001773983,-0.01521605,-0.009447872,0.9998396",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2487,9 +2487,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "eye_R_forward",
|
||||
"Position": "5.331269,-3.481122,63.24951",
|
||||
"Rotation": "-0.0007134229,-0.01552102,-0.01144814,0.9998137",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "5.842853,-3.648057,63.27613",
|
||||
"Rotation": "-0.0001773983,-0.01521605,-0.009447872,0.9998396",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2504,9 +2504,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "eye_L_forward",
|
||||
"Position": "5.484632,3.210038,63.24234",
|
||||
"Rotation": "-0.0007134229,-0.01552102,-0.01144814,0.9998137",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "5.969336,3.043659,63.27568",
|
||||
"Rotation": "-0.0001773983,-0.01521605,-0.009447872,0.9998396",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2521,9 +2521,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "forward_reference",
|
||||
"Position": "0.3106461,-0.02626462,56.19444",
|
||||
"Rotation": "-0.0007134229,-0.01552102,-0.01144814,0.9998137",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "0.8041469,-0.2062372,56.2276",
|
||||
"Rotation": "-0.0001773983,-0.01521605,-0.009447872,0.9998396",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2538,9 +2538,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "foot_R",
|
||||
"Position": "1.982103,-4.910701,0.1895912",
|
||||
"Rotation": "0.0004849434,-0.00001452863,-0.08709995,0.9961995",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "1.982133,-4.910829,0.1895903",
|
||||
"Rotation": "0.0004833937,-0.00001463294,-0.08709148,0.9962002",
|
||||
"Scale": "1.000001,1.000001,1.000001",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2555,9 +2555,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "foot_L",
|
||||
"Position": "1.978663,4.967034,1.053633",
|
||||
"Rotation": "-0.08722261,0.9961888,0.0004088581,0.00001432814",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Position": "1.978647,4.967236,1.053595",
|
||||
"Rotation": "-0.08720801,0.9961901,0.0004106759,0.00001446971",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
@ -2572,9 +2572,9 @@
|
||||
"__version": 1,
|
||||
"Flags": 8,
|
||||
"Name": "hat",
|
||||
"Position": "0.1355461,-0.005559167,71.35379",
|
||||
"Rotation": "-0.0007134229,-0.01552102,-0.01144814,0.9998137",
|
||||
"Scale": "1.000004,1.000004,1.000004",
|
||||
"Position": "0.6381106,-0.2016305,71.38704",
|
||||
"Rotation": "-0.0001773983,-0.01521605,-0.009447872,0.9998396",
|
||||
"Scale": "1.000002,1.000002,1.000002",
|
||||
"Tags": "",
|
||||
"Enabled": true,
|
||||
"NetworkMode": 2,
|
||||
|
||||
@ -59,9 +59,82 @@
|
||||
"Static": false,
|
||||
"Surface": null,
|
||||
"SurfaceVelocity": "0,0,0"
|
||||
},
|
||||
{
|
||||
"__type": "Sandbox.UI.PickupItem",
|
||||
"__guid": "8546ae27-6c60-4e32-b613-760bc20bd651",
|
||||
"__enabled": true,
|
||||
"Label": "E",
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"RequiresHold": false
|
||||
},
|
||||
{
|
||||
"__type": "Sandbox.Rigidbody",
|
||||
"__guid": "4d97a077-f187-44f4-967b-d346530c38d9",
|
||||
"__enabled": true,
|
||||
"AngularDamping": 0,
|
||||
"Gravity": true,
|
||||
"LinearDamping": 0,
|
||||
"Locking": {
|
||||
"X": false,
|
||||
"Y": false,
|
||||
"Z": false,
|
||||
"Pitch": false,
|
||||
"Yaw": false,
|
||||
"Roll": false
|
||||
},
|
||||
"MassCenterOverride": "0,0,0",
|
||||
"MassOverride": 0,
|
||||
"MotionEnabled": true,
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"OverrideMassCenter": false,
|
||||
"RigidbodyFlags": 0,
|
||||
"StartAsleep": false
|
||||
},
|
||||
{
|
||||
"__type": "Sasalka.InventoryItem",
|
||||
"__guid": "beaec0c2-ccc3-48b0-8459-5a3f3fe679f1",
|
||||
"__enabled": true,
|
||||
"Count": 120,
|
||||
"Definition": "items/pistol_ammo.inv",
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null
|
||||
}
|
||||
],
|
||||
"Children": []
|
||||
"Children": [],
|
||||
"__properties": {
|
||||
"NetworkInterpolation": true,
|
||||
"TimeScale": 1,
|
||||
"WantsSystemScene": true,
|
||||
"Metadata": {},
|
||||
"NavMesh": {
|
||||
"Enabled": false,
|
||||
"IncludeStaticBodies": true,
|
||||
"IncludeKeyframedBodies": true,
|
||||
"EditorAutoUpdate": true,
|
||||
"AgentHeight": 64,
|
||||
"AgentRadius": 16,
|
||||
"AgentStepSize": 18,
|
||||
"AgentMaxSlope": 40,
|
||||
"ExcludedBodies": "",
|
||||
"IncludedBodies": ""
|
||||
}
|
||||
},
|
||||
"__variables": []
|
||||
},
|
||||
"ResourceVersion": 2,
|
||||
"ShowInMenu": false,
|
||||
|
||||
@ -116,6 +116,7 @@
|
||||
"prefab": "prefabs/impacts/impact.flesh.mist.prefab"
|
||||
},
|
||||
"Cooldown": 0.5,
|
||||
"Equipped": false,
|
||||
"GunRenderer": {
|
||||
"_type": "component",
|
||||
"component_id": "6017d24d-39d0-4acf-bf9f-010c345fd13d",
|
||||
@ -136,6 +137,82 @@
|
||||
"_type": "gameobject",
|
||||
"prefab": "prefabs/impacts/impact.metal.prefab"
|
||||
}
|
||||
},
|
||||
{
|
||||
"__type": "Sandbox.UI.PickupItem",
|
||||
"__guid": "7350112e-dea3-4c22-b9fc-76eaed3d2e57",
|
||||
"__enabled": true,
|
||||
"Label": "E",
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"RequiresHold": false
|
||||
},
|
||||
{
|
||||
"__type": "Sasalka.InventoryItem",
|
||||
"__guid": "ce60c131-01f0-4aa3-a84c-c93eac1d1c2d",
|
||||
"__enabled": true,
|
||||
"Count": 1,
|
||||
"Definition": "items/pistol_test.weapon",
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null
|
||||
},
|
||||
{
|
||||
"__type": "Sandbox.BoxCollider",
|
||||
"__guid": "8a705640-2966-489e-a41a-2bf6f2cc62f0",
|
||||
"__enabled": true,
|
||||
"Center": "3.455851,0.294498,1.968303",
|
||||
"Friction": null,
|
||||
"IsTrigger": false,
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"OnObjectTriggerEnter": null,
|
||||
"OnObjectTriggerExit": null,
|
||||
"OnTriggerEnter": null,
|
||||
"OnTriggerExit": null,
|
||||
"Scale": "15.11259,2.231525,10.9",
|
||||
"Static": false,
|
||||
"Surface": null,
|
||||
"SurfaceVelocity": "0,0,0"
|
||||
},
|
||||
{
|
||||
"__type": "Sandbox.Rigidbody",
|
||||
"__guid": "8b4ca11f-8cd7-4bb5-bb63-df86dac15ab9",
|
||||
"__enabled": true,
|
||||
"AngularDamping": 0,
|
||||
"Gravity": true,
|
||||
"LinearDamping": 0,
|
||||
"Locking": {
|
||||
"X": false,
|
||||
"Y": false,
|
||||
"Z": false,
|
||||
"Pitch": false,
|
||||
"Yaw": false,
|
||||
"Roll": false
|
||||
},
|
||||
"MassCenterOverride": "0,0,0",
|
||||
"MassOverride": 25,
|
||||
"MotionEnabled": true,
|
||||
"OnComponentDestroy": null,
|
||||
"OnComponentDisabled": null,
|
||||
"OnComponentEnabled": null,
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"OverrideMassCenter": false,
|
||||
"RigidbodyFlags": 0,
|
||||
"StartAsleep": false
|
||||
}
|
||||
],
|
||||
"Children": [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -9,4 +9,6 @@ public class BaseItemDefinition : GameResource
|
||||
[ResourceType( "prefab" )] public GameObject Prefab { get; set; }
|
||||
public Texture ImageTexture { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
public int MaxCount { get; set; } = 1;
|
||||
}
|
||||
|
||||
@ -36,34 +36,50 @@ public class Inventar
|
||||
OnChanged?.Invoke();
|
||||
}
|
||||
|
||||
// public void EquipItem( InventoryItem item )
|
||||
// {
|
||||
// if ( EquippedItems.ContainsValue( item ) )
|
||||
// {
|
||||
// UnEquipItem( item );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// EquippedItems.Add( item.Definition.Slot, item );
|
||||
// OnEquipped?.Invoke( item );
|
||||
// }
|
||||
// }
|
||||
|
||||
public void EquipItem( InventoryItem item )
|
||||
{
|
||||
if ( item.Definition is not IEquipable equipable ) return;
|
||||
if ( item.Definition is not IEquipable equipable )
|
||||
return;
|
||||
|
||||
// Если уже экипирован этот же предмет — снять его
|
||||
if ( EquippedItems.ContainsValue( item ) )
|
||||
{
|
||||
UnEquipItem( item );
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// Если на этом слоте уже что-то есть — снять старый предмет
|
||||
if ( EquippedItems.TryGetValue( equipable.Slot, out var oldItem ) )
|
||||
{
|
||||
EquippedItems[equipable.Slot] = item;
|
||||
OnEquipped?.Invoke( item );
|
||||
UnEquipItem( oldItem );
|
||||
|
||||
// Вернуть снятый предмет обратно в инвентарь, если его там нет
|
||||
if ( !Items.Contains( oldItem ) )
|
||||
Items.Add( oldItem );
|
||||
}
|
||||
|
||||
// Экипировать новый предмет
|
||||
EquippedItems[equipable.Slot] = item;
|
||||
OnEquipped?.Invoke( item );
|
||||
}
|
||||
|
||||
public void DropItem( InventoryItem item, Vector3 position )
|
||||
{
|
||||
var gO = item.Definition.Prefab.Clone( position );
|
||||
|
||||
if ( gO.Components.TryGet<InventoryItem>( out var inventoryItem ) )
|
||||
{
|
||||
inventoryItem.Count = item.Count;
|
||||
}
|
||||
|
||||
gO.NetworkSpawn( null );
|
||||
|
||||
RemoveItem( item );
|
||||
// Items.Remove( item );
|
||||
// OnChanged?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
public void UnEquipItem( InventoryItem item )
|
||||
{
|
||||
foreach ( var kvp in EquippedItems.Where( kvp => kvp.Value == item ).ToList() )
|
||||
|
||||
@ -4,7 +4,6 @@ namespace Sasalka;
|
||||
|
||||
public class InventoryItem : Component
|
||||
{
|
||||
public BaseItemDefinition Definition { get; set; }
|
||||
public int Count { get; set; } = 1;
|
||||
public int MaxCount { get; set; } = 1;
|
||||
[Property] public BaseItemDefinition Definition { get; set; }
|
||||
[Property] public int Count { get; set; } = 1;
|
||||
}
|
||||
|
||||
@ -4,9 +4,12 @@
|
||||
|
||||
<root class="@( Inventar.IsInventoryOpen ? "" : "hidden" )">
|
||||
<div class="inventory-panel">
|
||||
@foreach ( var item in PlayerInventory.Items )
|
||||
@if ( PlayerInventory.Items.Count > 0 )
|
||||
{
|
||||
<Sasalka.Ui.InventoryItem Item="@item" OnItemClick="@( UseItem )"/>
|
||||
@foreach ( var item in PlayerInventory.Items )
|
||||
{
|
||||
<Sasalka.Ui.InventoryItem Item="@item" OnItemClick="@( UseItem )" OnItemRightClick="@( DropItem )"/>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</root>
|
||||
@ -21,6 +24,11 @@
|
||||
Player?.Inventory?.EquipItem( item );
|
||||
}
|
||||
|
||||
void DropItem( Sasalka.InventoryItem item )
|
||||
{
|
||||
Player?.Inventory?.DropItem( item, Player.CameraPivot.WorldPosition + Player.Camera.LocalRotation.Right * 50 );
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if ( Input.Pressed( "Score" ) )
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
@inherits Sandbox.UI.Panel
|
||||
@namespace Sasalka.Ui
|
||||
|
||||
<root class="inventory-item @( Equipped ? "equipped" : "" )" @onclick="@(() => OnItemClick?.Invoke( Item ))">
|
||||
<input type="checkbox" class="equipped-checkbox" checked="@Equipped" disabled/>
|
||||
<root class="inventory-item @( Equipped ? "equipped" : "" )" @onclick="@(() => OnItemClick?.Invoke( Item ))" @onrightclick=@( () => OnItemRightClick?.Invoke( Item ) )>
|
||||
|
||||
@* <input type="checkbox" class="equipped-checkbox" checked="@Equipped" disabled/> *@
|
||||
|
||||
@if ( Item.Definition.ImageTexture.IsValid() )
|
||||
{
|
||||
<img src="@Item.Definition.ImageTexture.ResourcePath" alt="@Item.Definition.Name"/>
|
||||
@ -16,12 +18,17 @@
|
||||
|
||||
<div class="inventory-item__name">@Item?.Definition.Name</div>
|
||||
|
||||
<div class="inventory-item__count">@Item?.Count / @Item?.MaxCount</div>
|
||||
@if ( Item?.Definition.MaxCount > 1 )
|
||||
{
|
||||
<div class="inventory-item__count">@Item?.Count / @Item?.Definition.MaxCount</div>
|
||||
}
|
||||
</root>
|
||||
|
||||
@code {
|
||||
public Sasalka.InventoryItem Item { get; set; }
|
||||
public Action<Sasalka.InventoryItem> OnItemClick { get; set; }
|
||||
public Action<Sasalka.InventoryItem> OnItemRightClick { get; set; }
|
||||
|
||||
public bool Equipped { get; set; }
|
||||
|
||||
protected override int BuildHash()
|
||||
|
||||
@ -6,8 +6,7 @@ public abstract class AmmoUseableBase : UseableBase
|
||||
|
||||
private InventoryItem FindAmmoItem()
|
||||
{
|
||||
// var ammoDefinition = new InventoryItemDefinition();
|
||||
|
||||
//По типу патрон поиск + енум типа патрон
|
||||
return Dedugan.Local.Inventory.Items.FirstOrDefault( i => i.Definition.Name == "Pistol Ammo" );
|
||||
}
|
||||
|
||||
@ -28,7 +27,6 @@ public abstract class AmmoUseableBase : UseableBase
|
||||
if ( ammo != null )
|
||||
{
|
||||
ammo.Count--;
|
||||
Log.Info( $"[AmmoUseableBase] Ammo left: {ammo.Count}" );
|
||||
|
||||
if ( ammo.Count <= 0 )
|
||||
{
|
||||
|
||||
29
Code/Inventory/Usable/PickupItem.cs
Normal file
29
Code/Inventory/Usable/PickupItem.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Sandbox.Gravity;
|
||||
using Sasalka;
|
||||
|
||||
namespace Sandbox.UI;
|
||||
|
||||
[Icon( "skip_next" )]
|
||||
public sealed class PickupItem : InteractionButton
|
||||
{
|
||||
[Property] public override string Label { get; set; } = "E";
|
||||
|
||||
public override bool Press( IPressable.Event e )
|
||||
{
|
||||
base.Press( e );
|
||||
|
||||
if ( e.Source.Components.TryGet<Dedugan>( out var dedugan ) )
|
||||
{
|
||||
dedugan.Inventory.AddItem( Components.Get<InventoryItem>() );
|
||||
RpcDestroy();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[Rpc.Broadcast]
|
||||
void RpcDestroy()
|
||||
{
|
||||
GameObject.Destroy();
|
||||
}
|
||||
}
|
||||
@ -2,14 +2,17 @@
|
||||
|
||||
public static class UseSystem
|
||||
{
|
||||
public static void TryUse( IUseContext context )
|
||||
public static bool TryUse( IUseContext context )
|
||||
{
|
||||
foreach ( var useable in context.GetUsables() )
|
||||
{
|
||||
if ( useable.CanUse() )
|
||||
{
|
||||
useable.Use();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,11 +6,38 @@ public abstract class UseableBase : Component, IUseable
|
||||
{
|
||||
[Property] public float Cooldown { get; set; } = 0.5f;
|
||||
|
||||
private TimeSince _timeSinceUsed;
|
||||
private bool _equipped;
|
||||
|
||||
protected override void OnStart()
|
||||
[Property]
|
||||
public bool Equipped
|
||||
{
|
||||
get => _equipped;
|
||||
set
|
||||
{
|
||||
if ( _equipped != value )
|
||||
{
|
||||
_equipped = value;
|
||||
if ( _equipped )
|
||||
{
|
||||
OnEquip?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TimeSince _timeSinceUsed;
|
||||
public Action OnEquip { get; set; }
|
||||
|
||||
protected override void OnAwake()
|
||||
{
|
||||
_timeSinceUsed = Cooldown;
|
||||
|
||||
OnEquip += OnEquipped;
|
||||
}
|
||||
|
||||
public virtual void OnEquipped()
|
||||
{
|
||||
Log.Info( $"OnEquip {this}" );
|
||||
}
|
||||
|
||||
public virtual bool CanUse()
|
||||
|
||||
@ -13,18 +13,9 @@ public sealed partial class Dedugan : Component
|
||||
[Sync] public bool CameraTraceIsHit { get; set; }
|
||||
public Vector3 TracedHitNormal { get; set; }
|
||||
|
||||
// private TimeSince HoldTime = 0;
|
||||
// private bool Holding = false;
|
||||
// private bool HoldingInteractionHappened = false;
|
||||
|
||||
void InteractionsUpdate()
|
||||
{
|
||||
if ( !EnablePressing )
|
||||
{
|
||||
// Holding = false;
|
||||
// HoldingInteractionHappened = false;
|
||||
return;
|
||||
}
|
||||
if ( !EnablePressing ) return;
|
||||
|
||||
if ( Pressed.IsValid() )
|
||||
{
|
||||
@ -66,6 +57,8 @@ public sealed partial class Dedugan : Component
|
||||
|
||||
private void UpdateHovered()
|
||||
{
|
||||
if ( Pressed.IsValid() ) return;
|
||||
|
||||
SwitchHovered( TryGetLookedAt() );
|
||||
|
||||
if ( Hovered is IPressable pressable )
|
||||
@ -76,15 +69,19 @@ public sealed partial class Dedugan : Component
|
||||
} );
|
||||
}
|
||||
|
||||
if ( Input.Down( "use" ) )
|
||||
if ( Input.Pressed( "use" ) )
|
||||
{
|
||||
StartPressing( Hovered );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void StartPressing( Component obj )
|
||||
{
|
||||
if ( Pressed == obj ) return;
|
||||
|
||||
StopPressing();
|
||||
|
||||
if ( !obj.IsValid() )
|
||||
{
|
||||
ISceneEvent<PlayerController.IEvents>.PostToGameObject( GameObject, x => x.FailPressing() );
|
||||
@ -162,37 +159,30 @@ public sealed partial class Dedugan : Component
|
||||
|
||||
private Component TryGetLookedAt()
|
||||
{
|
||||
for ( float num = 0f; num <= 4f; num += 2f )
|
||||
var from = Scene.Camera.WorldPosition + Scene.Camera.WorldRotation.Forward;
|
||||
var to = from + Scene.Camera.WorldRotation.Forward * InteractDistance;
|
||||
|
||||
var trace = Scene.Trace
|
||||
.Ray( from, to )
|
||||
.IgnoreGameObjectHierarchy( GameObject )
|
||||
.Run();
|
||||
|
||||
TracedHitPos = trace.Hit ? trace.HitPosition : trace.EndPosition;
|
||||
CameraTraceIsHit = trace.Hit;
|
||||
TracedHitNormal = trace.Normal;
|
||||
|
||||
if ( !trace.Hit || !trace.GameObject.IsValid() ) return null;
|
||||
|
||||
var go = trace.GameObject;
|
||||
|
||||
var pressable = go.Components.Get<IPressable>( FindMode.EnabledInSelfAndDescendants );
|
||||
|
||||
if ( pressable != null && pressable.CanPress( new IPressable.Event
|
||||
{
|
||||
Ray = new Ray( Camera.WorldPosition, EyeAngles.ToRotation().Forward ), Source = this
|
||||
} ) )
|
||||
{
|
||||
var from = Scene.Camera.WorldPosition + Scene.Camera.WorldRotation.Forward;
|
||||
var to = from + Scene.Camera.WorldRotation.Forward * (InteractDistance - num);
|
||||
var trace = Scene.Trace.Ray( from, to ).IgnoreGameObjectHierarchy( GameObject ).Radius( num ).Run();
|
||||
|
||||
TracedHitPos = trace.Hit ? trace.HitPosition : trace.EndPosition;
|
||||
CameraTraceIsHit = trace.Hit;
|
||||
TracedHitNormal = trace.Normal;
|
||||
|
||||
if ( !trace.Hit || !trace.GameObject.IsValid() ) continue;
|
||||
|
||||
Component foundComponent = null;
|
||||
|
||||
ISceneEvent<PlayerController.IEvents>.PostToGameObject( GameObject, x =>
|
||||
{
|
||||
foundComponent = x.GetUsableComponent( trace.GameObject ) ?? foundComponent;
|
||||
} );
|
||||
|
||||
if ( foundComponent.IsValid() ) return foundComponent;
|
||||
|
||||
foreach ( var component in trace.GameObject.Components.GetAll<IPressable>() )
|
||||
{
|
||||
if ( component.CanPress( new IPressable.Event
|
||||
{
|
||||
Ray = new Ray( Camera.WorldPosition, EyeAngles.ToRotation().Forward ), Source = this
|
||||
} ) )
|
||||
{
|
||||
return component as Component;
|
||||
}
|
||||
}
|
||||
return pressable as Component;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -16,29 +16,29 @@ public sealed partial class Dedugan : Component
|
||||
|
||||
_resolver = new AttachmentSlotResolver( Renderer.GetAttachmentObject );
|
||||
|
||||
Inventory.AddItem( new InventoryItem
|
||||
{
|
||||
Definition = ResourceLibrary.Get<ClothingItemDefinition>( "Items/cloth_pijama.clitem" )
|
||||
} );
|
||||
|
||||
// Inventory.AddItem( new InventoryItem
|
||||
// {
|
||||
// Definition = ResourceLibrary.Get<BaseItemDefinition>( "Items/shorts_1.inv" )
|
||||
// Definition = ResourceLibrary.Get<ClothingItemDefinition>( "Items/cloth_pijama.clitem" )
|
||||
// } );
|
||||
|
||||
Inventory.AddItem( new InventoryItem
|
||||
{
|
||||
Definition = ResourceLibrary.Get<WeaponItemDefinition>( "Items/pistol_test.weapon" )
|
||||
} );
|
||||
|
||||
var ammo = new InventoryItem
|
||||
{
|
||||
Definition = ResourceLibrary.Get<BaseItemDefinition>( "Items/pistol_ammo.inv" )
|
||||
};
|
||||
ammo.Count = 30;
|
||||
ammo.MaxCount = 130;
|
||||
|
||||
Inventory.AddItem( ammo );
|
||||
//
|
||||
// Inventory.AddItem( new InventoryItem
|
||||
// {
|
||||
// Definition = ResourceLibrary.Get<ClothingItemDefinition>( "Items/cloth_pijama_bottom.clitem" )
|
||||
// } );
|
||||
//
|
||||
// Inventory.AddItem( new InventoryItem
|
||||
// {
|
||||
// Definition = ResourceLibrary.Get<WeaponItemDefinition>( "Items/pistol_test.weapon" )
|
||||
// } );
|
||||
//
|
||||
// var ammo = new InventoryItem
|
||||
// {
|
||||
// Definition = ResourceLibrary.Get<BaseItemDefinition>( "Items/pistol_ammo.inv" )
|
||||
// };
|
||||
// ammo.Count = 30;
|
||||
// ammo.MaxCount = 130;
|
||||
//
|
||||
// Inventory.AddItem( ammo );
|
||||
|
||||
Inventory.OnEquipped += OnItemEquipped;
|
||||
Inventory.OnUnEquipped += OnItemUnEquipped;
|
||||
@ -70,6 +70,8 @@ public sealed partial class Dedugan : Component
|
||||
go.LocalPosition = weaponDef.WeaponDefinition.Position;
|
||||
go.LocalRotation = weaponDef.WeaponDefinition.Rotation;
|
||||
|
||||
go.Components.Get<UseableBase>().Equipped = true;
|
||||
|
||||
go.NetworkSpawn();
|
||||
|
||||
var hand = weaponDef.Slot switch
|
||||
@ -145,8 +147,10 @@ public sealed partial class Dedugan : Component
|
||||
|
||||
if ( Input.Pressed( "Attack1" ) )
|
||||
{
|
||||
UseSystem.TryUse( this );
|
||||
Attack();
|
||||
if ( UseSystem.TryUse( this ) )
|
||||
{
|
||||
Attack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ namespace Sandbox.UI;
|
||||
|
||||
public abstract class InteractionButton : Component, Component.IPressable
|
||||
{
|
||||
[Property] public string Label { get; set; } = "Label";
|
||||
[Property] public virtual string Label { get; set; } = "Label";
|
||||
[Property] public bool RequiresHold { get; set; } = false;
|
||||
private HoverInfoPanel _uiPanel;
|
||||
private GameObject _interactionPanelPrefab { get; set; }
|
||||
@ -12,25 +12,24 @@ public abstract class InteractionButton : Component, Component.IPressable
|
||||
protected override void OnStart()
|
||||
{
|
||||
base.OnStart();
|
||||
|
||||
_interactionPanelPrefab = GameObject.GetPrefab("prefabs/InteractionPanel.prefab");
|
||||
Log.Info(_interactionPanelPrefab.Name);
|
||||
Assert.True(_interactionPanelPrefab.IsValid(), $"No InteractionPanel prefab found for {GameObject.Name}!");
|
||||
|
||||
_interactionPanelPrefab = GameObject.GetPrefab( "prefabs/InteractionPanel.prefab" );
|
||||
Assert.True( _interactionPanelPrefab.IsValid(), $"No InteractionPanel prefab found for {GameObject.Name}!" );
|
||||
}
|
||||
|
||||
public virtual void Hover(IPressable.Event e)
|
||||
public virtual void Hover( IPressable.Event e )
|
||||
{
|
||||
CreatePanel();
|
||||
}
|
||||
|
||||
public virtual void Blur(IPressable.Event e)
|
||||
public virtual void Blur( IPressable.Event e )
|
||||
{
|
||||
DestroyPanel();
|
||||
}
|
||||
|
||||
public virtual void Look(IPressable.Event e)
|
||||
public virtual void Look( IPressable.Event e )
|
||||
{
|
||||
if (_uiPanel != null)
|
||||
if ( _uiPanel != null )
|
||||
{
|
||||
_uiPanel.ProgressionHold = 0f;
|
||||
}
|
||||
@ -40,34 +39,39 @@ public abstract class InteractionButton : Component, Component.IPressable
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool Press(IPressable.Event e)
|
||||
|
||||
public virtual bool Press( IPressable.Event e )
|
||||
{
|
||||
if (_uiPanel != null)
|
||||
// // Проверяем, что событие относится именно к этому объекту
|
||||
// if ( e.Source.GameObject != this.GameObject )
|
||||
// return false; // Игнорируем, событие для другого объекта
|
||||
|
||||
if ( _uiPanel != null )
|
||||
{
|
||||
_uiPanel?.SetPressed(true);
|
||||
_uiPanel.SetPressed( true );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void Release(IPressable.Event e)
|
||||
|
||||
public virtual void Release( IPressable.Event e )
|
||||
{
|
||||
if (_uiPanel != null)
|
||||
if ( _uiPanel != null )
|
||||
{
|
||||
_uiPanel?.SetPressed(false);
|
||||
_uiPanel?.SetPressed( false );
|
||||
}
|
||||
}
|
||||
|
||||
protected void CreatePanel()
|
||||
{
|
||||
if (_uiPanel != null) return;
|
||||
if ( _uiPanel != null ) return;
|
||||
|
||||
var panelGo = _interactionPanelPrefab.Clone();
|
||||
panelGo.WorldPosition = WorldPosition;
|
||||
panelGo.Parent = Scene;
|
||||
_uiPanel = panelGo.Components.Get<HoverInfoPanel>();
|
||||
if (_uiPanel != null)
|
||||
if ( _uiPanel != null )
|
||||
{
|
||||
_uiPanel.InteractionString = Label;
|
||||
_uiPanel.IsHoldInteraction = RequiresHold;
|
||||
@ -75,13 +79,13 @@ public abstract class InteractionButton : Component, Component.IPressable
|
||||
}
|
||||
}
|
||||
|
||||
protected async void DestroyPanel()
|
||||
protected void DestroyPanel()
|
||||
{
|
||||
if (_uiPanel == null) return;
|
||||
if ( _uiPanel == null ) return;
|
||||
|
||||
_uiPanel.GameObject.Destroy();
|
||||
_uiPanel = null;
|
||||
|
||||
await Task.DelaySeconds(0.05f);
|
||||
// await Task.DelaySeconds(0.05f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,13 +13,20 @@ public sealed class TeleportMazeButton : InteractionButton
|
||||
public override bool Press( IPressable.Event e )
|
||||
{
|
||||
base.Press( e );
|
||||
if ( Maze.IsValid() )
|
||||
{
|
||||
Maze.RpcRequestMaze();
|
||||
}
|
||||
|
||||
DoTeleport();
|
||||
return true;
|
||||
return false;
|
||||
// if ( Maze.IsValid() )
|
||||
// {
|
||||
// Maze.RpcRequestMaze();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Log.Info( "pressed teleport maze" );
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// DoTeleport();
|
||||
// return true;
|
||||
}
|
||||
|
||||
private async void DoTeleport()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Sandbox.UI;
|
||||
using Sasalka;
|
||||
|
||||
namespace Sandbox.Weapons;
|
||||
@ -11,6 +12,7 @@ public sealed class Weapon : AmmoUseableBase
|
||||
[Property] public GameObject bloodParticle { get; set; }
|
||||
|
||||
private SoundPointComponent _sound;
|
||||
private Rigidbody _rigidbody;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
@ -18,6 +20,13 @@ public sealed class Weapon : AmmoUseableBase
|
||||
_sound = GameObject.GetComponent<SoundPointComponent>( true );
|
||||
}
|
||||
|
||||
public override void OnEquipped()
|
||||
{
|
||||
_rigidbody = GameObject.Components.Get<Rigidbody>();
|
||||
_rigidbody.Enabled = false;
|
||||
GameObject.Components.Get<PickupItem>().Enabled = false;
|
||||
}
|
||||
|
||||
public void Attack()
|
||||
{
|
||||
AttackEffects();
|
||||
@ -87,13 +96,11 @@ public sealed class Weapon : AmmoUseableBase
|
||||
_sound?.StartSound();
|
||||
MuzzleLight.Enabled = true;
|
||||
GunRenderer.Set( "Fire", true );
|
||||
_ = AttackEffectsAsync();
|
||||
}
|
||||
|
||||
private async Task AttackEffectsAsync()
|
||||
{
|
||||
await GameTask.DelaySeconds( 0.05f );
|
||||
MuzzleLight.Enabled = false;
|
||||
GameTask.DelaySeconds( 0.05f ).ContinueWith( ( _ ) =>
|
||||
{
|
||||
MuzzleLight.Enabled = false;
|
||||
} );
|
||||
}
|
||||
|
||||
protected override void OnUse()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"Title": "sasalka",
|
||||
"Title": "metaverse",
|
||||
"Type": "game",
|
||||
"Org": "kptl",
|
||||
"Org": "koptilnya",
|
||||
"Ident": "sasalka",
|
||||
"Schema": 1,
|
||||
"IncludeSourceFiles": false,
|
||||
@ -28,6 +28,7 @@
|
||||
"Keyboard": false,
|
||||
"VR": false,
|
||||
"Gamepad": false
|
||||
}
|
||||
},
|
||||
"LaunchMode": "Normal"
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADresser_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fa59714cc5d0c63b6ceff5bd775714767c621e47fa2e5128a61ed1744b471cd_003FDresser_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADspProcessor_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb259d6161b344f3994a9007e79ffb76e727000_003Ffb_003F1e5434fb_003FDspProcessor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADspVolume_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F473df774ec844d1eb1dafe31862610eb433000_003Fda_003Fdddba176_003FDspVolume_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameObject_002EClone_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F994e5d97d54ec64666ded6c166c9c25c536dfb13ffaea75878c8ff352b9c_003FGameObject_002EClone_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameObject_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F473df774ec844d1eb1dafe31862610eb433000_003F1a_003F3c96fd87_003FGameObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameObject_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F328f546fb3d12ef21bd156bebb44e876ae17ebd8f1bfe0d68a6a5a5980cfc9_003FGameObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGameObject_002EDestroy_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F25a01333d5e9c794e14abd1de0d5d6345cd7e4ca1bb7586d37d8aaf61c18f_003FGameObject_002EDestroy_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
@ -38,6 +39,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModelPhysics_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F473df774ec844d1eb1dafe31862610eb433000_003Fa4_003Ffd7d4a36_003FModelPhysics_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModelPhysics_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F92bf9bbf66ae1f54445ffc8fd441e65cd2b36c4162e21bfb32d25f9d29334d91_003FModelPhysics_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AModel_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa2b91d29af2c4b9ba9c9da5883394d0b2bf200_003F9d_003F45f34be4_003FModel_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMousePanelEvent_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fcfcd31d2ea4eb21dfedc766ff2dcc564e1b3dc281346fd45aa21590f6283c_003FMousePanelEvent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANavMesh_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa2b91d29af2c4b9ba9c9da5883394d0b2bf200_003F90_003F5b19e900_003FNavMesh_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APhysicsBody_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa2b91d29af2c4b9ba9c9da5883394d0b2bf200_003F83_003F79b53dac_003FPhysicsBody_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARay_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fcdd7996c168e4e71a26a18071188e963140000_003F68_003Fed78b2d5_003FRay_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user