diff --git a/assets/prefabs/player.prefab b/assets/prefabs/player.prefab index 064b26a..b055292 100644 --- a/assets/prefabs/player.prefab +++ b/assets/prefabs/player.prefab @@ -1,18 +1,18 @@ { "RootObject": { - "__guid": "d1e672e7-113b-492c-b449-50034808dd6a", + "__guid": "bf0f959a-8e13-4133-8fc5-edc7aa3d1b0c", "Name": "player", "Tags": "player", "Enabled": true, "NetworkMode": 2, "Components": [ { - "__type": "CitizenAnimationHelper", - "__guid": "4f2305cc-a8c5-4b10-8f1e-5a027b32b8bd", + "__type": "Sandbox.Citizen.CitizenAnimationHelper", + "__guid": "01531001-09de-46cc-8073-a07e669f50fd", "BodyWeight": 1, "EyeSource": { "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" + "go": "d8a09f79-a5a4-41e7-9522-ff9d3a8df4e8" }, "EyesWeight": 1, "HeadWeight": 1, @@ -20,14 +20,14 @@ "LookAtEnabled": false, "Target": { "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fc51159a-2082-4de0-8c3e-5f44d049ed23", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "SkinnedModelRenderer" } }, { - "__type": "CharacterController", - "__guid": "57643f4d-c810-41bf-9a75-8d411dc00a98", + "__type": "Sandbox.CharacterController", + "__guid": "f6a77d38-8825-4e12-8f26-8a6adc7cd4e6", "Acceleration": 10, "Bounciness": 0.3, "GroundAngle": 45, @@ -37,51 +37,51 @@ "StepHeight": 18 }, { - "__type": "DemoPlayer", - "__guid": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", + "__type": "SWB.Demo.DemoPlayer", + "__guid": "3e1e96c5-b788-4483-9ffd-7b59b02df678", "AirControl": 0.1, "Body": { "_type": "gameobject", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1" + "go": "55559241-6791-4c24-9635-07aceee3d8a4" }, "BodyRenderer": { "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fc51159a-2082-4de0-8c3e-5f44d049ed23", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "SkinnedModelRenderer" }, "Camera": { "_type": "component", - "component_id": "481831b0-9b7a-4c41-b439-2cc52b22b5da", - "go": "6f238074-1b09-48e2-95e6-e3c03fb7c80a", + "component_id": "e5569ffa-08a7-4b0d-a32a-b20850fa773f", + "go": "90f0756c-ed12-4063-b119-fb330a66a30f", "component_type": "CameraComponent" }, "CrouchSpeed": 90, "GroundControl": 4, "Head": { "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" + "go": "d8a09f79-a5a4-41e7-9522-ff9d3a8df4e8" }, "JumpForce": 350, "MaxForce": 50, "MaxHealth": 100, "RagdollPhysics": { "_type": "component", - "component_id": "cdce8a36-d176-47ba-bf5c-c439374d5257", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fb5d8b8c-8bc7-4ecb-be40-75cf5191cde1", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "ModelPhysics" }, "RootDisplay": { "_type": "component", - "component_id": "3fb8eb7f-93ed-4945-a2eb-e41024e9d0b6", - "go": "b9310aa3-6213-4c95-baaa-20900428ca7f", + "component_id": "ad29c146-7dfc-4d71-a638-275f7b1e7938", + "go": "ef4f1054-23fd-408d-b0fb-fede1d825da6", "component_type": "RootDisplay" }, "RunSpeed": 290, "ViewModelCamera": { "_type": "component", - "component_id": "e5b27222-75d5-45c4-8cc8-3a48e22d524c", - "go": "5a8e3a84-19f1-4edc-a156-6691483d2ebc", + "component_id": "ea5e3826-bd2e-4f0c-a7c5-e1f93e741ca5", + "go": "63bec778-d863-4f1f-b7b8-5efdcf910f61", "component_type": "CameraComponent" }, "WalkSpeed": 160 @@ -89,14 +89,14 @@ ], "Children": [ { - "__guid": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "__guid": "55559241-6791-4c24-9635-07aceee3d8a4", "Name": "Body", "Enabled": true, "NetworkMode": 2, "Components": [ { - "__type": "SkinnedModelRenderer", - "__guid": "251704a8-952d-472d-bcf2-baedc14debbc", + "__type": "Sandbox.SkinnedModelRenderer", + "__guid": "fc51159a-2082-4de0-8c3e-5f44d049ed23", "BodyGroups": 341, "CreateBoneObjects": true, "MaterialGroup": "default", @@ -105,32 +105,32 @@ "Tint": "1,1,1,1" }, { - "__type": "ModelPhysics", - "__guid": "cdce8a36-d176-47ba-bf5c-c439374d5257", + "__type": "Sandbox.ModelPhysics", + "__guid": "fb5d8b8c-8bc7-4ecb-be40-75cf5191cde1", "__enabled": false, "Locking": {}, "Model": "models/citizen/citizen.vmdl", "Renderer": { "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fc51159a-2082-4de0-8c3e-5f44d049ed23", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "SkinnedModelRenderer" }, "RigidbodyFlags": 0 }, { - "__type": "ModelHitboxes", - "__guid": "c98216ee-2df9-456d-9b0b-429a6fe222a1", + "__type": "Sandbox.ModelHitboxes", + "__guid": "ca33f55a-55a2-461c-95d5-f476e03db53e", "Renderer": { "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fc51159a-2082-4de0-8c3e-5f44d049ed23", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "SkinnedModelRenderer" } }, { - "__type": "CapsuleCollider", - "__guid": "620231c7-0a09-4440-93d9-9455d5ed6c31", + "__type": "Sandbox.CapsuleCollider", + "__guid": "f485caf1-2fbd-46ed-a206-e62c28b048c3", "End": "1.5,0,64.4621", "IsTrigger": false, "Radius": 5, @@ -141,7 +141,7 @@ ], "Children": [ { - "__guid": "089038ec-626a-4f3f-8354-6c38522c8072", + "__guid": "ee5bdad6-10d0-481c-98e2-9e8861c969e7", "Name": "pelvis", "Position": "1.266582,0.000014907,31.0736", "Rotation": "-0.4999993,-0.4999994,-0.5000004,0.5000009", @@ -149,7 +149,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "2f9e7b3f-e879-4495-97df-1b8688606ac5", + "__guid": "35caa712-ad73-4dc5-bd93-c1db9b6f6403", "Name": "spine_0", "Position": "3.921827,-0.002448045,-0.0001164233", "Rotation": "0.0002581775,-0.0000002980232,-0.00005638599,1", @@ -157,7 +157,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "f2db805c-fcb6-4026-8e5a-01c48c70b3c6", + "__guid": "8baca1ce-edb3-486a-904d-c85ff2f31034", "Name": "spine_1", "Position": "5.610418,0.00001253671,0.00004611733", "Rotation": "-0.000396952,0.0000002086163,0.0002739429,0.9999998", @@ -165,7 +165,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "aa4fc0b1-bb03-4e41-a716-94f56e5b49c1", + "__guid": "d7fb6527-3983-48cb-a833-f98444706b58", "Name": "spine_2", "Position": "5.610455,0.000009457347,0.00003942099", "Rotation": "0.0002120286,-0.0002525151,0.0000910759,1", @@ -173,7 +173,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "111698da-0119-405f-a627-42d9e165fc3f", + "__guid": "af290c07-0b49-497c-9b14-cdea805af36f", "Name": "neck_0", "Position": "5.820016,-0.09348675,-0.002965245", "Rotation": "0.0000821203,-0.000251025,0.01994136,-0.9998012", @@ -181,7 +181,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "aff1501a-7614-4666-b75d-56f549b11f78", + "__guid": "87a99fd4-3428-40a8-9bd0-8b09f451047b", "Name": "head", "Position": "4.510834,-0.0007621644,-0.00001950618", "Rotation": "0.0000001192093,-0.00000007450581,0.01963396,0.9998072", @@ -189,7 +189,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "2a690139-ed1d-4928-8958-af032d86d731", + "__guid": "b9ecb6ed-8a48-42fb-836b-640a69f2a659", "Name": "eye_L", "Position": "6.90887,5.140466,3.234669", "Rotation": "-0.707108,-0.7071056,-0.000003516674,0.000004142523", @@ -197,7 +197,7 @@ "NetworkMode": 2 }, { - "__guid": "bd6a69e1-e1df-454f-98d6-3285a357cb35", + "__guid": "576762f7-f315-4d24-b5cb-1c77d6142ce0", "Name": "eye_R", "Position": "6.908859,5.140496,-3.234596", "Rotation": "-0.707108,-0.7071056,-0.000003516674,0.000004142523", @@ -205,7 +205,7 @@ "NetworkMode": 2 }, { - "__guid": "8133b304-4f82-4f40-876c-28f45dd12011", + "__guid": "ab0bd9f8-005c-4272-b408-dce8de5a5c3c", "Name": "face_lid_lower_R", "Position": "6.908821,5.140461,-3.234583", "Rotation": "-0.3386923,0.9305478,-0.1307779,-0.04759897", @@ -213,7 +213,7 @@ "NetworkMode": 2 }, { - "__guid": "8638ef64-4f45-4e79-9521-7e1bcddf4135", + "__guid": "5ed4bf55-1b0e-438c-8a5f-aa5a3ccbfa77", "Name": "face_lid_lower_L", "Position": "6.908897,5.140467,3.23468", "Rotation": "0.3386921,-0.9305472,-0.1307825,-0.04760015", @@ -221,7 +221,7 @@ "NetworkMode": 2 }, { - "__guid": "274c1ada-1f89-4ce0-acda-fa4abc3137b5", + "__guid": "7c7bfb5f-77ba-46b7-a9cd-1b0dae3c85e7", "Name": "face_lid_upper_L", "Position": "6.908885,5.140451,3.234676", "Rotation": "-0.8974878,-0.4185047,-0.05881736,0.1261353", @@ -229,7 +229,7 @@ "NetworkMode": 2 }, { - "__guid": "cb8eaee1-b22a-441b-8be8-b0f3e6ac6909", + "__guid": "12ea1288-1d50-41fb-818b-41aed0908d40", "Name": "face_lid_upper_R", "Position": "6.908875,5.140513,-3.234588", "Rotation": "-0.8974884,-0.4185048,0.05881578,-0.1261319", @@ -237,7 +237,7 @@ "NetworkMode": 2 }, { - "__guid": "e2c0193d-00e3-4128-a11a-f21e8719baf1", + "__guid": "952aef8d-b1d0-4f04-9a12-f52db1740c91", "Name": "ear_R", "Position": "5.621449,-0.4154353,-5.92917", "Rotation": "0.04624295,-0.6935213,0.1379467,-0.7055925", @@ -245,7 +245,7 @@ "NetworkMode": 2 }, { - "__guid": "0dbb67d3-c129-4864-97fa-d2323dec820e", + "__guid": "efafa6c8-a056-4545-89a8-fd4385f6971f", "Name": "ear_L", "Position": "5.621478,-0.4155216,5.929071", "Rotation": "-0.7055932,0.1379533,-0.6935186,0.04625109", @@ -257,7 +257,7 @@ ] }, { - "__guid": "0dd59ff9-a78c-46d0-8188-ea94167e26d8", + "__guid": "d266abe9-b112-4641-873a-442e801290ca", "Name": "clavicle_L", "Position": "4.038116,0.2752069,1.103956", "Rotation": "-0.08115548,0.6811197,0.08690505,-0.7224523", @@ -265,7 +265,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "c0db3fe4-295b-40f1-9b34-91a7f423bab7", + "__guid": "d1656bf4-8fd5-4300-8377-60e31b0589b3", "Name": "arm_upper_L", "Position": "6.218335,0.00002176547,0.00004804133", "Rotation": "-0.02770683,-0.3880896,0.06826707,0.9186722", @@ -273,7 +273,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "0af29312-89c9-41bf-8393-fdd185a6c15c", + "__guid": "7a5b0ecd-42e3-4590-ac09-83d3060d9125", "Name": "arm_lower_L", "Position": "10.04519,0.0000154972,-0.00004673001", "Rotation": "0.00000004470348,0.0000004693866,0.1484236,0.9889238", @@ -281,7 +281,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "940734c1-d421-439b-8c90-4af26e76371a", + "__guid": "6207cd16-2a8e-48d1-bd9b-911f881f536a", "Name": "hand_L", "Position": "7.706676,-0.0000008344645,-0.00007987017", "Rotation": "0.09163112,-0.03309625,0.03967814,0.9944518", @@ -289,7 +289,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "141a3485-80be-4b2b-86dc-50d42f7d220d", + "__guid": "c1b539a3-b0cd-4b3c-938a-e5f0af6b344e", "Name": "hold_L", "Position": "5.361056,0.6217204,3.394403", "Rotation": "-0.6958921,-0.170415,-0.392899,0.5764749", @@ -297,7 +297,7 @@ "NetworkMode": 2 }, { - "__guid": "1dd6a0be-0a2d-4cb1-86a4-1ee8536ad444", + "__guid": "52d532d1-4183-433b-bb09-90d43d55ce82", "Name": "finger_thumb_0_L", "Position": "1.127924,1.648618,0.8667801", "Rotation": "0.5684277,0.1216941,0.4117243,0.7018287", @@ -305,7 +305,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "1dbf9445-5b71-45e2-a90d-f88e8df38fef", + "__guid": "abf386af-f5d1-48a0-ace3-ed79503ab178", "Name": "finger_thumb_1_L", "Position": "1.906562,-0.00002780556,-0.00005733965", "Rotation": "-0.0000006342307,-0.1627616,0.000004276633,0.9866654", @@ -313,7 +313,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "383a3e48-103b-4953-ace7-434693ec4dc9", + "__guid": "821110bc-14c9-48e3-961f-e9f6593749b5", "Name": "finger_thumb_2_L", "Position": "2.136307,-0.00004172324,-0.0000980496", "Rotation": "0.0000002533197,-0.08419369,-0.00000004842877,0.9964494", @@ -325,7 +325,7 @@ ] }, { - "__guid": "a05e0384-2e15-4ad1-ab8f-a3bb2e31ab43", + "__guid": "40f6eed9-09bb-488b-b100-2cb76d4f696b", "Name": "finger_index_meta_L", "Position": "2.075291,1.204094,0.3774741", "Rotation": "0.06037846,0.04580591,0.1049121,0.9915894", @@ -333,7 +333,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "2a0e51bf-da2e-4b92-b0a1-1791b003d40c", + "__guid": "96c6c290-7088-4736-a496-beca5fe125f7", "Name": "finger_index_0_L", "Position": "3.068911,-0.0000297427,-0.0001138448", "Rotation": "-0.00339286,-0.2652392,-0.06862513,0.9617316", @@ -341,7 +341,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "8491dc45-befe-4a85-b885-06abe868efcf", + "__guid": "7b9a60f8-4034-4066-a72f-cb626148d9f2", "Name": "finger_index_1_L", "Position": "2.283286,-0.000005125997,-0.000147581", "Rotation": "-0.000001147389,-0.2335206,0.000003024936,0.972352", @@ -349,7 +349,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "8a2945e7-c654-41ef-a3bd-be9ae5d6138c", + "__guid": "c91a365e-355a-48b6-a098-bae183d708a4", "Name": "finger_index_2_L", "Position": "1.594392,-0.0000593811,-0.0001720785", "Rotation": "-0.000004693866,-0.01375909,0.000002592802,0.9999053", @@ -363,7 +363,7 @@ ] }, { - "__guid": "9a3ae601-7825-49a3-ac0d-7fffc3685ca5", + "__guid": "be9ec81c-8962-4305-ab29-7f745ef9c954", "Name": "finger_middle_meta_L", "Position": "2.100665,-0.1590793,0.2858093", "Rotation": "0.00896778,0.03486501,-0.01934981,0.9991645", @@ -371,7 +371,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "628124c3-1c2d-4366-98b4-07c059017075", + "__guid": "bd8a0593-e98d-4e4a-91a9-fdc4109ef7c0", "Name": "finger_middle_0_L", "Position": "2.999226,-0.0000219047,-0.00009429451", "Rotation": "0.0008723736,-0.2335085,0.001296833,0.9723535", @@ -379,7 +379,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "e1560ca0-bd5b-481a-92b9-7e7398cffa73", + "__guid": "6fda1b02-29b7-47a8-8c9a-0beacb523d2a", "Name": "finger_middle_1_L", "Position": "2.560946,0.000001311302,-0.0001174211", "Rotation": "-0.000004440546,-0.2322974,0.00004120171,0.9726449", @@ -387,7 +387,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "df0cb453-2433-433f-a900-2241c78cf6c3", + "__guid": "b2402213-edae-4047-b7f2-547e90abc60c", "Name": "finger_middle_2_L", "Position": "1.68301,-0.00002819299,-0.000164031", "Rotation": "-0.00001375377,-0.04821886,-0.00003314018,0.9988368", @@ -401,7 +401,7 @@ ] }, { - "__guid": "a3da99ff-9968-49fc-8c14-f27a776b3d0e", + "__guid": "41a42f47-420b-49e6-8054-0af09bab1ab9", "Name": "finger_ring_meta_L", "Position": "2.104887,-1.444506,0.2232285", "Rotation": "-0.06376523,-0.02919634,-0.1306909,0.9889396", @@ -409,7 +409,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "04650c4a-4132-4390-a9f1-fd55a84a4f0a", + "__guid": "33f444e7-78da-4317-b953-c912751e0eb7", "Name": "finger_ring_0_L", "Position": "2.824281,-0.00002756714,-0.0001463889", "Rotation": "0.004531637,-0.1855573,0.05619837,0.9810146", @@ -417,7 +417,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "9c7b2969-1bf4-4e73-a8a2-f5c2083a35f9", + "__guid": "9a381d31-f287-42e9-a7af-214742bfe66f", "Name": "finger_ring_1_L", "Position": "2.197991,-0.000003010033,-0.0001496076", "Rotation": "-0.00004592538,-0.2566091,-0.00006532669,0.9665152", @@ -425,7 +425,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "89dc40df-9e37-4da5-bfda-09f82ac116a2", + "__guid": "54fe09b8-ce7d-4988-baa8-a364203caa56", "Name": "finger_ring_2_L", "Position": "1.535339,-0.00002688168,-0.0001718699", "Rotation": "-0.00001230836,-0.05038811,0.000008925796,0.9987297", @@ -439,7 +439,7 @@ ] }, { - "__guid": "6e6ab885-e65a-4a16-9c0b-cd6d779f4890", + "__guid": "6a9badd2-6c17-4393-a0c6-170c9a6abfa3", "Name": "hand_R_to_L_ikrule", "Position": "-28.15185,11.30969,27.26416", "Rotation": "-0.2772723,-0.6901741,-0.00000002980232,0.6684159", @@ -449,21 +449,21 @@ ] }, { - "__guid": "1235a483-f9d3-49a3-a08a-2f3ce8bce793", + "__guid": "75492563-48f2-4294-a81c-39f2659e876e", "Name": "arm_lower_L_twist0", "Position": "0.000006837199,0.000007548724,-0.00006464363", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "12fc2aba-fe25-406a-972c-562096e7ef77", + "__guid": "9381a608-f8e2-4649-afa9-c233fd59e270", "Name": "arm_lower_L_twist1", "Position": "3.853339,-0.000001251697,-0.00007236", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "d06aebaf-413a-40f7-a075-25c4d2652cd7", + "__guid": "2215e8c8-e6b7-449d-ad67-ec3293215be3", "Name": "arm_elbow_helper_L", "Position": "-0.000005216786,0.000003112479,-0.00006175246", "Rotation": "0.0000003278255,-0.00000005960464,-0.7577646,0.6525283", @@ -473,14 +473,14 @@ ] }, { - "__guid": "65dbef62-2232-41d9-86c0-979c1a3ebcdf", + "__guid": "51d2c1cd-d6ea-46cc-b144-c749718f911e", "Name": "arm_upper_L_twist0", "Position": "0.00001492683,0.00001386152,-0.00002693847", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "2836e3bf-2e96-4f09-a58f-15a519224934", + "__guid": "de1bbf02-7a4d-44ea-9a66-6411485f0ccd", "Name": "arm_upper_L_twist1", "Position": "5.022609,0.000015527,-0.0000271797", "Enabled": true, @@ -491,7 +491,7 @@ ] }, { - "__guid": "6aea5ae9-eea0-4f40-a87d-3252fd5f11cb", + "__guid": "3f1d8ce5-1d74-4491-956f-c8f8198b939a", "Name": "clavicle_R", "Position": "4.036982,0.2748705,-1.108162", "Rotation": "-0.08130813,0.6814711,-0.08696642,0.7220963", @@ -499,7 +499,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "f73c6ae4-12df-4a77-8e7f-96cf2a4a7be3", + "__guid": "d253e760-5f8d-42c9-a545-a707c0bb991c", "Name": "arm_upper_R", "Position": "6.218294,0.000005156732,-0.00006759165", "Rotation": "0.0277065,0.3880895,0.06826836,0.918672", @@ -507,7 +507,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "a3b72063-9f3c-4507-a75e-900ea3ae4950", + "__guid": "dba3ac75-763f-4dbd-bab8-e7828a58cfb1", "Name": "arm_lower_R", "Position": "10.04517,0.00000965595,-0.00005674361", "Rotation": "-0.0000000372529,0.0000001937151,0.1484233,0.9889239", @@ -515,7 +515,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "51efaa59-3985-4411-9c69-fde51ecd4ff9", + "__guid": "6eea9fc5-8149-4115-8e88-8478b060cce2", "Name": "hand_R", "Position": "7.706653,0.00002896785,-0.00004005432", "Rotation": "-0.09163144,0.03309621,0.03967842,0.9944515", @@ -523,7 +523,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "6a782ea2-8931-4821-ab99-b9e037f2bfd1", + "__guid": "95fd4cc3-9dee-46fe-9188-6f553816b193", "Name": "hold_R", "Position": "5.361083,0.6219016,-3.394506", "Rotation": "-0.576474,0.3928988,0.1704146,0.695893", @@ -531,7 +531,7 @@ "NetworkMode": 2 }, { - "__guid": "05c6907c-4fa7-46b2-b6b4-502c40ab3e5f", + "__guid": "6ec83d1e-6bf4-4503-982b-8e63f2fac091", "Name": "finger_thumb_0_R", "Position": "1.127924,1.648677,-0.8668855", "Rotation": "-0.5684255,-0.1216944,0.4117284,0.7018281", @@ -539,7 +539,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "c9ff6607-93b2-42d0-828f-d36119576def", + "__guid": "26524468-1c1b-455f-85ac-d5d109b6b193", "Name": "finger_thumb_1_R", "Position": "1.906573,0.00001248717,-0.00005304812", "Rotation": "0.00000147149,0.1627604,-0.000003732741,0.9866656", @@ -547,7 +547,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "ae26826e-d7da-4d6c-a3df-14cfb7e9dfc6", + "__guid": "11cd0713-0e13-40be-91c4-7436d7e4288d", "Name": "finger_thumb_2_R", "Position": "2.136316,0.00003880261,-0.00007760521", "Rotation": "0.0000000782311,0.08420044,0.0000005532056,0.9964489", @@ -559,7 +559,7 @@ ] }, { - "__guid": "89aebe8f-c55d-4cad-8c9c-0067001ffb24", + "__guid": "d670f951-7e67-4935-993d-2f344a57b2c9", "Name": "finger_index_meta_R", "Position": "2.075282,1.204136,-0.3776003", "Rotation": "-0.0603777,-0.04580308,0.1049159,0.9915892", @@ -567,7 +567,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "182682ee-d212-4e7b-9cec-553b4ea783d0", + "__guid": "10c6b369-0fc9-43dc-9a7d-7d6294542569", "Name": "finger_index_0_R", "Position": "3.068901,0.00003266334,-0.00002348423", "Rotation": "0.003392495,0.2652348,-0.06862299,0.9617328", @@ -575,7 +575,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "1522347b-2fb2-493f-a8f4-91855b3d9629", + "__guid": "ea94b248-2ee6-45dd-9912-a62c431c784f", "Name": "finger_index_1_R", "Position": "2.283288,0.00002986193,-0.00004714727", "Rotation": "0.000002712011,0.2335185,-0.000001698732,0.9723523", @@ -583,7 +583,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "b4537907-89f1-466f-8509-3f1f0235f970", + "__guid": "e8ab8735-77c1-4602-99c8-19e1a7792198", "Name": "finger_index_2_R", "Position": "1.594425,0.00007919966,-0.0001038443", "Rotation": "0.000004738569,0.01376472,0.0000004470348,0.9999053", @@ -597,7 +597,7 @@ ] }, { - "__guid": "78b134e4-da2f-4827-a18a-0a504646de33", + "__guid": "9b0a3742-3520-4884-9239-bb512145ee98", "Name": "finger_middle_meta_R", "Position": "2.100654,-0.159044,-0.2859281", "Rotation": "-0.008967884,-0.03486186,-0.01934614,0.9991646", @@ -605,7 +605,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "5b47617f-19dd-48ac-a110-693e9ddfa08f", + "__guid": "2bdf3331-bea1-4148-9fe0-a4f23818f9c3", "Name": "finger_middle_0_R", "Position": "2.999228,0.00005188583,-0.0000231266", "Rotation": "-0.0008731559,0.2335047,0.001300201,0.9723544", @@ -613,7 +613,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "fcfdcb30-090a-4046-8b5d-afc2a85b4820", + "__guid": "a2da8a47-2575-45f1-9619-62c8b447d895", "Name": "finger_middle_1_R", "Position": "2.560971,0.00003793835,-0.00004655122", "Rotation": "0.000005975366,0.2322946,0.00003750622,0.9726455", @@ -621,7 +621,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "df921e45-5985-4b37-aa0c-569285d952b0", + "__guid": "6024e04b-ee77-48f9-90e2-aeb137526390", "Name": "finger_middle_2_R", "Position": "1.68301,0.000066936,-0.0001042252", "Rotation": "0.00001381338,0.04822427,-0.00003582239,0.9988364", @@ -635,7 +635,7 @@ ] }, { - "__guid": "b373b9bb-a7fa-481a-96f8-0f8ab940db9c", + "__guid": "aab05168-df35-479e-b89b-078a0df273d6", "Name": "finger_ring_meta_R", "Position": "2.104869,-1.444472,-0.2233304", "Rotation": "0.06376481,0.02919935,-0.1306878,0.9889399", @@ -643,7 +643,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "69912e80-6c77-4d1e-9485-76b73c321ed3", + "__guid": "2b1a1175-87f3-4538-81fa-7eab64ddff70", "Name": "finger_ring_0_R", "Position": "2.824278,0.00006249545,-0.00001382827", "Rotation": "-0.004531965,0.185554,0.0562013,0.9810151", @@ -651,7 +651,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "08ae0a29-4833-4b68-b9ab-4e6f1debdfa2", + "__guid": "5c1667fa-32c1-4551-b533-6febc01e112e", "Name": "finger_ring_1_R", "Position": "2.198021,0.00003910064,-0.00004911422", "Rotation": "0.00004531443,0.2566069,-0.00006809831,0.9665158", @@ -659,7 +659,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "893764ef-18dc-4ffd-88bc-5fb2549da500", + "__guid": "067309aa-2446-4594-a877-95b997cb810f", "Name": "finger_ring_2_R", "Position": "1.535354,0.00007754565,-0.000111118", "Rotation": "0.00001199543,0.05039279,0.000008508563,0.9987295", @@ -673,7 +673,7 @@ ] }, { - "__guid": "92f085d9-b2af-4461-9867-110ba8e7693a", + "__guid": "473e9057-9ce9-4c48-b04e-fa438d63a074", "Name": "hand_L_to_R_ikrule", "Position": "-28.15179,11.30986,-27.26431", "Rotation": "0.2772729,0.6901738,0.000000372529,0.6684158", @@ -683,21 +683,21 @@ ] }, { - "__guid": "36d1cf0d-dbf0-4609-9a5d-f4115800a6ae", + "__guid": "fb652aa4-31c7-4a71-b69f-e4012b6a9a32", "Name": "arm_lower_R_twist1", "Position": "3.853322,0.00002682209,-0.00005733966", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "d5807b27-2498-4656-a16c-2ef44da6cde9", + "__guid": "9a3f01bb-8328-4338-a692-7c8b4c7b82b1", "Name": "arm_lower_R_twist0", "Position": "-0.0000160776,0.0000261824,-0.00004466753", "Enabled": true, "NetworkMode": 2, "Children": [ { - "__guid": "d7046e41-a0e5-4941-a83f-3f987eea8ea3", + "__guid": "15b0bd0d-304d-4639-9e09-f92b4af7570a", "Name": "arm_elbow_helper_R", "Position": "-0.000006003497,0.00003117744,-0.00005398668", "Rotation": "-0.0000007376075,0.0000002682209,0.7577677,-0.6525244", @@ -709,14 +709,14 @@ ] }, { - "__guid": "53edbce1-a4bd-4bd2-91bb-874210655623", + "__guid": "83087534-dbbd-4d3e-be77-680cb51520a0", "Name": "arm_upper_R_twist0", "Position": "-0.00001033032,0.00001789448,-0.00005867187", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "7d488be2-d5a8-4092-95ed-03589e23d752", + "__guid": "0ece251d-ed12-4087-97c3-475e5cee5b32", "Name": "arm_upper_R_twist1", "Position": "5.022587,0.00001567602,-0.00004744529", "Enabled": true, @@ -727,7 +727,7 @@ ] }, { - "__guid": "912cd7ed-00a9-4771-9eca-d595ff5d64f5", + "__guid": "7cc8f63d-2fdd-4742-80e7-7875a55222f6", "Name": "neck_clothing", "Position": "5.820016,-0.09348675,-0.002965245", "Rotation": "0.0000821203,-0.000251025,0.01994136,-0.9998012", @@ -741,7 +741,7 @@ ] }, { - "__guid": "b7a83c37-19cb-4652-8fbf-199643f3bea3", + "__guid": "2b6b2029-7abf-4cdc-9d2d-3694b2d2a375", "Name": "leg_upper_R", "Position": "-0.2881533,-0.4264439,-4.427378", "Rotation": "-0.000001549721,1,0.0000001788139,-0.000000923872", @@ -749,7 +749,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "53f3ee94-54ae-4fcb-86d9-68b12586cd3e", + "__guid": "b8f5b492-286c-42ee-8254-7debba7de2be", "Name": "leg_lower_R", "Position": "14.47037,-0.00001596073,0.00000106488", "Rotation": "-0.000001326203,0.0000001043081,-0.01828091,0.9998329", @@ -757,7 +757,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "58fd9b26-dad0-478e-afb9-b4dd016e70e9", + "__guid": "18bebf21-f239-4dae-b479-db36355156e0", "Name": "ankle_R", "Position": "12.51552,0.000006943942,0.000000707878", "Rotation": "0.0000006258488,-0.000001043081,0.3914976,0.9201791", @@ -765,7 +765,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "e787f0c7-fd66-4261-a152-f76cbe75f937", + "__guid": "72e073fb-2254-44e3-b461-b23442de5bf4", "Name": "ball_R", "Position": "4.429121,0.0000002384186,0.000004078142", "Rotation": "-0.0000005032102,0.000001490116,0.3907284,0.920506", @@ -775,21 +775,21 @@ ] }, { - "__guid": "1a67996b-04ba-4eba-ac66-0e25e69e5bf1", + "__guid": "c180bca7-b572-4881-a2e0-ab664eee2e28", "Name": "leg_lower_R_twist1", "Position": "6.257761,0.000006318093,-0.000003699168", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "f5e8285a-abcd-42bd-b07f-3a97f9aa6622", + "__guid": "3c9b0055-f731-4d2a-bb3b-45fd9f7d26fc", "Name": "leg_lower_R_twist0", "Position": "-0.000005885966,0.000004377334,-0.00001049043", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "886cf9ae-8f30-4690-8a4b-6b1f4e48b3ee", + "__guid": "00f45073-15d6-494a-b11d-e14f4d2d3dc7", "Name": "leg_knee_helper_R", "Position": "0.000001733967,0.000004775387,-0.000009536718", "Rotation": "0.0000009241048,-0.000001251698,0.7135268,0.7006278", @@ -799,14 +799,14 @@ ] }, { - "__guid": "c425b000-fc2c-4cdc-b01c-4509318f25c3", + "__guid": "6de75f54-9162-4c64-b54c-e149c703da6a", "Name": "leg_upper_R_twist1", "Position": "7.235195,0.00002492144,-0.00001329576", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "8eb13484-cac1-4109-a110-ba0c5fd92460", + "__guid": "e92a43ce-a56c-4bb2-8e5d-44ce4363d74c", "Name": "leg_upper_R_twist0", "Position": "0.000007629447,0.000005960508,-0.0000171661", "Rotation": "-0.00000005960464,0,0.000003039837,1", @@ -814,7 +814,7 @@ "NetworkMode": 2 }, { - "__guid": "e445119f-5f9c-460b-9673-5c85ef37a06d", + "__guid": "d1283f31-662c-4134-8c43-8b88c813a957", "Name": "leg_glute_helper_R", "Position": "0.00002098089,0.000005543324,-0.00001764288", "Rotation": "-0.000001056968,-0.0000006258488,-0.7071052,0.7071084", @@ -824,7 +824,7 @@ ] }, { - "__guid": "3d329fb5-eb55-434d-8c67-41ea8b6a857a", + "__guid": "2d7c8307-b526-41db-b6bf-7aae4c047a64", "Name": "leg_upper_L", "Position": "-0.2881297,-0.4264377,4.427379", "Rotation": "-0.000001549721,1,0.0000001788139,-0.000001162291", @@ -832,7 +832,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "c475b48a-4c48-40c9-84de-5beb91eddc60", + "__guid": "edf474a6-619a-40b3-b3c6-d594a4ed2eec", "Name": "leg_lower_L", "Position": "14.47037,-0.00004838563,-0.00002541375", "Rotation": "-0.000003024936,-0.0000004023314,-0.01828231,0.9998329", @@ -840,7 +840,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "2349916e-96ee-4fcf-9fc6-6aac42479f23", + "__guid": "dd722ba5-ec99-4238-ba69-7fe722d73f81", "Name": "ankle_L", "Position": "12.51552,0.000004500151,-0.000008570384", "Rotation": "0.000003278255,-0.0000009536743,0.3914973,0.9201792", @@ -848,7 +848,7 @@ "NetworkMode": 2, "Children": [ { - "__guid": "c027dbf9-2dce-4600-a17a-a19e8f2ad3c6", + "__guid": "8f2a3f9c-30db-4d56-ac46-7acd5418c96c", "Name": "ball_L", "Position": "4.429115,0.000001430511,-0.00001387228", "Rotation": "-0.0000004862416,0.000001206994,0.3907294,0.9205056", @@ -858,21 +858,21 @@ ] }, { - "__guid": "3914df05-ba6c-413f-ae30-ea8e45b6c9eb", + "__guid": "2f0e2b4d-c952-441e-b6c4-475c2fc01ba9", "Name": "leg_lower_L_twist1", "Position": "6.257759,0.000003129244,-0.00001000724", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "20e23cb4-6b0d-4bb0-951c-6cbcab2c7857", + "__guid": "c61d4e25-8296-4f71-ba33-6283e222148e", "Name": "leg_lower_L_twist0", "Position": "-0.000007737578,0.000002818492,-0.000009536751", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "17c5c785-a3cf-4f9e-9800-cde42fb7de68", + "__guid": "c8ec8f8a-68a0-4fc6-b7cc-4ee6d158bff8", "Name": "leg_knee_helper_L", "Position": "-0.00001533572,0.000001824768,-0.000009536788", "Rotation": "-0.000003013527,-0.00000166893,0.7135276,0.700627", @@ -882,21 +882,21 @@ ] }, { - "__guid": "b7caaac0-4d0f-4120-9117-580ffe569bf8", + "__guid": "997b7668-7435-4c10-ba4b-e3238c2cfc11", "Name": "leg_upper_L_twist1", "Position": "7.235189,0.00002110672,-0.000007938437", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "5c0e4762-5b7c-4e35-b98a-bee6a20f6462", + "__guid": "c5c119d0-54e2-4067-82f1-ea30dc4cb713", "Name": "leg_upper_L_twist0", "Position": "0.000007629402,0.000009954012,-0.000009059861", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "2dc430e2-a3b8-4947-9528-d709ebbbab68", + "__guid": "2fd46c96-2bbb-4a73-89ff-1d265612387b", "Name": "leg_glute_helper_L", "Position": "0.0000190735,0.000009596425,-0.000009536643", "Rotation": "-0.000001011624,-0.0000006854534,-0.7071055,0.707108", @@ -908,14 +908,14 @@ ] }, { - "__guid": "8e7a4d36-1c4a-499c-b924-6539cad9d6b6", + "__guid": "853fe95c-29ef-45ed-ad31-b74053ad9582", "Name": "root_IK", "Position": "1.266575,0.0000071965,0", "Enabled": true, "NetworkMode": 2, "Children": [ { - "__guid": "cb416d5c-937a-4ff1-9ce0-0b74800d7898", + "__guid": "602887a4-7017-44cd-a57b-7251c4c7f37e", "Name": "hand_R_IK_target", "Position": "0.6939846,-20.39473,39.24799", "Rotation": "0.2871271,0.2142481,-0.5281312,0.7698917", @@ -923,7 +923,7 @@ "NetworkMode": 2 }, { - "__guid": "d442a383-cdcf-4d7e-b4b6-3062724ff52e", + "__guid": "57f9f5d0-bb69-4e24-b492-49d97479433b", "Name": "hand_L_IK_target", "Position": "0.6941153,20.3947,39.24792", "Rotation": "0.7698929,0.5281296,-0.2142482,0.2871266", @@ -931,14 +931,14 @@ "NetworkMode": 2 }, { - "__guid": "58abbd9f-9e41-4526-b810-87bddd50f325", + "__guid": "b0ca6889-96de-468d-8bc0-a0f21abbba51", "Name": "aim_matrix_02a", "Position": "4.638925,-0.0000008343597,9.8425", "Enabled": true, "NetworkMode": 2, "Children": [ { - "__guid": "78cfe9d7-de88-471c-8297-03fcdca30889", + "__guid": "d294d688-06ed-4c31-adbc-fc0f6cb09934", "Name": "aim_matrix_02b", "Position": "3.937001,-0.0000004822493,-0.00000143021", "Enabled": true, @@ -947,14 +947,14 @@ ] }, { - "__guid": "06b04373-b9e9-4917-a4f0-c2a9059dd99a", + "__guid": "1724b419-9816-4d0b-bbea-707c543e24b7", "Name": "aim_matrix_01", "Position": "4.638925,-0.0000008343597,11.811", "Enabled": true, "NetworkMode": 2 }, { - "__guid": "d2d4d631-9237-457f-aadc-734406a25a1c", + "__guid": "5ded2f08-680f-46ca-887f-124e572b326e", "Name": "foot_R_IK_target", "Position": "-0.8840668,-4.427395,3.807913", "Rotation": "0.6508947,0.2762884,-0.2762876,0.6508964", @@ -962,7 +962,7 @@ "NetworkMode": 2 }, { - "__guid": "a91cdfb3-6b5c-41f8-9bcd-a3853bc1a532", + "__guid": "c033fb7e-20c4-4c6b-ad1a-fa0e3f197f16", "Name": "foot_L_IK_target", "Position": "-0.884093,4.427404,3.807924", "Rotation": "0.650896,0.276287,-0.2762895,0.6508948", @@ -974,7 +974,7 @@ ] }, { - "__guid": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8", + "__guid": "d8a09f79-a5a4-41e7-9522-ff9d3a8df4e8", "Name": "Head", "Position": "0,0,60", "Tags": "head", @@ -982,19 +982,19 @@ "NetworkMode": 2 }, { - "__guid": "5a8e3a84-19f1-4edc-a156-6691483d2ebc", + "__guid": "63bec778-d863-4f1f-b7b8-5efdcf910f61", "Name": "ViewModelCamera", "Position": "0,0,-9999", "Enabled": true, "NetworkMode": 2, "Components": [ { - "__type": "CameraComponent", - "__guid": "e5b27222-75d5-45c4-8cc8-3a48e22d524c", + "__type": "Sandbox.CameraComponent", + "__guid": "ea5e3826-bd2e-4f0c-a7c5-e1f93e741ca5", "__enabled": false, "BackgroundColor": "0.33333,0.46275,0.52157,1", "ClearFlags": "Depth, Stencil", - "FieldOfView": 70, + "FieldOfView": 90, "IsMainCamera": false, "Orthographic": false, "OrthographicHeight": 1204, @@ -1009,7 +1009,7 @@ ] }, { - "__guid": "6f238074-1b09-48e2-95e6-e3c03fb7c80a", + "__guid": "90f0756c-ed12-4063-b119-fb330a66a30f", "Name": "Camera", "Position": "-12.7616,-58.90898,64.64638", "Rotation": "-0.002984795,0.02863883,0.1036175,0.9942003", @@ -1019,11 +1019,11 @@ "NetworkMode": 2, "Components": [ { - "__type": "CameraComponent", - "__guid": "481831b0-9b7a-4c41-b439-2cc52b22b5da", + "__type": "Sandbox.CameraComponent", + "__guid": "e5569ffa-08a7-4b0d-a32a-b20850fa773f", "BackgroundColor": "0.33333,0.46275,0.52157,1", "ClearFlags": "All", - "FieldOfView": 70, + "FieldOfView": 90, "IsMainCamera": true, "Orthographic": false, "OrthographicHeight": 1204, @@ -1036,54 +1036,54 @@ "ZNear": 0.1 }, { - "__type": "CameraMovement", - "__guid": "ad4749ba-a6f9-4a88-9e85-d3eaeceedcaa", + "__type": "SWB.Player.CameraMovement", + "__guid": "84ae349c-4ee9-458f-b68c-cce831247b4c", "Body": { "_type": "gameobject", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1" + "go": "55559241-6791-4c24-9635-07aceee3d8a4" }, "BodyRenderer": { "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", + "component_id": "fc51159a-2082-4de0-8c3e-5f44d049ed23", + "go": "55559241-6791-4c24-9635-07aceee3d8a4", "component_type": "SkinnedModelRenderer" }, "Distance": 0, "Head": { "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" + "go": "d8a09f79-a5a4-41e7-9522-ff9d3a8df4e8" }, "Player": { "_type": "component", - "component_id": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", - "go": "d1e672e7-113b-492c-b449-50034808dd6a", + "component_id": "3e1e96c5-b788-4483-9ffd-7b59b02df678", + "go": "bf0f959a-8e13-4133-8fc5-edc7aa3d1b0c", "component_type": "DemoPlayer" } } ] }, { - "__guid": "b9310aa3-6213-4c95-baaa-20900428ca7f", + "__guid": "ef4f1054-23fd-408d-b0fb-fede1d825da6", "Name": "RootUI", "Position": "43.30865,368.8296,-4.152458", "Enabled": true, "NetworkMode": 2, "Components": [ { - "__type": "ScreenPanel", - "__guid": "9dffe164-8f37-4041-8e73-819f9685aa0e", + "__type": "Sandbox.ScreenPanel", + "__guid": "f3dc770f-ffbb-4c92-8c3d-f4c665332e20", "AutoScreenScale": true, "Opacity": 1, "Scale": 1, "ZIndex": 100 }, { - "__type": "RootDisplay", - "__guid": "3fb8eb7f-93ed-4945-a2eb-e41024e9d0b6", + "__type": "SWB.HUD.RootDisplay", + "__guid": "ad29c146-7dfc-4d71-a638-275f7b1e7938", "Player": { "_type": "component", - "component_id": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", - "go": "d1e672e7-113b-492c-b449-50034808dd6a", + "component_id": "3e1e96c5-b788-4483-9ffd-7b59b02df678", + "go": "bf0f959a-8e13-4133-8fc5-edc7aa3d1b0c", "component_type": "DemoPlayer" } } diff --git a/assets/prefabs/player.prefab_c b/assets/prefabs/player.prefab_c index ab8f716..55bd62f 100644 Binary files a/assets/prefabs/player.prefab_c and b/assets/prefabs/player.prefab_c differ diff --git a/assets/shaders/swb_sam_red_dot.shader b/assets/shaders/swb_sam_red_dot.shader new file mode 100644 index 0000000..e68b414 --- /dev/null +++ b/assets/shaders/swb_sam_red_dot.shader @@ -0,0 +1,261 @@ +//========================================================================================================================= +// Optional +//========================================================================================================================= +HEADER +{ + Description = "Glass Shader"; + Version = 3; +} + +//========================================================================================================================= +// Optional +//========================================================================================================================= +FEATURES +{ + #include "common/features.hlsl" + Feature( F_RENDER_SIGHTS_ONLY, 0..1, "Glass"); +} + +//========================================================================================================================= +// Optional +//========================================================================================================================= +MODES +{ + VrForward(); // Indicates this shader will be used for main rendering + ToolsVis( S_MODE_TOOLS_VIS ); // Ability to see in the editor + ToolsWireframe("vr_tools_wireframe.shader"); // Allows for mat_wireframe to work + ToolsShadingComplexity("tools_shading_complexity.shader"); // Shows how expensive drawing is in debug view + Depth( S_MODE_DEPTH ); +} + +//========================================================================================================================= +COMMON +{ + #include "common/shared.hlsl" +} + +//========================================================================================================================= + +struct VertexInput +{ + #include "common/vertexinput.hlsl" +}; + +//========================================================================================================================= + +struct PixelInput +{ + #include "common/pixelinput.hlsl" +}; + +//========================================================================================================================= + +VS +{ + #include "common/vertex.hlsl" + // + // Main + // + PixelInput MainVs(VS_INPUT i) + { + PixelInput o = ProcessVertex(i); + // Add your vertex manipulation functions here + return FinalizeVertex(o); + } +} + +//========================================================================================================================= + +PS +{ + // Combos ---------------------------------------------------------------------------------------------- + StaticCombo( S_MODE_DEPTH, 0..1, Sys(ALL) ); + StaticCombo( S_RENDER_SIGHTS_ONLY, F_RENDER_SIGHTS_ONLY, Sys(ALL) ); + DynamicCombo( D_MULTIVIEW_INSTANCING, 0..1, Sys(PC) ); + + // Transparency + #if (S_RENDER_SIGHTS_ONLY) + #define BLEND_MODE_ALREADY_SET + RenderState(BlendEnable, true); + RenderState(SrcBlend, SRC_ALPHA); + RenderState(DstBlend, INV_SRC_ALPHA); + #endif + + // Attributes ------------------------------------------------------------------------------------------ + + #include "common/pixel.hlsl" + + BoolAttribute(bWantsFBCopyTexture, !F_RENDER_SIGHTS_ONLY ); + BoolAttribute(translucent, true); + + CreateTexture2D( g_tFrameBufferCopyTexture ) < Attribute("FrameBufferCopyTexture"); SrgbRead( false ); Filter(MIN_MAG_MIP_LINEAR); AddressU( MIRROR ); AddressV( MIRROR ); > ; + CreateTexture2DMS( g_tSceneDepth ) < Attribute( "DepthBuffer" ); SrgbRead( false ); Filter( POINT ); AddressU( MIRROR ); AddressV( MIRROR ); >; + + // + // Blur and Refraction Settings + // + float g_flBlurAmount < Default(0.0f); Range(0.0f, 1.0f); UiGroup("Glass,10/10"); > ; + float g_flRefractionStrength < Default(1.005); Range(1.0, 1.1); UiGroup("Glass,10/20"); > ; + float g_flIridescence < Default(600.0); Range(0.0f, 1000.0); UiGroup("Glass,10/30"); > ; + float g_flIridescenceScale < Default(1.0); Range(0.0f, 10.0); UiGroup("Glass,10/30"); > ; + + float3 g_vSightLightColor < UiType( Color ); Default3(1.0, 1.0, 1.0); UiGroup("Glass,10/40"); > ; + float g_flSightDistanceScale < Default(1.0); Range(0.0, 20.0); UiGroup("Glass,10/50"); > ; + + // + // Overlay layer + // + CreateInputTexture2D(RedDot, Srgb, 8, "", "_color", "Sight Dot,10/10", Default3(0.0, 0.0, 0.0)); + CreateInputTexture2D(RedDot2, Srgb, 8, "", "_color", "Sight Dot,10/10", Default3(0.0, 0.0, 0.0)); + CreateInputTexture2D(RedDot3, Srgb, 8, "", "_color", "Sight Dot,10/10", Default3(0.0, 0.0, 0.0)); + CreateTexture2DWithoutSampler(g_tRedDot) < Channel(R, Box(RedDot), Linear); Channel(G, Box(RedDot2), Linear); Channel(B, Box(RedDot3), Linear); OutputFormat(BC7); SrgbRead(false); > ; + + float3 GetIridescence(float3 vCameraDirWs, float3 vNormalWs, float k) + { + const float3 c1 = float3(3.54585104, 2.93225262, 2.41593945); + const float3 x1 = float3(0.69549072, 0.49228336, 0.27699880); + const float3 y1 = float3(0.02312639, 0.15225084, 0.52607955); + + const float3 c2 = float3(3.90307140, 3.21182957, 3.96587128); + const float3 x2 = float3(0.11748627, 0.86755042, 0.66077860); + const float3 y2 = float3(0.84897130, 0.88445281, 0.73949448); + + float3 color = 0; + float NDotV = dot(vNormalWs, vCameraDirWs); + + [unroll] + for (int n = 1; n <= 8; n++) { + float wavelength = abs( NDotV ) * k / float(n); + float x = saturate( ( wavelength - 400.0f ) / 300.0f ); + + float3 col1 = saturate(1 - (c1 * (x - x1)) * (c1 * (x - x1)) - y1); + float3 col2 = saturate(1 - (c2 * (x - x2)) * (c2 * (x - x2)) - y2); + + color += col1 + col2; + } + + return color; + } + + // + // Main + // + float4 MainPs(PixelInput i) : SV_Target0 + { + Material m = Material::From(i); + + // Shadows + #if S_MODE_DEPTH + { + float flOpacity = CalcBRDFReflectionFactor(dot(-i.vNormalWs.xyz, g_vCameraDirWs.xyz), m.Roughness, 0.04).x; + + flOpacity = pow(flOpacity, 1.0f / 2.0f); + flOpacity = lerp(flOpacity, 0.75f, sqrt(m.Roughness)); // Glossiness + flOpacity = lerp(flOpacity, 1.0 - dot(-i.vNormalWs.xyz, g_vCameraDirWs.xyz), ( g_flRefractionStrength - 1.0f ) * 5.0f ); // Refraction + flOpacity = lerp(1.0f, flOpacity + 0.04f, length(m.Albedo)); // Albedo absorption + + OpaqueFadeDepth(flOpacity, i.vPositionSs.xy); + + return 1; + } + #endif + + m.Metalness = 0; // Glass is always non-metallic + + float3 vViewRayWs = normalize(i.vPositionWithOffsetWs.xyz); + float flNDotV = saturate(dot(-m.Normal, vViewRayWs)); + float3 vEnvBRDF = CalcBRDFReflectionFactor(flNDotV, m.Roughness, 0.04); + + float4 vDotColor; + + { + float4 vRefractionColor = 0; + + float flDepthPs = RemapValClamped( Tex2DMS( g_tSceneDepth, i.vPositionSs.xy, 0 ).r, g_flViewportMinZ, g_flViewportMaxZ, 0.0, 1.0); + float3 vRefractionWs = RecoverWorldPosFromProjectedDepthAndRay(flDepthPs, normalize(i.vPositionWithOffsetWs.xyz)) - g_vCameraPositionWs; + float flDistanceVs = distance(i.vPositionWithOffsetWs.xyz, vRefractionWs); + + float3 vRefractRayWs = refract(vViewRayWs, m.Normal, 1.0 / g_flRefractionStrength); + float3 vRefractWorldPosWs = i.vPositionWithOffsetWs.xyz + vRefractRayWs * flDistanceVs; + + float4 vPositionPs = Position4WsToPs(float4(vRefractWorldPosWs, 0)); + + float2 vPositionSs = vPositionPs.xy / vPositionPs.w; + vPositionSs = vPositionSs * 0.5 + 0.5; + + vPositionSs.y = 1.0 - vPositionSs.y; + + // + // Multiview + // + #if (D_MULTIVIEW_INSTANCING) + { + vPositionSs.x *= 0.5; + } + #endif + + float flAmount; + float3 vAlbedoTint = m.Albedo; + vAlbedoTint += GetIridescence( vViewRayWs, m.Normal, g_flIridescence ) * g_flIridescenceScale * m.Albedo; + + // + // Color and blur + // + { + flAmount = g_flBlurAmount * m.Roughness * (1.0 - (1.0 / flDistanceVs)); + + // Isotropic blur based on grazing angle + flAmount /= flNDotV; + + const int nNumMips = 7; + + float2 vUV = float2(vPositionSs) * g_vFrameBufferCopyInvSizeAndUvScale.zw; + + vRefractionColor = Tex2DLevel(g_tFrameBufferCopyTexture, vUV, sqrt(flAmount) * nNumMips); + } + + // Blend + { + m.Emission = lerp(vRefractionColor.xyz, 0.0f, vEnvBRDF); + m.Emission *= vAlbedoTint; + m.Albedo = 0; + } + + // Sight dot + { + float3 vRedDotColor = g_vSightLightColor * 20.0f; + + float3 vCameraToPosition = i.vPositionWithOffsetWs; + float3 vCameraDir = normalize( vCameraToPosition ); + + float flProjectDirOntoNormal = 1.0f / dot( vCameraDir, m.Normal ); + float flProjectA = -g_flSightDistanceScale * flProjectDirOntoNormal ; + + float flProjectDirOntoTangentU = dot( vCameraDir, i.vTangentUWs ) ; + float flProjectDirOntoTangentV = dot( vCameraDir, i.vTangentVWs ) ; + + float2 vRedDotUV = saturate( i.vTextureCoords.xy + ( flProjectA * 0.5 ) * float2( flProjectDirOntoTangentU, flProjectDirOntoTangentV ) ); + float2 vRedDotUV2 = saturate( i.vTextureCoords.xy + ( flProjectA * 1.1 ) * float2( flProjectDirOntoTangentU, flProjectDirOntoTangentV ) ); + float2 vRedDotUV3 = saturate( i.vTextureCoords.xy + ( flProjectA * 1.2 ) * float2( flProjectDirOntoTangentU, flProjectDirOntoTangentV ) ); + + float flRedDot = Tex2DLevelS(g_tRedDot, TextureFiltering, vRedDotUV, sqrt(flAmount) * 7 ).r; + flRedDot += Tex2DLevelS(g_tRedDot, TextureFiltering, vRedDotUV2, sqrt(flAmount) * 7 ).g; + flRedDot += Tex2DLevelS(g_tRedDot, TextureFiltering, vRedDotUV3, sqrt(flAmount) * 7 ).b; + + vDotColor = float4( flRedDot * vRedDotColor * vAlbedoTint, flRedDot ); + m.Emission = lerp(m.Emission, vDotColor.rgb, vDotColor.a ); + } + + #if S_MODE_TOOLS_VIS + m.Albedo = m.Emission; + m.Emission = 0; + #endif + } + + #if S_RENDER_SIGHTS_ONLY + return vDotColor; + #endif + + return ShadingModelStandard::Shade(i, m); + } +} \ No newline at end of file diff --git a/assets/shaders/swb_sam_red_dot.shader_c b/assets/shaders/swb_sam_red_dot.shader_c new file mode 100644 index 0000000..5d94392 Binary files /dev/null and b/assets/shaders/swb_sam_red_dot.shader_c differ diff --git a/code/DemoCommands.cs b/code/DemoCommands.cs index 536d363..af3da01 100644 --- a/code/DemoCommands.cs +++ b/code/DemoCommands.cs @@ -9,16 +9,26 @@ internal class DemoCommands public static void Kill() { var player = PlayerBase.GetLocal(); - player?.TakeDamage( Shared.DamageInfo.FromBullet( player.GameObject.Id, null, 100, Vector3.Zero, System.Array.Empty() ) ); + player?.TakeDamage( Shared.DamageInfo.FromBullet( player.GameObject.Id, null, 99999, Vector3.Zero, System.Array.Empty() ) ); } - [ConCmd( "respawn", Help = "Respawns the player" )] + [ConCmd( "respawn", Help = "Respawns the player (host only)" )] public static void Respawn() { var player = PlayerBase.GetLocal(); + if ( !player.Network.OwnerConnection.IsHost ) return; player?.Respawn(); } + [ConCmd( "god", Help = "Toggles godmode (host only)" )] + public static void GodMode() + { + var player = PlayerBase.GetLocal(); + if ( !player.Network.OwnerConnection.IsHost ) return; + player.GodMode = !player.GodMode; + Log.Info( (player.GodMode ? "Enabled" : "Disabled") + " Godmode" ); + } + [ConCmd( "setactive", Help = "Changes the active inventory item" )] public static void ChangeWeapon( string className ) { diff --git a/code/DemoPlayer.cs b/code/DemoPlayer.cs index 9ca04f9..a76c951 100644 --- a/code/DemoPlayer.cs +++ b/code/DemoPlayer.cs @@ -1,6 +1,7 @@ using SWB.Base; using SWB.HUD; using SWB.Player; +using System.Linq; namespace SWB.Demo; @@ -10,13 +11,21 @@ public class DemoPlayer : PlayerBase { void GiveWeapon( string className, bool setActive = false ) { - var weaponRegistery = Scene.Components.GetInChildren(); - var weaponGO = weaponRegistery.Get( className ); + var weaponGO = WeaponRegistry.Instance.Get( className ); var weapon = weaponGO.Components.Get( true ); Inventory.AddClone( weaponGO, setActive ); SetAmmo( weapon.Primary.AmmoType, 360 ); } + Weapon GetWeapon( string className ) + { + var weaponGO = Inventory.Items.First( x => x.Name == className ); + if ( weaponGO is not null ) + return weaponGO.Components.Get(); + + return null; + } + public override void Respawn() { base.Respawn(); diff --git a/code/swb_base/Commands.cs b/code/swb_base/Commands.cs new file mode 100644 index 0000000..5e04b88 --- /dev/null +++ b/code/swb_base/Commands.cs @@ -0,0 +1,24 @@ +using SWB.Player; + +namespace SWB.Base; + +public class Commands +{ + [ConCmd( "swb_host_customization", Help = "Enable the weapon customization menu (Q)" )] + public static void SetWeaponCustomization( int enable ) + { + var player = PlayerBase.GetLocal(); + if ( !player.Network.OwnerConnection.IsHost ) return; + + WeaponSettings.Instance.Customization = enable != 0; + } + + [ConCmd( "swb_host_autoreload", Help = "Reload weapons automatically while shooting if clip is empty" )] + public static void SetWeaponAutoReload( int enable ) + { + var player = PlayerBase.GetLocal(); + if ( !player.Network.OwnerConnection.IsHost ) return; + + WeaponSettings.Instance.AutoReload = enable != 0; + } +} diff --git a/code/swb_base/ViewModelHandler.cs b/code/swb_base/ViewModelHandler.cs index ad042a2..0d2859e 100644 --- a/code/swb_base/ViewModelHandler.cs +++ b/code/swb_base/ViewModelHandler.cs @@ -47,6 +47,12 @@ public class ViewModelHandler : Component Vector3 localVel; bool isAiming; + protected override void OnDestroy() + { + // Game.Preferences.FieldOfView; -> new Preferences.FieldOfView + player.Camera.FieldOfView = Screen.CreateVerticalFieldOfView( 90 ); + } + protected override void OnUpdate() { var renderType = ShouldDraw ? ModelRenderer.ShadowRenderType.Off : ModelRenderer.ShadowRenderType.ShadowsOnly; @@ -130,6 +136,7 @@ protected override void OnUpdate() HandleSwayAnimation(); HandleIronAnimation(); HandleSprintAnimation(); + HandleCustomizeAnimation(); } void HandleIdleAnimation() @@ -255,24 +262,22 @@ void HandleIronAnimation() void HandleSprintAnimation() { - if ( Weapon.IsRunning && Weapon.RunAnimData != AngPos.Zero /* && !Weapon.IsCustomizing */ ) + if ( Weapon.IsRunning && Weapon.RunAnimData != AngPos.Zero && !Weapon.IsCustomizing ) { targetVectorPos += Weapon.RunAnimData.Pos; targetVectorRot += MathUtil.ToVector3( Weapon.RunAnimData.Angle ); } } - /* -void HandleCustomizeAnimation() -{ -if ( Weapon.IsCustomizing && Weapon.CustomizeAnimData != AngPos.Zero ) -{ -targetVectorPos += Weapon.CustomizeAnimData.Pos; -targetVectorRot += MathUtil.ToVector3( Weapon.CustomizeAnimData.Angle ); -} -} - */ + void HandleCustomizeAnimation() + { + if ( Weapon.IsCustomizing && Weapon.CustomizeAnimData != AngPos.Zero ) + { + targetVectorPos += Weapon.CustomizeAnimData.Pos; + targetVectorRot += MathUtil.ToVector3( Weapon.CustomizeAnimData.Angle ); + } + } void HandleJumpAnimation() { diff --git a/code/swb_base/Weapon.Attachments.cs b/code/swb_base/Weapon.Attachments.cs new file mode 100644 index 0000000..f120e0d --- /dev/null +++ b/code/swb_base/Weapon.Attachments.cs @@ -0,0 +1,17 @@ +using SWB.Base.Attachments; + +namespace SWB.Base; + +public partial class Weapon +{ + public Attachment GetActiveAttachmentForCategory( AttachmentCategory category ) + { + foreach ( var attachment in Attachments ) + { + if ( attachment.Category == category && attachment.Equipped ) + return attachment; + } + + return null; + } +} diff --git a/code/swb_base/Weapon.Getters.cs b/code/swb_base/Weapon.Getters.cs index 0893b93..e4f57a8 100644 --- a/code/swb_base/Weapon.Getters.cs +++ b/code/swb_base/Weapon.Getters.cs @@ -1,4 +1,6 @@ -namespace SWB.Base; +using SWB.Base.Attachments; + +namespace SWB.Base; public partial class Weapon { @@ -17,29 +19,30 @@ public virtual SkinnedModelRenderer GetEffectRenderer() /// public virtual Transform? GetMuzzleTransform() { - //var activeAttachment = GetActiveAttachmentFromCategory( AttachmentCategoryName.Muzzle ); + var activeAttachment = GetActiveAttachmentForCategory( AttachmentCategory.Muzzle ); var effectRenderer = GetEffectRenderer(); - var attachment = "muzzle"; - - //if ( activeAttachment != null ) - //{ - // var attachment = GetAttachment( activeAttachment.Name ); - // particleAttachment = attachment.EffectAttachment; - - // if ( attachment is OffsetAttachment ) - // { - // if ( CanSeeViewModel() ) - // { - // effectEntity = activeAttachment.ViewAttachmentModel; - // } - // else - // { - // effectEntity = activeAttachment.WorldAttachmentModel; - // } - // } - //} - - return effectRenderer?.GetAttachment( attachment ); + var effectAttachment = "muzzle"; + + if ( activeAttachment is not null ) + { + effectAttachment = activeAttachment.EffectAttachmentOrBone; + Transform? effectBoneTransform = null; + + // Custom models will not use attachments but bones instead to position effects + if ( CanSeeViewModel && activeAttachment.ViewModelRenderer is not null ) + { + effectBoneTransform = activeAttachment.ViewModelRenderer.SceneModel.GetBoneWorldTransform( effectAttachment ); + } + else if ( !CanSeeViewModel && activeAttachment.WorldModelRenderer is not null ) + { + effectBoneTransform = activeAttachment.WorldModelRenderer.SceneModel.GetBoneWorldTransform( effectAttachment ); + } + + if ( effectBoneTransform.HasValue ) + return effectBoneTransform.Value; + } + + return effectRenderer?.GetAttachment( effectAttachment ); } /// diff --git a/code/swb_base/Weapon.Reload.cs b/code/swb_base/Weapon.Reload.cs index ba2d78e..b348918 100644 --- a/code/swb_base/Weapon.Reload.cs +++ b/code/swb_base/Weapon.Reload.cs @@ -4,7 +4,7 @@ public partial class Weapon { public virtual void Reload() { - if ( IsReloading || /*IsAnimating ||*/ InBoltBack || IsShooting() ) + if ( IsReloading || InBoltBack || IsShooting() ) return; var maxClipSize = BulletCocking ? Primary.ClipSize + 1 : Primary.ClipSize; @@ -18,6 +18,9 @@ public virtual void Reload() if ( Owner.AmmoCount( Primary.AmmoType ) <= 0 && Primary.InfiniteAmmo != InfiniteAmmoType.reserve ) return; + if ( IsScoping ) + OnScopeEnd(); + IsReloading = true; // Anim diff --git a/code/swb_base/Weapon.Scoping.cs b/code/swb_base/Weapon.Scoping.cs index 54d9bfd..8f6dd60 100644 --- a/code/swb_base/Weapon.Scoping.cs +++ b/code/swb_base/Weapon.Scoping.cs @@ -5,7 +5,7 @@ public partial class Weapon public async void OnScopeStart() { await GameTask.DelaySeconds( ScopeInfo.ScopeInDelay ); - if ( !IsAiming || IsScoping ) return; + if ( !IsAiming || IsScoping || IsReloading ) return; IsScoping = true; ViewModelHandler.ShouldDraw = false; diff --git a/code/swb_base/Weapon.Shoot.cs b/code/swb_base/Weapon.Shoot.cs index 5ad75b3..33d1244 100644 --- a/code/swb_base/Weapon.Shoot.cs +++ b/code/swb_base/Weapon.Shoot.cs @@ -22,17 +22,23 @@ public virtual bool CanShoot( ShootInfo shootInfo, TimeSince lastAttackTime, str { if ( Input.Pressed( inputButton ) ) { + // Check for auto reloading + if ( Settings.AutoReload && lastAttackTime > GetRealRPM( shootInfo.RPM ) ) + { + TimeSincePrimaryShoot = 999; + TimeSinceSecondaryShoot = 999; + + if ( ShellReloading ) + OnShellReload(); + else + Reload(); + + return false; + } + + // Dry fire if ( shootInfo.DryShootSound is not null ) PlaySound( shootInfo.DryShootSound.ResourceId ); - - // Check for auto reloading - //if ( AutoReloadSV > 0 ) - //{ - // TimeSincePrimaryAttack = 999; - // TimeSinceSecondaryAttack = 999; - // timeSinceFired = 999; - // Reload(); - //} } return false; @@ -208,18 +214,25 @@ public virtual void CreateBulletImpact( SceneTraceResult tr ) // Particles if ( tr.Surface.ImpactEffects.Bullet is not null ) { - var effectPath = Game.Random.FromList( tr.Surface.ImpactEffects.Bullet ); + var effectPath = Game.Random.FromList( tr.Surface.ImpactEffects.Bullet, "particles/impact.generic.smokepuff.vpcf" ); - // Surface def for flesh has wrong blood particle linked - if ( effectPath.Contains( "impact.flesh" ) ) + if ( effectPath is not null ) { - effectPath = "particles/impact.flesh.bloodpuff.vpcf"; - } + // Surface def for flesh has wrong blood particle linked + if ( effectPath.Contains( "impact.flesh" ) ) + { + effectPath = "particles/impact.flesh.bloodpuff.vpcf"; + } + else if ( effectPath.Contains( "impact.wood" ) ) + { + effectPath = "particles/impact.generic.smokepuff.vpcf"; + } - var p = new SceneParticles( Scene.SceneWorld, effectPath ); - p.SetControlPoint( 0, tr.HitPosition ); - p.SetControlPoint( 0, Rotation.LookAt( tr.Normal ) ); - p.PlayUntilFinished( TaskSource.Create() ); + var p = new SceneParticles( Scene.SceneWorld, effectPath ); + p.SetControlPoint( 0, tr.HitPosition ); + p.SetControlPoint( 0, Rotation.LookAt( tr.Normal ) ); + p.PlayUntilFinished( TaskSource.Create() ); + } } // Decal diff --git a/code/swb_base/Weapon.UI.cs b/code/swb_base/Weapon.UI.cs index 6086ff1..c0c8960 100644 --- a/code/swb_base/Weapon.UI.cs +++ b/code/swb_base/Weapon.UI.cs @@ -7,6 +7,8 @@ public partial class Weapon public ScreenPanel ScreenPanel { get; set; } public PanelComponent RootPanel { get; set; } + private CustomizationMenu customizationMenu; + /// Override this if you want custom UI elements public virtual void CreateUI() { @@ -34,4 +36,15 @@ void BroadcastUIEvent( string name, object value ) panel.CreateEvent( name, value ); } } + + void OpenCustomizationMenu() + { + customizationMenu = new CustomizationMenu( this ); + RootPanel.Panel.AddChild( customizationMenu ); + } + + void CloseCustomizationMenu() + { + customizationMenu?.Delete( true ); + } } diff --git a/code/swb_base/Weapon.Var.cs b/code/swb_base/Weapon.Var.cs index 655244a..62b0e8b 100644 --- a/code/swb_base/Weapon.Var.cs +++ b/code/swb_base/Weapon.Var.cs @@ -46,7 +46,7 @@ public partial class Weapon [Property, Group( "FOV" )] public float AimFOV { get; set; } = -1f; /// Player FOV while aiming (-1 to use default player fov) - [Property, Group( "FOV" )] public int AimPlayerFOV { get; set; } = -1; + [Property, Group( "FOV" )] public float AimPlayerFOV { get; set; } = -1f; /// FOV aim in speed [Property, Group( "FOV" ), Title( "Aim in FOV speed" )] public float AimInFOVSpeed { get; set; } = 1f; @@ -64,6 +64,8 @@ public partial class Weapon /// Offset used for setting the weapon to its run position [Property, Group( "Animations" ), Title( "Run Offset (swb_editor_offsets)" )] public AngPos RunAnimData { get; set; } + /// Offset used for setting the weapon to its run position + [Property, Group( "Animations" ), Title( "Customizing Offset (swb_editor_offsets)" )] public AngPos CustomizeAnimData { get; set; } /// Duration of the reload animation [Property, Group( "Animations" )] public float ReloadTime { get; set; } = 1f; @@ -166,6 +168,9 @@ public partial class Weapon /// If the weapon is being bolt back reloaded [Sync] public bool InBoltBack { get; set; } + public StatsModifier InitialPrimaryStats { get; private set; } + public StatsModifier InitialSecondaryStats { get; private set; } + public bool IsDeploying => TimeSinceDeployed < 0; // Private diff --git a/code/swb_base/Weapon.cs b/code/swb_base/Weapon.cs index 9f2fddc..248aa26 100644 --- a/code/swb_base/Weapon.cs +++ b/code/swb_base/Weapon.cs @@ -1,4 +1,6 @@ -using SWB.Shared; +using SWB.Base.Attachments; +using SWB.Shared; +using System.Collections.Generic; using System.Linq; namespace SWB.Base; @@ -7,15 +9,22 @@ namespace SWB.Base; [Title( "Weapon" )] public partial class Weapon : Component, IInventoryItem { - public IPlayerBase Owner { get; set; } - public ViewModelHandler ViewModelHandler { get; set; } + public IPlayerBase Owner { get; private set; } + public ViewModelHandler ViewModelHandler { get; private set; } public SkinnedModelRenderer ViewModelRenderer { get; private set; } public SkinnedModelRenderer ViewModelHandsRenderer { get; private set; } public SkinnedModelRenderer WorldModelRenderer { get; private set; } + public WeaponSettings Settings { get; private set; } + public List Attachments = new(); protected override void OnAwake() { Tags.Add( TagsHelper.Weapon ); + Attachments = Components.GetAll( FindMode.EverythingInSelf ).OrderBy( att => att.Name ).ToList(); + + Settings = WeaponSettings.Instance; + InitialPrimaryStats = StatsModifier.FromShootInfo( Primary ); + InitialSecondaryStats = StatsModifier.FromShootInfo( Primary ); } protected override void OnDestroy() @@ -44,6 +53,7 @@ protected override void OnDisabled() IsReloading = false; IsScoping = false; IsAiming = false; + IsCustomizing = false; DestroyUI(); } @@ -97,8 +107,19 @@ public void OnDeploy() protected override void OnStart() { Owner = Components.GetInAncestors(); - CreateModels(); + + // Attachments (load for clients joining late) + if ( IsProxy ) + { + // Log.Info( "Checking -> " + Network.OwnerConnection.DisplayName + "'s " + DisplayName + " for attachments" ); + Attachments.ForEach( att => + { + // Log.Info( "[" + att.Name + "] equipped ->" + att.Equipped ); + if ( att is not null && att.Equipped ) + att.Equip(); + } ); + } } protected override void OnUpdate() @@ -110,6 +131,20 @@ protected override void OnUpdate() { if ( IsDeploying ) return; + // Customization + if ( !IsScoping && !IsAiming && Input.Pressed( InputButtonHelper.Menu ) && Attachments.Count > 0 ) + { + if ( !IsCustomizing ) + OpenCustomizationMenu(); + else + CloseCustomizationMenu(); + + IsCustomizing = !IsCustomizing; + } + + // Don't cancel reload when customizing + if ( IsCustomizing && !IsReloading ) return; + IsAiming = !Owner.IsRunning && AimAnimData != AngPos.Zero && Input.Down( InputButtonHelper.SecondaryAttack ); if ( IsScoping ) @@ -182,6 +217,7 @@ void CreateModels() ViewModelRenderer = viewModelGO.Components.Create(); ViewModelRenderer.Model = ViewModel; ViewModelRenderer.AnimationGraph = ViewModel.AnimGraph; + ViewModelRenderer.CreateBoneObjects = true; ViewModelRenderer.Enabled = false; ViewModelRenderer.OnComponentEnabled += () => { @@ -219,12 +255,8 @@ void CreateModels() WorldModelRenderer.CreateBoneObjects = true; var bodyRenderer = Owner.Body.Components.Get(); - var holdBone = bodyRenderer.Model.Bones.AllBones.FirstOrDefault( bone => bone.Name == "hold_R" ); - var holdBoneGO = bodyRenderer.GetBoneObject( holdBone ); - - this.GameObject.SetParent( holdBoneGO ); - WorldModelRenderer.Transform.Position = holdBoneGO.Transform.Position; - WorldModelRenderer.Transform.Rotation = holdBoneGO.Transform.Rotation; + ModelUtil.ParentToBone( GameObject, bodyRenderer, "hold_R" ); + Network.ClearInterpolation(); } } @@ -252,6 +284,8 @@ void ResetViewModelAnimations() void PlaySound( int resourceID ) { var sound = ResourceLibrary.Get( resourceID ); + if ( sound is null ) return; + var isScreenSound = CanSeeViewModel; sound.UI = isScreenSound; diff --git a/code/swb_base/WeaponRegistry.cs b/code/swb_base/WeaponRegistry.cs index b612c53..faaaea6 100644 --- a/code/swb_base/WeaponRegistry.cs +++ b/code/swb_base/WeaponRegistry.cs @@ -8,12 +8,20 @@ namespace SWB.Base; */ [Group( "SWB" )] -[Title( "WeaponRegistry" )] +[Title( "Weapon Registry" )] public class WeaponRegistry : Component { [Property] public List WeaponPrefabs { get; set; } = new(); public Dictionary Weapons { get; set; } = new(); + static public WeaponRegistry Instance + { + get + { + return Game.ActiveScene.Components.GetInChildren(); + } + } + protected override void OnAwake() { WeaponPrefabs.ForEach( weaponPrefab => diff --git a/code/swb_base/WeaponSettings.cs b/code/swb_base/WeaponSettings.cs new file mode 100644 index 0000000..7905424 --- /dev/null +++ b/code/swb_base/WeaponSettings.cs @@ -0,0 +1,30 @@ +namespace SWB.Base; + +/* + * Attach this component somewhere in the root of your scene. + * Gives control over weapon settings (host only) + */ + +[Group( "SWB" )] +[Title( "Weapon Settings" )] +public class WeaponSettings : Component +{ + /// Enable the weapon customization menu (Q) + [HostSync, Property] public bool Customization { get; set; } = true; + + /// Reload weapons automatically while shooting if clip is empty + [HostSync, Property] public bool AutoReload { get; set; } = true; + + protected override void OnAwake() + { + GameObject.NetworkMode = NetworkMode.Object; + } + + static public WeaponSettings Instance + { + get + { + return Game.ActiveScene.Components.GetInChildren(); + } + } +} diff --git a/code/swb_base/attachments/Attachment.cs b/code/swb_base/attachments/Attachment.cs new file mode 100644 index 0000000..7a3688c --- /dev/null +++ b/code/swb_base/attachments/Attachment.cs @@ -0,0 +1,254 @@ +using SWB.Shared; +using System; + +namespace SWB.Base.Attachments; + +public enum AttachmentCategory +{ + Barrel, + Sight, + Grip, + Rail, + Magazine, + Muzzle, + Stock, + Other, + Special, + Tactical, + Laser, + None, +} + +/* + * Attachment base that allows for weapon bone parenting as well as bodygroup changes simultaneously + */ + +[Group( "SWB Attachments" )] +public abstract class Attachment : Component, IComparable +{ + /// Display name (needs to be unique) + public virtual string Name => ""; + + /// Display description + public virtual string Description => ""; + + /// Only 1 active attachment per category, this is also used to determine what effect attachment to overide + public virtual AttachmentCategory Category => AttachmentCategory.None; + + /// List of positive attributes + public virtual string[] Positives => Array.Empty(); + + /// List of negative attributes + public virtual string[] Negatives => Array.Empty(); + + /// Weapon stats changer + public virtual StatsModifier StatsModifier { get; set; } + + /// Path to an image that represent the attachment on the HUD + public virtual string IconPath => ""; + + /// Path to the attachment model + public virtual string ModelPath => ""; + + /// Name of the model attachment used for new effect origins + public virtual string EffectAttachmentOrBone { get; set; } = ""; + + /// Hide this attachment in menus + public virtual bool Hide { get; set; } = false; + + /// Depends on another attachment (e.g. rail/mount) + [Property] public Attachment RequiresAttachment { get; set; } + + /// Name of the bone you want to attach the model to + [Property, Group( "Model Parenting" )] public virtual string Bone { get; set; } + + /// Viewmodel scale + [Property, Group( "Model Parenting" )] public virtual Vector3 ViewModelScale { get; set; } = Vector3.One; + + /// Worldmodel scale + [Property, Group( "Model Parenting" )] public virtual Vector3 WorldModelScale { get; set; } = Vector3.One; + + /// The name of the body group + [Property, Group( "BodyGroup" )] public virtual string BodyGroup { get; set; } + + /// The name of the body group choice + [Property, Group( "BodyGroup" )] public virtual int BodyGroupChoice { get; set; } = 0; + + /// The default target body group value + [Property, Group( "BodyGroup" )] public virtual int BodyGroupDefault { get; set; } = 0; + + /// If already equipped + [Sync] public bool Equipped { get; private set; } + + public Weapon Weapon { get; private set; } + public SkinnedModelRenderer ViewModelRenderer { get; private set; } + public SkinnedModelRenderer WorldModelRenderer { get; private set; } + + private int equipTries = 0; + private bool equippedOnClient = false; + + protected override void OnAwake() + { + Weapon = Components.Get(); + } + + private void SetBodyGroup( int choice ) + { + if ( string.IsNullOrEmpty( BodyGroup ) ) return; + + if ( !IsProxy ) + Weapon.ViewModelRenderer.SetBodyGroup( BodyGroup, choice ); + + Weapon.WorldModelRenderer.SetBodyGroup( BodyGroup, choice ); + } + + private void CreateModel( bool isViewModel = false ) + { + if ( string.IsNullOrEmpty( ModelPath ) || string.IsNullOrEmpty( Bone ) ) return; + + var attachmentGO = new GameObject( true, "Attachment" ); + attachmentGO.Tags.Add( TagsHelper.Attachment ); + + var attachmentRenderer = attachmentGO.Components.Create(); + attachmentRenderer.Model = Model.Load( ModelPath ); + attachmentRenderer.Enabled = true; + + if ( isViewModel ) + { + attachmentRenderer.Transform.Scale = ViewModelScale; + ViewModelRenderer = attachmentRenderer; + attachmentGO.Flags |= GameObjectFlags.NotNetworked; + ModelUtil.ParentToBone( attachmentGO, Weapon.ViewModelRenderer, Bone ); + } + else + { + attachmentRenderer.Transform.Scale = WorldModelScale; + WorldModelRenderer = attachmentRenderer; + ModelUtil.ParentToBone( attachmentGO, Weapon.WorldModelRenderer, Bone ); + } + } + + private void CreateModels() + { + if ( !IsProxy ) + CreateModel( true ); + + CreateModel(); + } + + /// Equips the attachment for everyone + [Broadcast] + public virtual void EquipBroadCast() + { + Equip(); + } + + /// Equips the attachment + public virtual void Equip() + { + // Log.Info( "Trying to equip -> " + Name + ", info -> equippedOnClient: " + equippedOnClient + " equipTries: " + equipTries ); + if ( equippedOnClient ) return; + if ( (!IsProxy && Weapon.ViewModelRenderer is null) || Weapon.WorldModelRenderer is null ) + { + if ( equipTries > 10 ) return; + equipTries += 1; + + async void retry() + { + await GameTask.Delay( 1 ); + Equip(); + } + retry(); + + return; + } + + // Make sure there is no other active attachment in same category + foreach ( var att in Weapon.Attachments ) + { + if ( att.Category == Category && att.Equipped ) + { + att.Unequip(); + break; + } + } + + equippedOnClient = true; + + if ( !IsProxy ) + Equipped = true; + + // Equip dependent attachment + RequiresAttachment?.Equip(); + + // BodyGroup + SetBodyGroup( BodyGroupChoice ); + + // Models + CreateModels(); + + // Stats + StatsModifier?.Apply( Weapon ); + + if ( !IsProxy ) + CreateHudElements(); + + OnEquip(); + } + + /// Unequips the attachment for everyone + [Broadcast] + public virtual void UnEquipBroadCast() + { + Unequip(); + } + + /// Unequips the attachment + public virtual void Unequip() + { + if ( !equippedOnClient ) return; + equippedOnClient = false; + + if ( !IsProxy ) + Equipped = false; + + // Unequip dependent attachment + RequiresAttachment?.Unequip(); + + // BodyGroup + SetBodyGroup( BodyGroupDefault ); + + // Model + ViewModelRenderer?.GameObject.Destroy(); + WorldModelRenderer?.GameObject.Destroy(); + + // Stats + StatsModifier?.Remove( Weapon ); + + if ( !IsProxy ) + DestroyHudElements(); + + OnUnequip(); + } + + /// Gets called after the attachment is equipped + public abstract void OnEquip(); + + /// Gets called after the attachment is unequipped + public abstract void OnUnequip(); + + /// Gets called when the weapon is creating its HUD elements + public virtual void CreateHudElements() { } + + /// Gets called when the weapon is destroying its HUD elements + public virtual void DestroyHudElements() { } + + public int CompareTo( Attachment obj ) + { + if ( obj == null ) + return 1; + + else + return Name.CompareTo( obj.Name ); + } +} diff --git a/code/swb_base/attachments/types/LaserAttachment.cs b/code/swb_base/attachments/types/LaserAttachment.cs new file mode 100644 index 0000000..2c24a9d --- /dev/null +++ b/code/swb_base/attachments/types/LaserAttachment.cs @@ -0,0 +1,119 @@ +using SWB.Shared; + +namespace SWB.Base.Attachments; + +public abstract class LaserAttachment : Attachment +{ + public override string Name => "Laser"; + public override AttachmentCategory Category => AttachmentCategory.Laser; + public override string Description => "Aids target acquisition by projecting a beam onto the target that provides a visual reference point."; + + // Not easily possible atm, attachments and bones lag behind. + // Waiting for: https://github.com/Facepunch/sbox-issues/issues/5200 + public override bool Hide => true; + + public override string[] Positives => new string[] + { + "Increases accuracy by 5%" + }; + + public override string[] Negatives => new string[] + { + "Visibible to enemies" + }; + + public override StatsModifier StatsModifier { get; set; } = new() + { + Spread = -0.05f, + }; + + /// New muzzle flash effect point + [Property, Group( "Laser" )] public override string EffectAttachmentOrBone { get; set; } = "laser_start"; + + /// Laser beam particle + [Property, Group( "Laser" )] public virtual ParticleSystem BeamParticle { get; set; } = ParticleSystem.Load( "particles/swb/laser/laser_small.vpcf" ); + + /// Laser dot particle + [Property, Group( "Laser" )] public virtual ParticleSystem DotParticle { get; set; } = ParticleSystem.Load( "particles/swb/laser/laser_dot.vpcf" ); + + [Property, Group( "Laser" )] public virtual Color Color { get; set; } = Color.Red; + + SceneParticles beamParticles; + SceneParticles dotParticles; + + public override void OnEquip() + { + CreateParticles(); + } + + public override void OnUnequip() + { + DestroyParticles(); + } + + private void CreateParticles() + { + DestroyParticles(); + + beamParticles = new( Weapon.Scene.SceneWorld, BeamParticle ); + beamParticles.Tags.Add( TagsHelper.ViewModel ); + //beamParticles. + //beamParticles?.SetControlPoint( 1, muzzleTransform.Value ); + //beamParticles?.SetControlPoint( 2, endPos ); + beamParticles?.SetNamedValue( "color", Color ); + // beamParticles?.SetControlPoint( 3, Color ); + beamParticles?.PlayUntilFinished( TaskSource.Create(), ( particles ) => + { + //var startAttachment = Weapon.ViewModelRenderer.SceneModel.GetAttachment( EffectAttachmentOrBone ); + //var startPos = startAttachment.Value.Position; + //var endPos = startAttachment.Value.Position + startAttachment.Value.Rotation.Forward * 9999; + + //var tr = Scene.Trace.Ray( startPos, endPos ) + //.UseHitboxes() + //.WithoutTags( "trigger" ) + //.Size( 1.0f ) + //.IgnoreGameObjectHierarchy( Weapon.Owner.GameObject ) + //.Run(); + + //var testStartPos = Weapon.GetMuzzleTransform(); + + ////particles?.SetControlPoint( 0, startPos ); + //particles?.SetControlPoint( 0, startPos ); + //particles?.SetControlPoint( 1, tr.EndPosition ); + } ); + + //laserParticle = Particles.Create( Particle ); + //laserParticle?.SetPosition( 3, Color ); + + //laserDotParticle = Particles.Create( DotParticle ); + //laserDotParticle?.SetPosition( 1, Color ); + } + + private void DestroyParticles() + { + beamParticles?.Delete(); + beamParticles = null; + + dotParticles?.Delete(); + dotParticles = null; + } + + protected override void OnUpdate() + { + if ( !Equipped ) return; + + var startAttachment = Weapon.ViewModelRenderer.SceneModel.GetAttachment( EffectAttachmentOrBone ); + var startPos = startAttachment.Value.Position; + var endPos = startAttachment.Value.Position + startAttachment.Value.Rotation.Forward * 9999; + + var tr = Scene.Trace.Ray( startPos, endPos ) + .UseHitboxes() + .WithoutTags( TagsHelper.Trigger ) + .Size( 1.0f ) + .IgnoreGameObjectHierarchy( Weapon.Owner.GameObject ) + .Run(); + + beamParticles?.SetControlPoint( 0, startPos ); + beamParticles?.SetControlPoint( 1, tr.EndPosition ); + } +} diff --git a/code/swb_base/attachments/types/RailAttachment.cs b/code/swb_base/attachments/types/RailAttachment.cs new file mode 100644 index 0000000..1129784 --- /dev/null +++ b/code/swb_base/attachments/types/RailAttachment.cs @@ -0,0 +1,17 @@ +namespace SWB.Base.Attachments; + +public abstract class RailAttachment : Attachment +{ + public override string Name => "Rail"; + public override AttachmentCategory Category => AttachmentCategory.Rail; + public override string Description => "Used by other attachments to be able to attach to the weapon."; + public override bool Hide { get; set; } = true; + + public override void OnEquip() + { + } + + public override void OnUnequip() + { + } +} diff --git a/code/swb_base/attachments/types/Scope2DAttachment.cs b/code/swb_base/attachments/types/Scope2DAttachment.cs new file mode 100644 index 0000000..2086538 --- /dev/null +++ b/code/swb_base/attachments/types/Scope2DAttachment.cs @@ -0,0 +1,57 @@ +using SWB.Base.UI; + +namespace SWB.Base.Attachments; + +public abstract class Scope2DAttachment : Attachment +{ + public override string Name => "2D Scope"; + public override AttachmentCategory Category => AttachmentCategory.Sight; + public override string Description => "A high magnification scope that is utilized for firing at long ranges."; + public override string[] Positives => new string[] + { + "x12 magnification", + "100% accurate while scoped in" + }; + + public override string[] Negatives => new string[] + { + }; + + /// The new aim position offset + [Property, Group( "Scope" )] public AngPos AimAnimData { get; set; } + AngPos oldAimAnimData; + + /// Scope Information + [Property, Group( "Scope" )] public virtual ScopeInfo ScopeInfo { get; set; } = new(); + ScopeInfo oldScopeInfo = new(); + + SniperScope sniperScope; + + public override void OnEquip() + { + oldAimAnimData = Weapon.AimAnimData; + oldScopeInfo = Weapon.ScopeInfo; + + Weapon.Scoping = true; + Weapon.AimAnimData = AimAnimData; + Weapon.ScopeInfo = ScopeInfo; + } + + public override void OnUnequip() + { + Weapon.Scoping = false; + Weapon.AimAnimData = oldAimAnimData; + Weapon.ScopeInfo = oldScopeInfo; + } + + public override void CreateHudElements() + { + sniperScope = new SniperScope( Weapon, Weapon.ScopeInfo.LensTexture, Weapon.ScopeInfo.ScopeTexture ); + Weapon.RootPanel.Panel.AddChild( sniperScope ); + } + + public override void DestroyHudElements() + { + sniperScope?.Delete(); + } +} diff --git a/code/swb_base/attachments/types/SightAttachment.cs b/code/swb_base/attachments/types/SightAttachment.cs new file mode 100644 index 0000000..8be3b77 --- /dev/null +++ b/code/swb_base/attachments/types/SightAttachment.cs @@ -0,0 +1,75 @@ +namespace SWB.Base.Attachments; + +public abstract class SightAttachment : Attachment +{ + public override string Name => "Sight"; + public override AttachmentCategory Category => AttachmentCategory.Sight; + public override string Description => "An optical sight that allows the user to look through a partially reflecting glass element and see an illuminated projection of an aiming point or some other image superimposed on the field of view."; + public override string[] Positives => new string[] + { + "Precision sight picture", + "Increases accuracy by 5%" + }; + + public override string[] Negatives => new string[] + { + }; + + public override StatsModifier StatsModifier { get; set; } = new() + { + Spread = -0.05f, + }; + + + /// The new aim position offset + [Property, Group( "Sight" )] public AngPos AimAnimData { get; set; } + AngPos oldAimAnimData; + + /// Weapon FOV while aiming (-1 to use default) + [Property, Group( "Sight" )] public virtual float AimFOV { get; set; } = -1f; + float oldAimFOV; + + /// Player FOV while aiming (-1 to use default) + [Property, Group( "Sight" )] public virtual float AimPlayerFOV { get; set; } = -1f; + float oldAimPlayerFOV; + + /// FOV aim in speed (-1 to use default) + [Property, Group( "Sight" ), Title( "Aim in FOV speed" )] public virtual float AimInFOVSpeed { get; set; } = -1f; + float oldAimInFOVSpeed; + + /// FOV aim out speed (-1 to use default) + [Property, Group( "Sight" ), Title( "Aim out FOV speed" )] public virtual float AimOutFOVSpeed { get; set; } = -1f; + private float oldAimOutFOVSpeed; + + /// Mouse sensitivity while aiming (-1 to use default) + [Property, Group( "Sight" )] public virtual float AimSensitivity { get; set; } = -1; + float oldAimSensitivity; + + public override void OnEquip() + { + oldAimAnimData = Weapon.AimAnimData; + oldAimFOV = Weapon.AimFOV; + oldAimPlayerFOV = Weapon.AimPlayerFOV; + oldAimInFOVSpeed = Weapon.AimInFOVSpeed; + oldAimOutFOVSpeed = Weapon.AimOutFOVSpeed; + oldAimSensitivity = Weapon.AimSensitivity; + + Weapon.AimAnimData = AimAnimData; + + if ( AimFOV > -1 ) Weapon.AimFOV = AimFOV; + if ( AimPlayerFOV > -1 ) Weapon.AimPlayerFOV = AimPlayerFOV; + if ( AimInFOVSpeed > -1 ) Weapon.AimInFOVSpeed = AimInFOVSpeed; + if ( AimOutFOVSpeed > -1 ) Weapon.AimOutFOVSpeed = AimOutFOVSpeed; + if ( AimSensitivity > -1 ) Weapon.AimSensitivity = AimSensitivity; + } + + public override void OnUnequip() + { + Weapon.AimAnimData = oldAimAnimData; + Weapon.AimFOV = oldAimFOV; + Weapon.AimPlayerFOV = oldAimPlayerFOV; + Weapon.AimInFOVSpeed = oldAimInFOVSpeed; + Weapon.AimOutFOVSpeed = oldAimOutFOVSpeed; + Weapon.AimSensitivity = oldAimSensitivity; + } +} diff --git a/code/swb_base/attachments/types/SilencerAttachment.cs b/code/swb_base/attachments/types/SilencerAttachment.cs new file mode 100644 index 0000000..4da6a0e --- /dev/null +++ b/code/swb_base/attachments/types/SilencerAttachment.cs @@ -0,0 +1,52 @@ +namespace SWB.Base.Attachments; + +public abstract class SilencerAttachment : Attachment +{ + public override string Name => "Silencer"; + public override AttachmentCategory Category => AttachmentCategory.Muzzle; + public override string Description => "Reduces the acoustic intensity of the muzzle report and the recoil when a gun is discharged by modulating the speed and pressure of the propellant gas from the muzzle."; + public override string[] Positives => new string[] + { + "Reduce sound", + "Reduce muzzle flash", + "Increases accuracy by 5%" + }; + + public override string[] Negatives => new string[] + { + }; + + public override StatsModifier StatsModifier { get; set; } = new() + { + Spread = -0.05f, + }; + + /// New muzzle flash effect point + [Property, Group( "Silencer" )] public override string EffectAttachmentOrBone { get; set; } = "muzzle_silenced"; + + /// New particle used for the muzzle flash + [Property, Group( "Silencer" )] public virtual ParticleSystem MuzzleFlashParticle { get; set; } + ParticleSystem oldMuzzleFlashParticle; + + /// New sound used for firing + [Property, Group( "Silencer" )] public virtual SoundEvent ShootSound { get; set; } + SoundEvent oldShootSound; + + public override void OnEquip() + { + oldMuzzleFlashParticle = Weapon.Primary.MuzzleFlashParticle; + oldShootSound = Weapon.Primary.ShootSound; + + if ( MuzzleFlashParticle is not null ) + Weapon.Primary.MuzzleFlashParticle = MuzzleFlashParticle; + + if ( ShootSound is not null ) + Weapon.Primary.ShootSound = ShootSound; + } + + public override void OnUnequip() + { + Weapon.Primary.MuzzleFlashParticle = oldMuzzleFlashParticle; + Weapon.Primary.ShootSound = oldShootSound; + } +} diff --git a/code/swb_base/structures/StatsModifier.cs b/code/swb_base/structures/StatsModifier.cs new file mode 100644 index 0000000..9917bbf --- /dev/null +++ b/code/swb_base/structures/StatsModifier.cs @@ -0,0 +1,76 @@ +namespace SWB.Base; + +public class StatsModifier +{ + public float Damage { get; set; } + public float Recoil { get; set; } + public float Spread { get; set; } + public float RPM { get; set; } + public float Force { get; set; } + + // After phys bullets have been recreated + //public float BulletVelocity { get; set; } = 0; + + public static readonly StatsModifier Zero = new(); + + private bool applied; + + public static StatsModifier FromShootInfo( ShootInfo shootInfo ) + { + return new() + { + Damage = shootInfo.Damage, + Recoil = shootInfo.Recoil, + Spread = shootInfo.Spread, + RPM = shootInfo.RPM, + Force = shootInfo.Force, + }; + } + + public void Apply( Weapon weapon, bool onPrimary = true ) + { + if ( applied ) return; + + if ( onPrimary ) + Apply( weapon.Primary, weapon.InitialPrimaryStats ); + else + Apply( weapon.Secondary, weapon.InitialSecondaryStats ); + + applied = true; + } + + private void Apply( ShootInfo shootInfo, StatsModifier initialStats ) + { + if ( shootInfo is null || initialStats is null ) return; + + shootInfo.Damage += initialStats.Damage * Damage; + shootInfo.Recoil += initialStats.Recoil * Recoil; + shootInfo.Spread += initialStats.Spread * Spread; + shootInfo.RPM += (int)(initialStats.RPM * RPM); + + //weapon.BulletVelocityMod += BulletVelocity; + } + + public void Remove( Weapon weapon, bool onPrimary = true ) + { + if ( !applied ) return; + + if ( onPrimary ) + Remove( weapon.Primary, weapon.InitialPrimaryStats ); + else + Remove( weapon.Secondary, weapon.InitialSecondaryStats ); + + //weapon.BulletVelocityMod -= BulletVelocity; + applied = false; + } + + private void Remove( ShootInfo shootInfo, StatsModifier initialStats ) + { + if ( shootInfo is null || initialStats is null ) return; + + shootInfo.Damage -= initialStats.Damage * Damage; + shootInfo.Recoil -= initialStats.Recoil * Recoil; + shootInfo.Spread -= initialStats.Spread * Spread; + shootInfo.RPM -= (int)(initialStats.RPM * RPM); + } +} diff --git a/code/swb_base/ui/Crosshair.cs b/code/swb_base/ui/Crosshair.cs index 6bd2692..7fb64f6 100644 --- a/code/swb_base/ui/Crosshair.cs +++ b/code/swb_base/ui/Crosshair.cs @@ -75,17 +75,20 @@ private void HideBarLines() public override void Tick() { bool isValidWeapon = weapon is not null; + var shouldHide = !isValidWeapon || weapon.IsScoping || weapon.IsCustomizing; - var hideCrosshairDot = !isValidWeapon || /*!weapon.UISettings.ShowCrosshairDot ||*/ weapon.IsScoping || weapon.IsCustomizing; - centerDot.SetClass( "hideCrosshair", hideCrosshairDot ); + SetClass( "hideCrosshair", shouldHide ); - var hideCrosshairLines = !isValidWeapon || /*!weapon.UISettings.ShowCrosshairLines ||*/ weapon.IsScoping || weapon.IsCustomizing; - leftBar.SetClass( "hideCrosshair", hideCrosshairLines ); - rightBar.SetClass( "hideCrosshair", hideCrosshairLines ); - topBar.SetClass( "hideCrosshair", hideCrosshairLines ); - bottomBar.SetClass( "hideCrosshair", hideCrosshairLines ); + //var hideCrosshairDot = shouldHide /*|| !weapon.UISettings.ShowCrosshairDot*/; + //centerDot.SetClass( "hideCrosshair", hideCrosshairDot ); - if ( !isValidWeapon ) return; + //var hideCrosshairLines = shouldHide /*|| !weapon.UISettings.ShowCrosshairLines*/; + //leftBar.SetClass( "hideCrosshair", hideCrosshairLines ); + //rightBar.SetClass( "hideCrosshair", hideCrosshairLines ); + //topBar.SetClass( "hideCrosshair", hideCrosshairLines ); + //bottomBar.SetClass( "hideCrosshair", hideCrosshairLines ); + + if ( shouldHide ) return; // Crosshair spread offset var screenOffset = spreadOffset * weapon.GetRealSpread(); @@ -95,7 +98,7 @@ public override void Tick() bottomBar.Style.MarginTop = screenOffset; // Sprint spread offsets - if ( weapon.IsRunning || weapon.ShouldTuck() || weapon.IsReloading || weapon.IsDeploying || weapon.InBoltBack ) + if ( weapon.IsRunning || weapon.ShouldTuck() || weapon.IsReloading || weapon.IsDeploying || (weapon.InBoltBack && !weapon.IsAiming) ) { leftBar.Style.Left = -sprintOffset; rightBar.Style.Left = sprintOffset - 5; diff --git a/code/swb_base/ui/Crosshair.cs.scss b/code/swb_base/ui/Crosshair.cs.scss index 59f4e37..2cb02ae 100644 --- a/code/swb_base/ui/Crosshair.cs.scss +++ b/code/swb_base/ui/Crosshair.cs.scss @@ -45,7 +45,7 @@ transition: all 0.1s ease-out 0s; } - .hideCrosshair { + &.hideCrosshair { display: none; } } diff --git a/code/swb_base/ui/CustomizationMenu.cs b/code/swb_base/ui/CustomizationMenu.cs new file mode 100644 index 0000000..e4d0f2b --- /dev/null +++ b/code/swb_base/ui/CustomizationMenu.cs @@ -0,0 +1,186 @@ +using Sandbox.UI; +using Sandbox.UI.Construct; +using SWB.Base.Attachments; +using SWB.Shared; +using System.Collections.Generic; + +namespace SWB.Base.UI; + +public class CustomizationMenu : Panel +{ + IPlayerBase player => weapon.Owner; + Weapon weapon; + + Panel categoryWrapper; + Panel attachmentWrapper; + Panel descriptionWrapper; + Panel activeCategoryP; + Panel activeAttachmentP; + + Attachment selectedAttachment; + Attachment hoveredAttachment; + + Dictionary> attachmentsPerCategory = new(); + + public CustomizationMenu( Weapon weapon ) + { + this.weapon = weapon; + FillAttachmentsPerCategory(); + StyleSheet.Load( "/swb_base/ui/CustomizationMenu.cs.scss" ); + + categoryWrapper = Add.Panel( "categoryWrapper" ); + categoryWrapper.Add.Label( weapon.DisplayName, "weaponName" ); + attachmentWrapper = Add.Panel( "attachmentWrapper" ); + descriptionWrapper = Add.Panel( "descriptionWrapper" ); + + CreateCategoryPanels(); + } + + void FillAttachmentsPerCategory() + { + weapon.Attachments.ForEach( attachment => + { + if ( attachment.Hide ) return; + if ( attachmentsPerCategory.TryGetValue( attachment.Category, out var attachments ) ) + attachments.Add( attachment ); + else + attachmentsPerCategory.Add( attachment.Category, new List() { attachment } ); + } ); + } + + void CreateCategoryPanels() + { + foreach ( var entry in attachmentsPerCategory ) + { + var categoryP = categoryWrapper.Add.Panel( "category" ); + categoryP.Add.Label( entry.Key.ToString(), "name" ); + categoryP.Add.Label( "", "attName" ); + + var catActiveAttachP = categoryP.Add.Panel( "activeAttachment" ); + catActiveAttachP.Add.Label( "", "name" ); + + var iconWrapperP = catActiveAttachP.Add.Panel( "iconWrapper" ); + iconWrapperP.Add.Image( "", "icon" ); + + var activeCatAttachment = weapon.GetActiveAttachmentForCategory( entry.Key ); + if ( activeCatAttachment is not null ) + SetAttachmentOnCategoryPanel( categoryP, activeCatAttachment ); + + + categoryP.AddEventListener( "onmousedown", () => + { + if ( activeCategoryP != categoryP ) + { + PlaySound( "swb_click" ); + activeCategoryP?.SetClass( "active", false ); + categoryP.SetClass( "active", true ); + activeCategoryP = categoryP; + CreateAttachmentPanels( entry.Key ); + } + } ); + + categoryP.AddEventListener( "onmouseover", () => + { + PlaySound( "ui.button.over" ); + } ); + } + } + + void SetAttachmentOnCategoryPanel( Panel categoryP, Attachment attachment ) + { + categoryP.SetClass( "hasAttachment", true ); + + var attachP = categoryP.GetChild( 2 ); + var nameL = (Label)attachP.GetChild( 0 ); + var iconWrapper = attachP.GetChild( 1 ); + var iconP = (Image)iconWrapper.GetChild( 0 ); + + nameL.Text = attachment.Name; + iconP.SetTexture( attachment.IconPath ); + } + + void CreateAttachmentPanels( AttachmentCategory category ) + { + attachmentWrapper.DeleteChildren(); + activeAttachmentP = null; + + if ( !attachmentsPerCategory.TryGetValue( category, out var attachments ) ) return; + + var activeAttachment = weapon.GetActiveAttachmentForCategory( category ); + + attachments.ForEach( attachment => + { + var attachmentP = attachmentWrapper.Add.Panel( "attachment" ); + attachmentP.Add.Label( attachment.Name, "name" ); + var iconWrapperP = attachmentP.Add.Panel( "iconWrapper" ); + iconWrapperP.Add.Image( attachment.IconPath, "icon" ); + + var isActiveAttachment = attachment == activeAttachment; + attachmentP.SetClass( "active", isActiveAttachment ); + + if ( isActiveAttachment ) + { + activeAttachmentP = attachmentP; + selectedAttachment = attachment; + CreateDescriptionPanel( attachment ); + } + + attachmentP.AddEventListener( "onmousedown", () => + { + activeAttachmentP?.SetClass( "active", false ); + + if ( activeAttachmentP != attachmentP ) + { + PlaySound( "swb_equip" ); + attachment.EquipBroadCast(); + attachmentP.SetClass( "active", true ); + activeAttachmentP = attachmentP; + selectedAttachment = attachment; + SetAttachmentOnCategoryPanel( activeCategoryP, attachment ); + } + else + { + PlaySound( "swb_unequip" ); + attachment.UnEquipBroadCast(); + activeCategoryP.SetClass( "hasAttachment", false ); + activeAttachmentP = null; + selectedAttachment = null; + } + } ); + + attachmentP.AddEventListener( "onmouseover", () => + { + hoveredAttachment = attachment; + PlaySound( "ui.button.over" ); + CreateDescriptionPanel( attachment ); + } ); + + attachmentP.AddEventListener( "onmouseout", () => + { + if ( hoveredAttachment != attachment ) return; + if ( selectedAttachment is not null ) + CreateDescriptionPanel( this.selectedAttachment ); + else + descriptionWrapper.DeleteChildren(); + } ); + } ); + } + + private void CreateDescriptionPanel( Attachment attach ) + { + descriptionWrapper.DeleteChildren(); + descriptionWrapper.Add.Label( attach.Description, "description" ); + + var posWrapper = descriptionWrapper.Add.Panel( "posWrapper" ); + foreach ( var pos in attach.Positives ) + { + posWrapper.Add.Label( "> " + pos, "label" ); + } + + var negWrapper = descriptionWrapper.Add.Panel( "negWrapper" ); + foreach ( var neg in attach.Negatives ) + { + negWrapper.Add.Label( "> " + neg, "label" ); + } + } +} diff --git a/code/swb_base/ui/CustomizationMenu.cs.scss b/code/swb_base/ui/CustomizationMenu.cs.scss new file mode 100644 index 0000000..9b2cdfc --- /dev/null +++ b/code/swb_base/ui/CustomizationMenu.cs.scss @@ -0,0 +1,303 @@ +$item-width: 280px; +$item-bg-full-dark: rgb(33, 33, 33); +$item-bg-extra-dark: rgba(33, 33, 33,0.95); +$item-bg-dark: rgba(33, 33, 33,0.8); + +$col-green: #2ecc71; +$col-green-trans: #2ecc7196; +$col-red: #e84118; + +CustomizationMenu { + position: absolute; + top: 40px; + left: 60px; + pointer-events: all; + align-items: flex-start; // Enables columns with diff heights + transition: opacity 0.2s ease-out 0s; + text-shadow: 0px 1px 1px rgba(0,0,0,0.3); + gap: 4px; + + &:intro { + opacity: 0.01; + } + + .categoryWrapper { + flex-direction: column; + + .weaponName { + min-width: $item-width; + align-items: center; + color: #eccc68; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + font-weight: 500; + font-size: 28px; + font-family: FONTSPRING DEMO - Integral CF; + padding: 0 12px 2px 12px; + border-radius: 2px; + min-height: 60px; + background-color: rgba( #2222, 0.75 ); + backdrop-filter: blur( 16px ); + margin-bottom: 4px; + } + + .category { + margin-bottom: 4px; + width: $item-width; + border-radius: 4px; + cursor: pointer; + align-items: center; + min-height: 44px; + transition: all 0.1s ease-out 0s; + background-color: rgba( #2222, 0.5 ); + backdrop-filter: blur( 16px ); + + &.active { + border-left: 3px solid $col-green; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + + .name { + color: $col-green; + } + } + + &:hover { + + .name { + color: $col-green; + } + + &.hasAttachment { + .name { + color: white; + } + + .activeAttachment { + .name { + color: $col-green; + transform: scale(1.04); + } + + .iconWrapper { + filter: drop-shadow(0px 0px 6px $col-green); + + .icon { + height: 60px; + width: 60px; + } + } + } + } + } + + &.hasAttachment { + min-height: 60px; + overflow: hidden; // too long attach name + + &.active { + .name { + color: white; + } + + .activeAttachment { + .name { + color: $col-green; + } + } + } + + .name { + font-size: 16px; + margin-bottom: auto; + margin-top: 4px; + color: rgb(200,200,200); + } + + .activeAttachment { + opacity: 1; + } + } + + .name { + color: white; + font-family: Poppins; + font-size: 22px; + margin-left: 10px; + border-radius: 2px; + transition: font-size 0.05s ease; + pointer-events: none; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + + .activeAttachment { + position: absolute; + width: $item-width; + height: 60px; + border-radius: 2px; + opacity: 0; + transition: all 0.1s ease-out 0s; + pointer-events: none; + + .name { + color: white; + font-family: Poppins; + font-size: 20px; + margin: 28px 0 0 10px; + transition: all 0.1s ease-out 0s; + } + + .iconWrapper { + height: 60px; + width: 60px; + border-radius: 2px; + margin: 0 6px 0 auto; + //margin-right: -1px; + filter: drop-shadow(0px 0px 6px #eccc68); + justify-content: center; + align-items: center; + transition: all 0.1s ease-out 0s; + + .icon { + height: 56px; + width: 56px; + background-repeat: no-repeat; + background-size: cover; + transition: all 0.1s ease-out 0s; + } + } + } + } + } + + .attachmentWrapper { + flex-direction: column; + + .attachment { + margin-bottom: 4px; + width: 260px; + border-radius: 4px; + cursor: pointer; + align-items: center; + min-height: 40px; + transition: all 0.1s ease-out 0s; + background-color: rgba( #2222, 0.5 ); + backdrop-filter: blur( 16px ); + + &:hover { + .name { + color: $col-green; + } + + .iconWrapper { + filter: drop-shadow(0px 0px 6px $col-green); + } + } + + &.active { + min-height: 46px; + border-left: 3px solid $col-green; + border-bottom-left-radius: 0; + border-top-left-radius: 0; + + .name { + color: $col-green; + font-weight: bold; + } + + .iconWrapper { + filter: drop-shadow(0px 0px 6px $col-green); + min-height: 46px; + width: 62px; + + .icon { + height: 46px; + width: 46px; + } + } + } + + .name { + color: white; + font-family: Poppins; + font-size: 18px; + padding-top: 2px; + margin-left: 10px; + border-radius: 2px; + transition: font-size 0.05s ease; + pointer-events: none; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + + .iconWrapper { + // height: 100% -> broken somehow + min-height: 40px; + width: 52px; + border-radius: 2px; + margin-left: auto; + justify-content: center; + align-items: center; + transition: all 0.1s ease-out 0s; + pointer-events: none; + filter: drop-shadow(0px 0px 1px white); + + .icon { + height: 42px; + width: 42px; + background-repeat: no-repeat; + background-size: cover; + transition: all 0.1s ease-out 0s; + } + } + } + } + + .descriptionWrapper { + position: relative; + width: 400px; + margin-left: 4px; + flex-direction: column; + border-radius: 2px; + padding: 10px; + font-family: Poppins; + background-color: rgba( #2222, 0.5 ); + backdrop-filter: blur( 16px ); + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + font-size: 16px; + + &:empty { + opacity: 0; + } + + .description { + color: white; + } + + .posWrapper { + margin-top: 10px; + padding-left: 4px; + flex-direction: column; + border-left: 2px solid $col-green; + + .label { + color: $col-green; + font-weight: 500; + } + } + + .negWrapper { + margin-top: 10px; + padding-left: 4px; + flex-direction: column; + border-left: 2px solid $col-red; + + &:empty { + margin-top: 0; + } + + .label { + color: $col-red; + font-weight: 500; + } + } + } +} diff --git a/code/swb_base/ui/SniperScope.cs b/code/swb_base/ui/SniperScope.cs index f967b4c..0d05764 100644 --- a/code/swb_base/ui/SniperScope.cs +++ b/code/swb_base/ui/SniperScope.cs @@ -19,6 +19,7 @@ public SniperScope( Weapon weapon, string lensTexture, string scopeTexture ) { this.weapon = weapon; StyleSheet.Load( "/swb_base/ui/SniperScope.cs.scss" ); + Style.Opacity = 0; if ( scopeTexture != null ) Add.Panel( "leftBar" ); @@ -75,7 +76,9 @@ public override void Tick() var rotateTransform = new PanelTransform(); lensRotation = MathUtil.FILerp( lensRotation, targetRotation, 20 ); rotateTransform.AddRotation( 0, 0, lensRotation ); - scope.Style.Transform = rotateTransform; + + // Movement blur + scope.Style.FilterBlur = Math.Abs( lensRotation * 2 + velocityJump + lensBob ); } } diff --git a/code/swb_base/util/ModelUtil.cs b/code/swb_base/util/ModelUtil.cs new file mode 100644 index 0000000..da32d67 --- /dev/null +++ b/code/swb_base/util/ModelUtil.cs @@ -0,0 +1,17 @@ +using System.Linq; + +namespace SWB.Base; + +public class ModelUtil +{ + public static void ParentToBone( GameObject gameObject, SkinnedModelRenderer target, string bone ) + { + var targetBone = target.Model.Bones.AllBones.FirstOrDefault( b => b.Name == bone ); + var holdBoneGO = target.GetBoneObject( targetBone ); + + gameObject.SetParent( holdBoneGO ); + gameObject.Transform.Position = holdBoneGO.Transform.Position; + gameObject.Transform.Rotation = holdBoneGO.Transform.Rotation; + } +} + diff --git a/code/swb_editor/OffsetEditor.cs b/code/swb_editor/OffsetEditor.cs index 22a9e77..aa4712a 100644 --- a/code/swb_editor/OffsetEditor.cs +++ b/code/swb_editor/OffsetEditor.cs @@ -12,8 +12,6 @@ public enum DragMode public partial class OffsetEditor { - public virtual bool InvertedX => false; - public float X { get; set; } = 0f; public float Y { get; set; } = 0f; public float Z { get; set; } = 0f; @@ -35,7 +33,6 @@ public partial class OffsetEditor float zOrigin; float pitchOrigin; float yawOrigin; - //AngPos sightAttachmentAnimData; Weapon weapon; @@ -49,12 +46,6 @@ protected override void OnAfterTreeRender( bool firstTime ) if ( !firstTime ) return; DragModeLabel.Text = "x/z"; - - // Get data from active sight attachment - //var showButton = false; - //var player = Game.LocalPawn as PlayerBase; - //var weapon = player.ActiveChild as WeaponBase; - //var activeAttach = weapon.GetActiveAttachmentFromCategory( AttachmentCategoryName.Sight ); FOV = weapon.FOV; } @@ -86,25 +77,20 @@ public virtual bool CanDragOnPanel( Panel p ) public void SetAimAnimData() { - SetFromAngPos( weapon.AimAnimData, weapon.AimFOV ); + SetFromAngPos( weapon.AimAnimData ); } public void SetRunAnimData() { - SetFromAngPos( weapon.RunAnimData, weapon.FOV ); + SetFromAngPos( weapon.RunAnimData ); } public void SetCustomizeAnimData() { - // SetFromAngPos( activeWeapon.CustomizeAnimData ); - } - - public void SetSightAttachmentAnimData() - { - // SetFromAngPos( sightAttachmentAnimData ); + SetFromAngPos( weapon.CustomizeAnimData ); } - private void SetFromAngPos( AngPos angPos, float FOV ) + private void SetFromAngPos( AngPos angPos ) { X = angPos.Pos.x; Y = angPos.Pos.y; @@ -112,7 +98,7 @@ private void SetFromAngPos( AngPos angPos, float FOV ) Pitch = angPos.Angle.pitch; Yaw = angPos.Angle.yaw; Roll = angPos.Angle.roll; - this.FOV = FOV; + this.FOV = weapon.FOV; } protected override void OnMouseMove( MousePanelEvent e ) diff --git a/code/swb_editor/OffsetEditor.razor b/code/swb_editor/OffsetEditor.razor index 451ff0e..7b68bfb 100644 --- a/code/swb_editor/OffsetEditor.razor +++ b/code/swb_editor/OffsetEditor.razor @@ -35,7 +35,7 @@
- @* *@ +
diff --git a/code/swb_editor/components/SliderEntry.cs b/code/swb_editor/components/SliderEntry.cs index 1d53f87..0a0fc04 100644 --- a/code/swb_editor/components/SliderEntry.cs +++ b/code/swb_editor/components/SliderEntry.cs @@ -62,17 +62,24 @@ public SliderEntry() protected void OnValueChanged( object value ) { float newValue = 0; + bool updateValue = true; if ( value is float floatValue ) { newValue = (float)Math.Round( floatValue, 2 ); } else if ( value is string stringValue ) { - newValue = float.Parse( stringValue ); + if ( stringValue.EndsWith( '.' ) || stringValue.EndsWith( ".0" ) || stringValue.EndsWith( ".00" ) ) + updateValue = false; + else + updateValue = float.TryParse( stringValue, out newValue ); } - Value = newValue; - CreateValueEvent( "value", value ); + if ( updateValue ) + { + Value = newValue; + CreateValueEvent( "value", value ); + } } /// diff --git a/code/swb_player/PlayerBase.Health.cs b/code/swb_player/PlayerBase.Health.cs index f1d2fcc..95d82ad 100644 --- a/code/swb_player/PlayerBase.Health.cs +++ b/code/swb_player/PlayerBase.Health.cs @@ -10,13 +10,14 @@ public partial class PlayerBase [Sync] public int Health { get; set; } = 100; [Sync] public int Kills { get; set; } [Sync] public int Deaths { get; set; } + [Sync] public bool GodMode { get; set; } public bool IsAlive => Health > 0; [Broadcast] public virtual void TakeDamage( Shared.DamageInfo info ) { - if ( IsProxy || !IsAlive ) + if ( IsProxy || !IsAlive || GodMode ) return; if ( Array.Exists( info.Tags, tag => tag == "head" ) ) @@ -25,8 +26,7 @@ public virtual void TakeDamage( Shared.DamageInfo info ) Health -= (int)info.Damage; // Flinch - var weaponRegistery = Scene.Components.GetInChildren(); - var weapon = weaponRegistery.GetWeapon( info.Inflictor ); + var weapon = WeaponRegistry.Instance.GetWeapon( info.Inflictor ); if ( weapon is not null ) DoHitFlinch( weapon.Primary.HitFlinch ); diff --git a/code/swb_player/PlayerBase.Movement.cs b/code/swb_player/PlayerBase.Movement.cs index cd6ac82..a67c835 100644 --- a/code/swb_player/PlayerBase.Movement.cs +++ b/code/swb_player/PlayerBase.Movement.cs @@ -25,6 +25,7 @@ public partial class PlayerBase public CharacterController CharacterController { get; set; } public CitizenAnimationHelper AnimationHelper { get; set; } + public CapsuleCollider BodyCollider { get; set; } TimeSince timeSinceLastFootstep = 0; @@ -32,6 +33,7 @@ void OnMovementAwake() { CharacterController = Components.Get(); AnimationHelper = Components.Get(); + BodyCollider = Body.Components.Get(); if ( BodyRenderer is not null ) BodyRenderer.OnFootstepEvent += OnAnimEventFootstep; @@ -149,6 +151,7 @@ void UpdateCrouch() { IsCrouching = true; CharacterController.Height /= 2f; + BodyCollider.End = BodyCollider.End.WithZ( BodyCollider.End.z / 2f ); } if ( IsCrouching && !Input.Down( InputButtonHelper.Duck ) ) @@ -161,6 +164,7 @@ void UpdateCrouch() { IsCrouching = false; CharacterController.Height = targetHeight; + BodyCollider.End = BodyCollider.End.WithZ( BodyCollider.End.z * 2f ); } } } @@ -194,7 +198,9 @@ void OnAnimEventFootstep( SceneModel.FootstepEvent footstepEvent ) if ( !tr.Hit ) return; var sound = tr.Surface.PlayCollisionSound( footstepEvent.Transform.Position ); - sound.Volume = footstepEvent.Volume; + if ( sound is not null ) + sound.Volume = footstepEvent.Volume; + timeSinceLastFootstep = 0; } } diff --git a/code/swb_player/PlayerBase.cs b/code/swb_player/PlayerBase.cs index 18d9b8a..1e18512 100644 --- a/code/swb_player/PlayerBase.cs +++ b/code/swb_player/PlayerBase.cs @@ -67,11 +67,11 @@ protected override void OnStart() } if ( !IsProxy ) - { Respawn(); - } } + + [Broadcast] public virtual void OnDeath( Shared.DamageInfo info ) { @@ -79,8 +79,10 @@ public virtual void OnDeath( Shared.DamageInfo info ) if ( attackerGO is not null && !attackerGO.IsProxy ) { - var attacker = attackerGO?.Components.Get(); - attacker.Kills += 1; + var attacker = attackerGO.Components.Get(); + + if ( attacker is not null ) + attacker.Kills += 1; } if ( IsProxy ) return; @@ -92,7 +94,7 @@ public virtual void OnDeath( Shared.DamageInfo info ) RespawnWithDelay( 2 ); } - async void RespawnWithDelay( float delay ) + public async void RespawnWithDelay( float delay ) { await GameTask.DelaySeconds( delay ); Respawn(); @@ -105,7 +107,14 @@ public virtual void Respawn() var spawnLocation = GetSpawnLocation(); Transform.Position = spawnLocation.Position; - Transform.Rotation = spawnLocation.Rotation; + EyeAngles = spawnLocation.Rotation.Angles(); + Network.ClearInterpolation(); + + if ( IsBot ) + { + Body.Transform.Rotation = new Angles( 0, EyeAngles.ToRotation().Yaw(), 0 ).ToRotation(); + AnimationHelper.WithLook( EyeAngles.ToRotation().Forward, 1f, 0.75f, 0.5f ); + } } public virtual Transform GetSpawnLocation() diff --git a/code/swb_player/prefabs/player.prefab b/code/swb_player/prefabs/player.prefab deleted file mode 100644 index 064b26a..0000000 --- a/code/swb_player/prefabs/player.prefab +++ /dev/null @@ -1,1100 +0,0 @@ -{ - "RootObject": { - "__guid": "d1e672e7-113b-492c-b449-50034808dd6a", - "Name": "player", - "Tags": "player", - "Enabled": true, - "NetworkMode": 2, - "Components": [ - { - "__type": "CitizenAnimationHelper", - "__guid": "4f2305cc-a8c5-4b10-8f1e-5a027b32b8bd", - "BodyWeight": 1, - "EyeSource": { - "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" - }, - "EyesWeight": 1, - "HeadWeight": 1, - "Height": 1, - "LookAtEnabled": false, - "Target": { - "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "SkinnedModelRenderer" - } - }, - { - "__type": "CharacterController", - "__guid": "57643f4d-c810-41bf-9a75-8d411dc00a98", - "Acceleration": 10, - "Bounciness": 0.3, - "GroundAngle": 45, - "Height": 64, - "IgnoreLayers": "", - "Radius": 16, - "StepHeight": 18 - }, - { - "__type": "DemoPlayer", - "__guid": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", - "AirControl": 0.1, - "Body": { - "_type": "gameobject", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1" - }, - "BodyRenderer": { - "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "SkinnedModelRenderer" - }, - "Camera": { - "_type": "component", - "component_id": "481831b0-9b7a-4c41-b439-2cc52b22b5da", - "go": "6f238074-1b09-48e2-95e6-e3c03fb7c80a", - "component_type": "CameraComponent" - }, - "CrouchSpeed": 90, - "GroundControl": 4, - "Head": { - "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" - }, - "JumpForce": 350, - "MaxForce": 50, - "MaxHealth": 100, - "RagdollPhysics": { - "_type": "component", - "component_id": "cdce8a36-d176-47ba-bf5c-c439374d5257", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "ModelPhysics" - }, - "RootDisplay": { - "_type": "component", - "component_id": "3fb8eb7f-93ed-4945-a2eb-e41024e9d0b6", - "go": "b9310aa3-6213-4c95-baaa-20900428ca7f", - "component_type": "RootDisplay" - }, - "RunSpeed": 290, - "ViewModelCamera": { - "_type": "component", - "component_id": "e5b27222-75d5-45c4-8cc8-3a48e22d524c", - "go": "5a8e3a84-19f1-4edc-a156-6691483d2ebc", - "component_type": "CameraComponent" - }, - "WalkSpeed": 160 - } - ], - "Children": [ - { - "__guid": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "Name": "Body", - "Enabled": true, - "NetworkMode": 2, - "Components": [ - { - "__type": "SkinnedModelRenderer", - "__guid": "251704a8-952d-472d-bcf2-baedc14debbc", - "BodyGroups": 341, - "CreateBoneObjects": true, - "MaterialGroup": "default", - "Model": "models/citizen/citizen.vmdl", - "RenderType": "On", - "Tint": "1,1,1,1" - }, - { - "__type": "ModelPhysics", - "__guid": "cdce8a36-d176-47ba-bf5c-c439374d5257", - "__enabled": false, - "Locking": {}, - "Model": "models/citizen/citizen.vmdl", - "Renderer": { - "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "SkinnedModelRenderer" - }, - "RigidbodyFlags": 0 - }, - { - "__type": "ModelHitboxes", - "__guid": "c98216ee-2df9-456d-9b0b-429a6fe222a1", - "Renderer": { - "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "SkinnedModelRenderer" - } - }, - { - "__type": "CapsuleCollider", - "__guid": "620231c7-0a09-4440-93d9-9455d5ed6c31", - "End": "1.5,0,64.4621", - "IsTrigger": false, - "Radius": 5, - "Start": "1.5,0,6.448373", - "Static": false, - "Surface": "surfaces/flesh.surface" - } - ], - "Children": [ - { - "__guid": "089038ec-626a-4f3f-8354-6c38522c8072", - "Name": "pelvis", - "Position": "1.266582,0.000014907,31.0736", - "Rotation": "-0.4999993,-0.4999994,-0.5000004,0.5000009", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "2f9e7b3f-e879-4495-97df-1b8688606ac5", - "Name": "spine_0", - "Position": "3.921827,-0.002448045,-0.0001164233", - "Rotation": "0.0002581775,-0.0000002980232,-0.00005638599,1", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "f2db805c-fcb6-4026-8e5a-01c48c70b3c6", - "Name": "spine_1", - "Position": "5.610418,0.00001253671,0.00004611733", - "Rotation": "-0.000396952,0.0000002086163,0.0002739429,0.9999998", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "aa4fc0b1-bb03-4e41-a716-94f56e5b49c1", - "Name": "spine_2", - "Position": "5.610455,0.000009457347,0.00003942099", - "Rotation": "0.0002120286,-0.0002525151,0.0000910759,1", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "111698da-0119-405f-a627-42d9e165fc3f", - "Name": "neck_0", - "Position": "5.820016,-0.09348675,-0.002965245", - "Rotation": "0.0000821203,-0.000251025,0.01994136,-0.9998012", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "aff1501a-7614-4666-b75d-56f549b11f78", - "Name": "head", - "Position": "4.510834,-0.0007621644,-0.00001950618", - "Rotation": "0.0000001192093,-0.00000007450581,0.01963396,0.9998072", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "2a690139-ed1d-4928-8958-af032d86d731", - "Name": "eye_L", - "Position": "6.90887,5.140466,3.234669", - "Rotation": "-0.707108,-0.7071056,-0.000003516674,0.000004142523", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "bd6a69e1-e1df-454f-98d6-3285a357cb35", - "Name": "eye_R", - "Position": "6.908859,5.140496,-3.234596", - "Rotation": "-0.707108,-0.7071056,-0.000003516674,0.000004142523", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "8133b304-4f82-4f40-876c-28f45dd12011", - "Name": "face_lid_lower_R", - "Position": "6.908821,5.140461,-3.234583", - "Rotation": "-0.3386923,0.9305478,-0.1307779,-0.04759897", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "8638ef64-4f45-4e79-9521-7e1bcddf4135", - "Name": "face_lid_lower_L", - "Position": "6.908897,5.140467,3.23468", - "Rotation": "0.3386921,-0.9305472,-0.1307825,-0.04760015", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "274c1ada-1f89-4ce0-acda-fa4abc3137b5", - "Name": "face_lid_upper_L", - "Position": "6.908885,5.140451,3.234676", - "Rotation": "-0.8974878,-0.4185047,-0.05881736,0.1261353", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "cb8eaee1-b22a-441b-8be8-b0f3e6ac6909", - "Name": "face_lid_upper_R", - "Position": "6.908875,5.140513,-3.234588", - "Rotation": "-0.8974884,-0.4185048,0.05881578,-0.1261319", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "e2c0193d-00e3-4128-a11a-f21e8719baf1", - "Name": "ear_R", - "Position": "5.621449,-0.4154353,-5.92917", - "Rotation": "0.04624295,-0.6935213,0.1379467,-0.7055925", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "0dbb67d3-c129-4864-97fa-d2323dec820e", - "Name": "ear_L", - "Position": "5.621478,-0.4155216,5.929071", - "Rotation": "-0.7055932,0.1379533,-0.6935186,0.04625109", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "0dd59ff9-a78c-46d0-8188-ea94167e26d8", - "Name": "clavicle_L", - "Position": "4.038116,0.2752069,1.103956", - "Rotation": "-0.08115548,0.6811197,0.08690505,-0.7224523", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "c0db3fe4-295b-40f1-9b34-91a7f423bab7", - "Name": "arm_upper_L", - "Position": "6.218335,0.00002176547,0.00004804133", - "Rotation": "-0.02770683,-0.3880896,0.06826707,0.9186722", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "0af29312-89c9-41bf-8393-fdd185a6c15c", - "Name": "arm_lower_L", - "Position": "10.04519,0.0000154972,-0.00004673001", - "Rotation": "0.00000004470348,0.0000004693866,0.1484236,0.9889238", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "940734c1-d421-439b-8c90-4af26e76371a", - "Name": "hand_L", - "Position": "7.706676,-0.0000008344645,-0.00007987017", - "Rotation": "0.09163112,-0.03309625,0.03967814,0.9944518", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "141a3485-80be-4b2b-86dc-50d42f7d220d", - "Name": "hold_L", - "Position": "5.361056,0.6217204,3.394403", - "Rotation": "-0.6958921,-0.170415,-0.392899,0.5764749", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "1dd6a0be-0a2d-4cb1-86a4-1ee8536ad444", - "Name": "finger_thumb_0_L", - "Position": "1.127924,1.648618,0.8667801", - "Rotation": "0.5684277,0.1216941,0.4117243,0.7018287", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "1dbf9445-5b71-45e2-a90d-f88e8df38fef", - "Name": "finger_thumb_1_L", - "Position": "1.906562,-0.00002780556,-0.00005733965", - "Rotation": "-0.0000006342307,-0.1627616,0.000004276633,0.9866654", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "383a3e48-103b-4953-ace7-434693ec4dc9", - "Name": "finger_thumb_2_L", - "Position": "2.136307,-0.00004172324,-0.0000980496", - "Rotation": "0.0000002533197,-0.08419369,-0.00000004842877,0.9964494", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "a05e0384-2e15-4ad1-ab8f-a3bb2e31ab43", - "Name": "finger_index_meta_L", - "Position": "2.075291,1.204094,0.3774741", - "Rotation": "0.06037846,0.04580591,0.1049121,0.9915894", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "2a0e51bf-da2e-4b92-b0a1-1791b003d40c", - "Name": "finger_index_0_L", - "Position": "3.068911,-0.0000297427,-0.0001138448", - "Rotation": "-0.00339286,-0.2652392,-0.06862513,0.9617316", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "8491dc45-befe-4a85-b885-06abe868efcf", - "Name": "finger_index_1_L", - "Position": "2.283286,-0.000005125997,-0.000147581", - "Rotation": "-0.000001147389,-0.2335206,0.000003024936,0.972352", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "8a2945e7-c654-41ef-a3bd-be9ae5d6138c", - "Name": "finger_index_2_L", - "Position": "1.594392,-0.0000593811,-0.0001720785", - "Rotation": "-0.000004693866,-0.01375909,0.000002592802,0.9999053", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "9a3ae601-7825-49a3-ac0d-7fffc3685ca5", - "Name": "finger_middle_meta_L", - "Position": "2.100665,-0.1590793,0.2858093", - "Rotation": "0.00896778,0.03486501,-0.01934981,0.9991645", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "628124c3-1c2d-4366-98b4-07c059017075", - "Name": "finger_middle_0_L", - "Position": "2.999226,-0.0000219047,-0.00009429451", - "Rotation": "0.0008723736,-0.2335085,0.001296833,0.9723535", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "e1560ca0-bd5b-481a-92b9-7e7398cffa73", - "Name": "finger_middle_1_L", - "Position": "2.560946,0.000001311302,-0.0001174211", - "Rotation": "-0.000004440546,-0.2322974,0.00004120171,0.9726449", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "df0cb453-2433-433f-a900-2241c78cf6c3", - "Name": "finger_middle_2_L", - "Position": "1.68301,-0.00002819299,-0.000164031", - "Rotation": "-0.00001375377,-0.04821886,-0.00003314018,0.9988368", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "a3da99ff-9968-49fc-8c14-f27a776b3d0e", - "Name": "finger_ring_meta_L", - "Position": "2.104887,-1.444506,0.2232285", - "Rotation": "-0.06376523,-0.02919634,-0.1306909,0.9889396", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "04650c4a-4132-4390-a9f1-fd55a84a4f0a", - "Name": "finger_ring_0_L", - "Position": "2.824281,-0.00002756714,-0.0001463889", - "Rotation": "0.004531637,-0.1855573,0.05619837,0.9810146", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "9c7b2969-1bf4-4e73-a8a2-f5c2083a35f9", - "Name": "finger_ring_1_L", - "Position": "2.197991,-0.000003010033,-0.0001496076", - "Rotation": "-0.00004592538,-0.2566091,-0.00006532669,0.9665152", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "89dc40df-9e37-4da5-bfda-09f82ac116a2", - "Name": "finger_ring_2_L", - "Position": "1.535339,-0.00002688168,-0.0001718699", - "Rotation": "-0.00001230836,-0.05038811,0.000008925796,0.9987297", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "6e6ab885-e65a-4a16-9c0b-cd6d779f4890", - "Name": "hand_R_to_L_ikrule", - "Position": "-28.15185,11.30969,27.26416", - "Rotation": "-0.2772723,-0.6901741,-0.00000002980232,0.6684159", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "1235a483-f9d3-49a3-a08a-2f3ce8bce793", - "Name": "arm_lower_L_twist0", - "Position": "0.000006837199,0.000007548724,-0.00006464363", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "12fc2aba-fe25-406a-972c-562096e7ef77", - "Name": "arm_lower_L_twist1", - "Position": "3.853339,-0.000001251697,-0.00007236", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "d06aebaf-413a-40f7-a075-25c4d2652cd7", - "Name": "arm_elbow_helper_L", - "Position": "-0.000005216786,0.000003112479,-0.00006175246", - "Rotation": "0.0000003278255,-0.00000005960464,-0.7577646,0.6525283", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "65dbef62-2232-41d9-86c0-979c1a3ebcdf", - "Name": "arm_upper_L_twist0", - "Position": "0.00001492683,0.00001386152,-0.00002693847", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "2836e3bf-2e96-4f09-a58f-15a519224934", - "Name": "arm_upper_L_twist1", - "Position": "5.022609,0.000015527,-0.0000271797", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "6aea5ae9-eea0-4f40-a87d-3252fd5f11cb", - "Name": "clavicle_R", - "Position": "4.036982,0.2748705,-1.108162", - "Rotation": "-0.08130813,0.6814711,-0.08696642,0.7220963", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "f73c6ae4-12df-4a77-8e7f-96cf2a4a7be3", - "Name": "arm_upper_R", - "Position": "6.218294,0.000005156732,-0.00006759165", - "Rotation": "0.0277065,0.3880895,0.06826836,0.918672", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "a3b72063-9f3c-4507-a75e-900ea3ae4950", - "Name": "arm_lower_R", - "Position": "10.04517,0.00000965595,-0.00005674361", - "Rotation": "-0.0000000372529,0.0000001937151,0.1484233,0.9889239", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "51efaa59-3985-4411-9c69-fde51ecd4ff9", - "Name": "hand_R", - "Position": "7.706653,0.00002896785,-0.00004005432", - "Rotation": "-0.09163144,0.03309621,0.03967842,0.9944515", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "6a782ea2-8931-4821-ab99-b9e037f2bfd1", - "Name": "hold_R", - "Position": "5.361083,0.6219016,-3.394506", - "Rotation": "-0.576474,0.3928988,0.1704146,0.695893", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "05c6907c-4fa7-46b2-b6b4-502c40ab3e5f", - "Name": "finger_thumb_0_R", - "Position": "1.127924,1.648677,-0.8668855", - "Rotation": "-0.5684255,-0.1216944,0.4117284,0.7018281", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "c9ff6607-93b2-42d0-828f-d36119576def", - "Name": "finger_thumb_1_R", - "Position": "1.906573,0.00001248717,-0.00005304812", - "Rotation": "0.00000147149,0.1627604,-0.000003732741,0.9866656", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "ae26826e-d7da-4d6c-a3df-14cfb7e9dfc6", - "Name": "finger_thumb_2_R", - "Position": "2.136316,0.00003880261,-0.00007760521", - "Rotation": "0.0000000782311,0.08420044,0.0000005532056,0.9964489", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "89aebe8f-c55d-4cad-8c9c-0067001ffb24", - "Name": "finger_index_meta_R", - "Position": "2.075282,1.204136,-0.3776003", - "Rotation": "-0.0603777,-0.04580308,0.1049159,0.9915892", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "182682ee-d212-4e7b-9cec-553b4ea783d0", - "Name": "finger_index_0_R", - "Position": "3.068901,0.00003266334,-0.00002348423", - "Rotation": "0.003392495,0.2652348,-0.06862299,0.9617328", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "1522347b-2fb2-493f-a8f4-91855b3d9629", - "Name": "finger_index_1_R", - "Position": "2.283288,0.00002986193,-0.00004714727", - "Rotation": "0.000002712011,0.2335185,-0.000001698732,0.9723523", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "b4537907-89f1-466f-8509-3f1f0235f970", - "Name": "finger_index_2_R", - "Position": "1.594425,0.00007919966,-0.0001038443", - "Rotation": "0.000004738569,0.01376472,0.0000004470348,0.9999053", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "78b134e4-da2f-4827-a18a-0a504646de33", - "Name": "finger_middle_meta_R", - "Position": "2.100654,-0.159044,-0.2859281", - "Rotation": "-0.008967884,-0.03486186,-0.01934614,0.9991646", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "5b47617f-19dd-48ac-a110-693e9ddfa08f", - "Name": "finger_middle_0_R", - "Position": "2.999228,0.00005188583,-0.0000231266", - "Rotation": "-0.0008731559,0.2335047,0.001300201,0.9723544", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "fcfdcb30-090a-4046-8b5d-afc2a85b4820", - "Name": "finger_middle_1_R", - "Position": "2.560971,0.00003793835,-0.00004655122", - "Rotation": "0.000005975366,0.2322946,0.00003750622,0.9726455", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "df921e45-5985-4b37-aa0c-569285d952b0", - "Name": "finger_middle_2_R", - "Position": "1.68301,0.000066936,-0.0001042252", - "Rotation": "0.00001381338,0.04822427,-0.00003582239,0.9988364", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "b373b9bb-a7fa-481a-96f8-0f8ab940db9c", - "Name": "finger_ring_meta_R", - "Position": "2.104869,-1.444472,-0.2233304", - "Rotation": "0.06376481,0.02919935,-0.1306878,0.9889399", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "69912e80-6c77-4d1e-9485-76b73c321ed3", - "Name": "finger_ring_0_R", - "Position": "2.824278,0.00006249545,-0.00001382827", - "Rotation": "-0.004531965,0.185554,0.0562013,0.9810151", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "08ae0a29-4833-4b68-b9ab-4e6f1debdfa2", - "Name": "finger_ring_1_R", - "Position": "2.198021,0.00003910064,-0.00004911422", - "Rotation": "0.00004531443,0.2566069,-0.00006809831,0.9665158", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "893764ef-18dc-4ffd-88bc-5fb2549da500", - "Name": "finger_ring_2_R", - "Position": "1.535354,0.00007754565,-0.000111118", - "Rotation": "0.00001199543,0.05039279,0.000008508563,0.9987295", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "92f085d9-b2af-4461-9867-110ba8e7693a", - "Name": "hand_L_to_R_ikrule", - "Position": "-28.15179,11.30986,-27.26431", - "Rotation": "0.2772729,0.6901738,0.000000372529,0.6684158", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "36d1cf0d-dbf0-4609-9a5d-f4115800a6ae", - "Name": "arm_lower_R_twist1", - "Position": "3.853322,0.00002682209,-0.00005733966", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "d5807b27-2498-4656-a16c-2ef44da6cde9", - "Name": "arm_lower_R_twist0", - "Position": "-0.0000160776,0.0000261824,-0.00004466753", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "d7046e41-a0e5-4941-a83f-3f987eea8ea3", - "Name": "arm_elbow_helper_R", - "Position": "-0.000006003497,0.00003117744,-0.00005398668", - "Rotation": "-0.0000007376075,0.0000002682209,0.7577677,-0.6525244", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "53edbce1-a4bd-4bd2-91bb-874210655623", - "Name": "arm_upper_R_twist0", - "Position": "-0.00001033032,0.00001789448,-0.00005867187", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "7d488be2-d5a8-4092-95ed-03589e23d752", - "Name": "arm_upper_R_twist1", - "Position": "5.022587,0.00001567602,-0.00004744529", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "912cd7ed-00a9-4771-9eca-d595ff5d64f5", - "Name": "neck_clothing", - "Position": "5.820016,-0.09348675,-0.002965245", - "Rotation": "0.0000821203,-0.000251025,0.01994136,-0.9998012", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - } - ] - }, - { - "__guid": "b7a83c37-19cb-4652-8fbf-199643f3bea3", - "Name": "leg_upper_R", - "Position": "-0.2881533,-0.4264439,-4.427378", - "Rotation": "-0.000001549721,1,0.0000001788139,-0.000000923872", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "53f3ee94-54ae-4fcb-86d9-68b12586cd3e", - "Name": "leg_lower_R", - "Position": "14.47037,-0.00001596073,0.00000106488", - "Rotation": "-0.000001326203,0.0000001043081,-0.01828091,0.9998329", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "58fd9b26-dad0-478e-afb9-b4dd016e70e9", - "Name": "ankle_R", - "Position": "12.51552,0.000006943942,0.000000707878", - "Rotation": "0.0000006258488,-0.000001043081,0.3914976,0.9201791", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "e787f0c7-fd66-4261-a152-f76cbe75f937", - "Name": "ball_R", - "Position": "4.429121,0.0000002384186,0.000004078142", - "Rotation": "-0.0000005032102,0.000001490116,0.3907284,0.920506", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "1a67996b-04ba-4eba-ac66-0e25e69e5bf1", - "Name": "leg_lower_R_twist1", - "Position": "6.257761,0.000006318093,-0.000003699168", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "f5e8285a-abcd-42bd-b07f-3a97f9aa6622", - "Name": "leg_lower_R_twist0", - "Position": "-0.000005885966,0.000004377334,-0.00001049043", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "886cf9ae-8f30-4690-8a4b-6b1f4e48b3ee", - "Name": "leg_knee_helper_R", - "Position": "0.000001733967,0.000004775387,-0.000009536718", - "Rotation": "0.0000009241048,-0.000001251698,0.7135268,0.7006278", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "c425b000-fc2c-4cdc-b01c-4509318f25c3", - "Name": "leg_upper_R_twist1", - "Position": "7.235195,0.00002492144,-0.00001329576", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "8eb13484-cac1-4109-a110-ba0c5fd92460", - "Name": "leg_upper_R_twist0", - "Position": "0.000007629447,0.000005960508,-0.0000171661", - "Rotation": "-0.00000005960464,0,0.000003039837,1", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "e445119f-5f9c-460b-9673-5c85ef37a06d", - "Name": "leg_glute_helper_R", - "Position": "0.00002098089,0.000005543324,-0.00001764288", - "Rotation": "-0.000001056968,-0.0000006258488,-0.7071052,0.7071084", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "3d329fb5-eb55-434d-8c67-41ea8b6a857a", - "Name": "leg_upper_L", - "Position": "-0.2881297,-0.4264377,4.427379", - "Rotation": "-0.000001549721,1,0.0000001788139,-0.000001162291", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "c475b48a-4c48-40c9-84de-5beb91eddc60", - "Name": "leg_lower_L", - "Position": "14.47037,-0.00004838563,-0.00002541375", - "Rotation": "-0.000003024936,-0.0000004023314,-0.01828231,0.9998329", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "2349916e-96ee-4fcf-9fc6-6aac42479f23", - "Name": "ankle_L", - "Position": "12.51552,0.000004500151,-0.000008570384", - "Rotation": "0.000003278255,-0.0000009536743,0.3914973,0.9201792", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "c027dbf9-2dce-4600-a17a-a19e8f2ad3c6", - "Name": "ball_L", - "Position": "4.429115,0.000001430511,-0.00001387228", - "Rotation": "-0.0000004862416,0.000001206994,0.3907294,0.9205056", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "3914df05-ba6c-413f-ae30-ea8e45b6c9eb", - "Name": "leg_lower_L_twist1", - "Position": "6.257759,0.000003129244,-0.00001000724", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "20e23cb4-6b0d-4bb0-951c-6cbcab2c7857", - "Name": "leg_lower_L_twist0", - "Position": "-0.000007737578,0.000002818492,-0.000009536751", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "17c5c785-a3cf-4f9e-9800-cde42fb7de68", - "Name": "leg_knee_helper_L", - "Position": "-0.00001533572,0.000001824768,-0.000009536788", - "Rotation": "-0.000003013527,-0.00000166893,0.7135276,0.700627", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "b7caaac0-4d0f-4120-9117-580ffe569bf8", - "Name": "leg_upper_L_twist1", - "Position": "7.235189,0.00002110672,-0.000007938437", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "5c0e4762-5b7c-4e35-b98a-bee6a20f6462", - "Name": "leg_upper_L_twist0", - "Position": "0.000007629402,0.000009954012,-0.000009059861", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "2dc430e2-a3b8-4947-9528-d709ebbbab68", - "Name": "leg_glute_helper_L", - "Position": "0.0000190735,0.000009596425,-0.000009536643", - "Rotation": "-0.000001011624,-0.0000006854534,-0.7071055,0.707108", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "8e7a4d36-1c4a-499c-b924-6539cad9d6b6", - "Name": "root_IK", - "Position": "1.266575,0.0000071965,0", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "cb416d5c-937a-4ff1-9ce0-0b74800d7898", - "Name": "hand_R_IK_target", - "Position": "0.6939846,-20.39473,39.24799", - "Rotation": "0.2871271,0.2142481,-0.5281312,0.7698917", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "d442a383-cdcf-4d7e-b4b6-3062724ff52e", - "Name": "hand_L_IK_target", - "Position": "0.6941153,20.3947,39.24792", - "Rotation": "0.7698929,0.5281296,-0.2142482,0.2871266", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "58abbd9f-9e41-4526-b810-87bddd50f325", - "Name": "aim_matrix_02a", - "Position": "4.638925,-0.0000008343597,9.8425", - "Enabled": true, - "NetworkMode": 2, - "Children": [ - { - "__guid": "78cfe9d7-de88-471c-8297-03fcdca30889", - "Name": "aim_matrix_02b", - "Position": "3.937001,-0.0000004822493,-0.00000143021", - "Enabled": true, - "NetworkMode": 2 - } - ] - }, - { - "__guid": "06b04373-b9e9-4917-a4f0-c2a9059dd99a", - "Name": "aim_matrix_01", - "Position": "4.638925,-0.0000008343597,11.811", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "d2d4d631-9237-457f-aadc-734406a25a1c", - "Name": "foot_R_IK_target", - "Position": "-0.8840668,-4.427395,3.807913", - "Rotation": "0.6508947,0.2762884,-0.2762876,0.6508964", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "a91cdfb3-6b5c-41f8-9bcd-a3853bc1a532", - "Name": "foot_L_IK_target", - "Position": "-0.884093,4.427404,3.807924", - "Rotation": "0.650896,0.276287,-0.2762895,0.6508948", - "Enabled": true, - "NetworkMode": 2 - } - ] - } - ] - }, - { - "__guid": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8", - "Name": "Head", - "Position": "0,0,60", - "Tags": "head", - "Enabled": true, - "NetworkMode": 2 - }, - { - "__guid": "5a8e3a84-19f1-4edc-a156-6691483d2ebc", - "Name": "ViewModelCamera", - "Position": "0,0,-9999", - "Enabled": true, - "NetworkMode": 2, - "Components": [ - { - "__type": "CameraComponent", - "__guid": "e5b27222-75d5-45c4-8cc8-3a48e22d524c", - "__enabled": false, - "BackgroundColor": "0.33333,0.46275,0.52157,1", - "ClearFlags": "Depth, Stencil", - "FieldOfView": 70, - "IsMainCamera": false, - "Orthographic": false, - "OrthographicHeight": 1204, - "Priority": 2, - "RenderExcludeTags": "", - "RenderTags": "viewmodel,light", - "TargetEye": "RightEye", - "Viewport": "0,0,1,1", - "ZFar": 10000, - "ZNear": 1 - } - ] - }, - { - "__guid": "6f238074-1b09-48e2-95e6-e3c03fb7c80a", - "Name": "Camera", - "Position": "-12.7616,-58.90898,64.64638", - "Rotation": "-0.002984795,0.02863883,0.1036175,0.9942003", - "Scale": "0.9979573,1,0.9842175", - "Tags": "maincamera", - "Enabled": true, - "NetworkMode": 2, - "Components": [ - { - "__type": "CameraComponent", - "__guid": "481831b0-9b7a-4c41-b439-2cc52b22b5da", - "BackgroundColor": "0.33333,0.46275,0.52157,1", - "ClearFlags": "All", - "FieldOfView": 70, - "IsMainCamera": true, - "Orthographic": false, - "OrthographicHeight": 1204, - "Priority": 1, - "RenderExcludeTags": "viewmodel", - "RenderTags": "", - "TargetEye": "None", - "Viewport": "0,0,1,1", - "ZFar": 100000, - "ZNear": 0.1 - }, - { - "__type": "CameraMovement", - "__guid": "ad4749ba-a6f9-4a88-9e85-d3eaeceedcaa", - "Body": { - "_type": "gameobject", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1" - }, - "BodyRenderer": { - "_type": "component", - "component_id": "251704a8-952d-472d-bcf2-baedc14debbc", - "go": "05e9dfad-ce3b-4251-ad8d-83e2b96f20e1", - "component_type": "SkinnedModelRenderer" - }, - "Distance": 0, - "Head": { - "_type": "gameobject", - "go": "b4ac8846-f7ac-4ac8-b955-0363f8176bc8" - }, - "Player": { - "_type": "component", - "component_id": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", - "go": "d1e672e7-113b-492c-b449-50034808dd6a", - "component_type": "DemoPlayer" - } - } - ] - }, - { - "__guid": "b9310aa3-6213-4c95-baaa-20900428ca7f", - "Name": "RootUI", - "Position": "43.30865,368.8296,-4.152458", - "Enabled": true, - "NetworkMode": 2, - "Components": [ - { - "__type": "ScreenPanel", - "__guid": "9dffe164-8f37-4041-8e73-819f9685aa0e", - "AutoScreenScale": true, - "Opacity": 1, - "Scale": 1, - "ZIndex": 100 - }, - { - "__type": "RootDisplay", - "__guid": "3fb8eb7f-93ed-4945-a2eb-e41024e9d0b6", - "Player": { - "_type": "component", - "component_id": "efb4267f-d8f7-47dd-940b-e0ed0caf1310", - "go": "d1e672e7-113b-492c-b449-50034808dd6a", - "component_type": "DemoPlayer" - } - } - ] - } - ] - }, - "ShowInMenu": false, - "MenuPath": null, - "MenuIcon": null, - "ResourceVersion": 1, - "__version": 1, - "__references": [] -} \ No newline at end of file diff --git a/code/swb_player/prefabs/player.prefab_c b/code/swb_player/prefabs/player.prefab_c deleted file mode 100644 index 826a41a..0000000 Binary files a/code/swb_player/prefabs/player.prefab_c and /dev/null differ diff --git a/code/swb_shared/TagsHelper.cs b/code/swb_shared/TagsHelper.cs index 73dd6a6..f82783f 100644 --- a/code/swb_shared/TagsHelper.cs +++ b/code/swb_shared/TagsHelper.cs @@ -11,4 +11,5 @@ public partial class TagsHelper public static string Water => "water"; public static string World => "world"; public static string Solid => "solid"; + public static string Attachment => "attachment"; }