abracadabra

This commit is contained in:
Valera 2025-06-12 22:51:36 +07:00
parent 9cacb9ee37
commit 1ed47cc6e9
11 changed files with 6746 additions and 0 deletions

238
.editorconfig Normal file
View File

@ -0,0 +1,238 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.{cs,razor}]
indent_style = tab
indent_size = 4
tab_size = 4
# New line preferences
end_of_line = crlf
insert_final_newline = true
#### C# Coding Conventions ####
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_switch_expression = true:suggestion
# Null-checking preferences
csharp_style_conditional_delegate_call = true:suggestion
# Code-block preferences
csharp_prefer_braces = true:silent
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = no_change
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = true
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = true
csharp_space_between_parentheses = control_flow_statements
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
[*.cs]
#### Стили именования ####
# Правила именования
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Спецификации символов
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Стили именования
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
csharp_indent_labels = no_change
csharp_space_around_binary_operators = before_and_after
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_implicitly_typed_lambda_expression = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_unbound_generic_type_in_nameof = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
[*.vb]
#### Стили именования ####
# Правила именования
dotnet_naming_rule.interface_should_be_начинается_с_i.severity = suggestion
dotnet_naming_rule.interface_should_be_начинается_с_i.symbols = interface
dotnet_naming_rule.interface_should_be_начинается_с_i.style = начинается_с_i
dotnet_naming_rule.типы_should_be_всечастиспрописнойбуквы.severity = suggestion
dotnet_naming_rule.типы_should_be_всечастиспрописнойбуквы.symbols = типы
dotnet_naming_rule.типы_should_be_всечастиспрописнойбуквы.style = всечастиспрописнойбуквы
dotnet_naming_rule.не_являющиеся_полем_члены_should_be_всечастиспрописнойбуквы.severity = suggestion
dotnet_naming_rule.не_являющиеся_полем_члены_should_be_всечастиспрописнойбуквы.symbols = не_являющиеся_полем_члены
dotnet_naming_rule.не_являющиеся_полем_члены_should_be_всечастиспрописнойбуквы.style = всечастиспрописнойбуквы
# Спецификации символов
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.типы.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.типы.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
dotnet_naming_symbols.типы.required_modifiers =
dotnet_naming_symbols.не_являющиеся_полем_члены.applicable_kinds = property, event, method
dotnet_naming_symbols.не_являющиеся_полем_члены.applicable_accessibilities = public, friend, private, protected, protected_friend, private_protected
dotnet_naming_symbols.не_являющиеся_полем_члены.required_modifiers =
# Стили именования
dotnet_naming_style.начинается_с_i.required_prefix = I
dotnet_naming_style.начинается_с_i.required_suffix =
dotnet_naming_style.начинается_с_i.word_separator =
dotnet_naming_style.начинается_с_i.capitalization = pascal_case
dotnet_naming_style.всечастиспрописнойбуквы.required_prefix =
dotnet_naming_style.всечастиспрописнойбуквы.required_suffix =
dotnet_naming_style.всечастиспрописнойбуквы.word_separator =
dotnet_naming_style.всечастиспрописнойбуквы.capitalization = pascal_case
dotnet_naming_style.всечастиспрописнойбуквы.required_prefix =
dotnet_naming_style.всечастиспрописнойбуквы.required_suffix =
dotnet_naming_style.всечастиспрописнойбуквы.word_separator =
dotnet_naming_style.всечастиспрописнойбуквы.capitalization = pascal_case
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_code_quality_unused_parameters = all:suggestion

28
.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
# This file describes files and paths that should not be tracked by Git version control
# https://git-scm.com/docs/gitignore
# Auto-generated code editor files
.vs/*
.vscode/*
*.csproj
obj
bin
Properties/*
code/obj/*
code/Properties/*
# Auto-generated asset related files
.sbox/*
*.generated.*
*.*_c
!*.shader_c
*.los
*.vpk
*launchSettings.json
*.sln
*idea
# Exported / standalone games
Exports/

File diff suppressed because it is too large Load Diff

656
Assets/scenes/minimal.scene Normal file
View File

@ -0,0 +1,656 @@
{
"__guid": "325a4042-0696-43dd-a79d-dcc314299ba3",
"GameObjects": [
{
"__guid": "d9cc4dc4-c86d-405f-a0ca-a46c12b9ef33",
"__version": 1,
"Flags": 0,
"Name": "Scene Information",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.SceneInformation",
"__guid": "84c4fc99-8779-4536-bc15-239c47b27164",
"__enabled": true,
"Author": null,
"Changes": null,
"Description": "",
"Group": null,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"SceneTags": "",
"Title": "minimal",
"Version": null
}
],
"Children": []
},
{
"__guid": "bfc59c12-1ed2-4f91-8956-a95a315eac3c",
"__version": 1,
"Flags": 0,
"Name": "Sun",
"Position": "0,0,0",
"Rotation": "-0.0729315,0.4822396,0.1305433,0.8631827",
"Scale": "1,1,1",
"Tags": "light_directional,light",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.DirectionalLight",
"__guid": "d3659344-a90d-48fa-927a-095f70fe041f",
"__enabled": true,
"FogMode": "Enabled",
"FogStrength": 1,
"LightColor": "0.94419,0.97767,1,1",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Shadows": true,
"SkyColor": "0.2532,0.32006,0.35349,1"
}
],
"Children": []
},
{
"__guid": "00344a8c-fa5e-45ae-b12a-10bb781a1dc3",
"__version": 1,
"Flags": 0,
"Name": "2D Skybox",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "skybox",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.SkyBox2D",
"__guid": "de79e9e0-5c37-4c54-ac67-bfcdb1d5483b",
"__enabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"SkyIndirectLighting": true,
"SkyMaterial": "materials/skybox/skybox_day_01.vmat",
"Tint": "1,1,1,1"
}
],
"Children": []
},
{
"__guid": "6ad70641-3c6c-4402-9c85-9a4969af4764",
"__version": 1,
"Flags": 0,
"Name": "Plane",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1000,1000,50",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.ModelRenderer",
"__guid": "0b6a18bf-fdb8-4661-970e-ef635bfa9baa",
"__enabled": true,
"BodyGroups": 18446744073709551615,
"CreateAttachments": false,
"MaterialGroup": null,
"MaterialOverride": "materials/emo.vmat",
"Model": "models/dev/plane.vmdl",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"RenderOptions": {
"GameLayer": true,
"OverlayLayer": false,
"BloomLayer": false,
"AfterUILayer": false
},
"RenderType": "On",
"Tint": "0.39546,0.51163,0.27128,1"
},
{
"__type": "Sandbox.BoxCollider",
"__guid": "0715cb55-1733-4f5e-8560-c288b8695631",
"__enabled": true,
"Center": "0,0,-5",
"Friction": null,
"IsTrigger": false,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OnObjectTriggerEnter": null,
"OnObjectTriggerExit": null,
"OnTriggerEnter": null,
"OnTriggerExit": null,
"Scale": "100,100,10",
"Static": false,
"Surface": null,
"SurfaceVelocity": "0,0,0"
}
],
"Children": []
},
{
"__guid": "3c2490ef-54a0-49bb-8f13-490e40aa51d1",
"__version": 1,
"Flags": 0,
"Name": "Cube",
"Position": "21.41682,74.1244,14.40159",
"Rotation": "0.00000001819328,-0.00000000000000008235059,0.3052325,0.952278",
"Scale": "0.5632889,0.5632889,0.5632889",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.ModelRenderer",
"__guid": "b9121ffa-617c-4ccc-a2aa-8acc98727590",
"__enabled": true,
"BodyGroups": 18446744073709551615,
"CreateAttachments": false,
"MaterialGroup": null,
"MaterialOverride": "materials/default.vmat",
"Model": "models/dev/box.vmdl",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"RenderOptions": {
"GameLayer": true,
"OverlayLayer": false,
"BloomLayer": false,
"AfterUILayer": false
},
"RenderType": "On",
"Tint": "1,0,0.93333,1"
},
{
"__type": "Sandbox.BoxCollider",
"__guid": "8bb3ebcf-1ec9-4b20-bf31-4aece0950008",
"__enabled": true,
"Center": "0,0,0",
"Friction": null,
"IsTrigger": false,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OnObjectTriggerEnter": null,
"OnObjectTriggerExit": null,
"OnTriggerEnter": null,
"OnTriggerExit": null,
"Scale": "50,50,50",
"Static": false,
"Surface": null,
"SurfaceVelocity": "0,0,0"
},
{
"__type": "Sandbox.Rigidbody",
"__guid": "4aaa0334-6785-4716-9bae-869559ea6e10",
"__enabled": true,
"AngularDamping": 0,
"Gravity": true,
"LinearDamping": 0,
"Locking": {
"X": false,
"Y": false,
"Z": false,
"Pitch": false,
"Yaw": false,
"Roll": false
},
"MassCenterOverride": "0,0,0",
"MassOverride": 0,
"MotionEnabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OverrideMassCenter": false,
"RigidbodyFlags": 0,
"StartAsleep": false
}
],
"Children": []
},
{
"__guid": "523e3e8f-a4ec-4ec1-af9a-d86ffc9c17e1",
"__version": 1,
"Flags": 0,
"Name": "Cube (1)",
"Position": "40.81348,46.97572,14.40159",
"Rotation": "0.00000001819328,-0.00000000000000008235059,0.3052325,0.952278",
"Scale": "0.5632889,0.5632889,0.5632889",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.ModelRenderer",
"__guid": "9e8a546d-a41d-44b5-9906-22cea00e1066",
"__enabled": true,
"BodyGroups": 18446744073709551615,
"CreateAttachments": false,
"MaterialGroup": null,
"MaterialOverride": "materials/default.vmat",
"Model": "models/dev/box.vmdl",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"RenderOptions": {
"GameLayer": true,
"OverlayLayer": false,
"BloomLayer": false,
"AfterUILayer": false
},
"RenderType": "On",
"Tint": "1,0,0.93333,1"
},
{
"__type": "Sandbox.BoxCollider",
"__guid": "adf22580-7a25-4d7f-b1c3-3fb8fabf1612",
"__enabled": true,
"Center": "0,0,0",
"Friction": null,
"IsTrigger": false,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OnObjectTriggerEnter": null,
"OnObjectTriggerExit": null,
"OnTriggerEnter": null,
"OnTriggerExit": null,
"Scale": "50,50,50",
"Static": false,
"Surface": null,
"SurfaceVelocity": "0,0,0"
},
{
"__type": "Sandbox.Rigidbody",
"__guid": "e53bfcb0-7f44-41d0-8d51-263bdc173a57",
"__enabled": true,
"AngularDamping": 0,
"Gravity": true,
"LinearDamping": 0,
"Locking": {
"X": false,
"Y": false,
"Z": false,
"Pitch": false,
"Yaw": false,
"Roll": false
},
"MassCenterOverride": "0,0,0",
"MassOverride": 0,
"MotionEnabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OverrideMassCenter": false,
"RigidbodyFlags": 0,
"StartAsleep": false
}
],
"Children": []
},
{
"__guid": "5b483a09-bbf2-4949-98c7-a73b789d0ee7",
"__version": 1,
"Flags": 0,
"Name": "Cube (2)",
"Position": "49.53707,34.08896,43.67614",
"Rotation": "0.00000001819328,-0.00000000000000008235059,0.3052325,0.952278",
"Scale": "0.5632889,0.5632889,0.5632889",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.ModelRenderer",
"__guid": "ac284ab8-cdb7-4ba6-92de-d9be36088b1b",
"__enabled": true,
"BodyGroups": 18446744073709551615,
"CreateAttachments": false,
"MaterialGroup": null,
"MaterialOverride": "materials/default.vmat",
"Model": "models/dev/box.vmdl",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"RenderOptions": {
"GameLayer": true,
"OverlayLayer": false,
"BloomLayer": false,
"AfterUILayer": false
},
"RenderType": "On",
"Tint": "1,0,0.93333,1"
},
{
"__type": "Sandbox.BoxCollider",
"__guid": "ca4eb284-231e-4c84-9bc4-7ba89962f307",
"__enabled": true,
"Center": "0,0,0",
"Friction": null,
"IsTrigger": false,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OnObjectTriggerEnter": null,
"OnObjectTriggerExit": null,
"OnTriggerEnter": null,
"OnTriggerExit": null,
"Scale": "50,50,50",
"Static": false,
"Surface": null,
"SurfaceVelocity": "0,0,0"
},
{
"__type": "Sandbox.Rigidbody",
"__guid": "61ef15dd-3eb2-4f52-8b9a-315f477f79b7",
"__enabled": true,
"AngularDamping": 0,
"Gravity": true,
"LinearDamping": 0,
"Locking": {
"X": false,
"Y": false,
"Z": false,
"Pitch": false,
"Yaw": false,
"Roll": false
},
"MassCenterOverride": "0,0,0",
"MassOverride": 0,
"MotionEnabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OverrideMassCenter": false,
"RigidbodyFlags": 0,
"StartAsleep": false
}
],
"Children": []
},
{
"__guid": "3ee1c9f4-07be-4e0b-8b23-67bee2d8ec8a",
"__version": 1,
"Flags": 0,
"Name": "Camera",
"Position": "-267.452,-379.653,297.7903",
"Rotation": "-0.1448582,0.2860239,0.4279631,0.8450171",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.CameraComponent",
"__guid": "cf3cbf96-22b6-4be4-a5d0-672a96c17f9f",
"__enabled": true,
"BackgroundColor": "0.33333,0.46275,0.52157,1",
"ClearFlags": "All",
"FieldOfView": 60,
"FovAxis": "Horizontal",
"IsMainCamera": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Orthographic": false,
"OrthographicHeight": 1204,
"Priority": 1,
"RenderExcludeTags": "",
"RenderTags": "",
"TargetEye": "None",
"Viewport": "0,0,1,1",
"ZFar": 10000,
"ZNear": 10
},
{
"__type": "Sandbox.Bloom",
"__guid": "d73ef723-c888-41d4-802e-f797c79318be",
"__enabled": true,
"__version": 1,
"Gamma": 2.2,
"Mode": "Additive",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Strength": 0.5,
"Threshold": 1.25,
"Tint": "1,1,1,1"
},
{
"__type": "Sandbox.Tonemapping",
"__guid": "9d76f362-7227-40eb-a189-69353c780c46",
"__enabled": true,
"__version": 3,
"AutoExposureEnabled": true,
"ExposureCompensation": 0,
"ExposureMethod": "RGB",
"MaximumExposure": 2,
"MinimumExposure": 1,
"Mode": "HableFilmic",
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Rate": 1
},
{
"__type": "Sandbox.Sharpen",
"__guid": "0bffee5e-19f2-41c4-88f9-faefbcce6bf4",
"__enabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Scale": 0.2
}
],
"Children": []
},
{
"__guid": "19dbc46f-dd63-44ff-91d5-929b861e5d97",
"__version": 1,
"Flags": 0,
"Name": "Body",
"Position": "10.61845,-17.1088,-0.000009924173",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.SkinnedModelRenderer",
"__guid": "23187da2-a078-460e-b36a-b7cd2bc71ca4",
"__enabled": true,
"AnimationGraph": null,
"BodyGroups": 341,
"BoneMergeTarget": null,
"CreateAttachments": false,
"CreateBoneObjects": false,
"MaterialGroup": null,
"MaterialOverride": null,
"Model": "models/citizen/citizen.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Parameters": {
"bools": {},
"ints": {},
"floats": {},
"vectors": {},
"rotations": {}
},
"PlaybackRate": 1,
"RenderOptions": {
"GameLayer": true,
"OverlayLayer": false,
"BloomLayer": false,
"AfterUILayer": false
},
"RenderType": "On",
"Sequence": {
"Name": null,
"Looping": true,
"Blending": false
},
"Tint": "1,1,1,1",
"UseAnimGraph": true
}
],
"Children": []
},
{
"__guid": "7b870763-8d4d-4103-b599-f70cc7e67847",
"__version": 1,
"Flags": 0,
"Name": "network",
"Position": "0,-173.4841,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "Sandbox.VeloXNetworkManager",
"__guid": "f61d7e81-65de-4417-9869-e7111ab17ea5",
"__enabled": true,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"PlayerPrefab": {
"_type": "gameobject",
"prefab": "prefabs/cars/debug_car.prefab"
}
}
],
"Children": []
}
],
"SceneProperties": {
"NetworkInterpolation": true,
"TimeScale": 1,
"WantsSystemScene": true,
"Metadata": {
"Title": "minimal"
},
"NavMesh": {
"Enabled": false,
"IncludeStaticBodies": true,
"IncludeKeyframedBodies": true,
"EditorAutoUpdate": true,
"AgentHeight": 64,
"AgentRadius": 16,
"AgentStepSize": 18,
"AgentMaxSlope": 40,
"ExcludedBodies": "",
"IncludedBodies": ""
}
},
"ResourceVersion": 3,
"Title": "minimal",
"Description": null,
"__references": [],
"__version": 3
}

4
Editor/Assembly.cs Normal file
View File

@ -0,0 +1,4 @@
global using Sandbox;
global using Editor;
global using System.Collections.Generic;
global using System.Linq;

View File

@ -0,0 +1,36 @@
{
"Version": 2,
"Defaults": {
"solid": "Collide",
"world": "Collide",
"trigger": "Trigger",
"ladder": "Ignore",
"water": "Trigger"
},
"Pairs": [
{
"a": "solid",
"b": "solid",
"r": "Collide"
},
{
"a": "trigger",
"b": "playerclip",
"r": "Ignore"
},
{
"a": "trigger",
"b": "solid",
"r": "Trigger"
},
{
"a": "playerclip",
"b": "solid",
"r": "Collide"
}
],
"__guid": "514752eb-3865-44d9-9224-8cb6b4113543",
"__schema": "configdata",
"__type": "CollisionRules",
"__version": 2
}

View File

@ -0,0 +1,225 @@
{
"Actions": [
{
"Name": "Forward",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "W",
"GamepadCode": "None"
},
{
"Name": "Backward",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "S",
"GamepadCode": "None"
},
{
"Name": "Left",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "A",
"GamepadCode": "None"
},
{
"Name": "Right",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "D",
"GamepadCode": "None"
},
{
"Name": "Jump",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "space",
"GamepadCode": "A"
},
{
"Name": "Run",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "shift",
"GamepadCode": "LeftJoystickButton"
},
{
"Name": "Walk",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "alt",
"GamepadCode": "None"
},
{
"Name": "Duck",
"GroupName": "Movement",
"Title": null,
"KeyboardCode": "ctrl",
"GamepadCode": "B"
},
{
"Name": "Attack1",
"GroupName": "Actions",
"Title": "Primary Attack",
"KeyboardCode": "mouse1",
"GamepadCode": "RightTrigger"
},
{
"Name": "Attack2",
"GroupName": "Actions",
"Title": "Secondary Attack",
"KeyboardCode": "mouse2",
"GamepadCode": "LeftTrigger"
},
{
"Name": "Reload",
"GroupName": "Actions",
"Title": null,
"KeyboardCode": "r",
"GamepadCode": "X"
},
{
"Name": "Use",
"GroupName": "Actions",
"Title": null,
"KeyboardCode": "e",
"GamepadCode": "Y"
},
{
"Name": "Slot1",
"GroupName": "Inventory",
"Title": "Slot #1",
"KeyboardCode": "1",
"GamepadCode": "DpadWest"
},
{
"Name": "Slot2",
"GroupName": "Inventory",
"Title": "Slot #2",
"KeyboardCode": "2",
"GamepadCode": "DpadEast"
},
{
"Name": "Slot3",
"GroupName": "Inventory",
"Title": "Slot #3",
"KeyboardCode": "3",
"GamepadCode": "DpadSouth"
},
{
"Name": "Slot4",
"GroupName": "Inventory",
"Title": "Slot #4",
"KeyboardCode": "4",
"GamepadCode": "None"
},
{
"Name": "Slot5",
"GroupName": "Inventory",
"Title": "Slot #5",
"KeyboardCode": "5",
"GamepadCode": "None"
},
{
"Name": "Slot6",
"GroupName": "Inventory",
"Title": "Slot #6",
"KeyboardCode": "6",
"GamepadCode": "None"
},
{
"Name": "Slot7",
"GroupName": "Inventory",
"Title": "Slot #7",
"KeyboardCode": "7",
"GamepadCode": "None"
},
{
"Name": "Slot8",
"GroupName": "Inventory",
"Title": "Slot #8",
"KeyboardCode": "8",
"GamepadCode": "None"
},
{
"Name": "Slot9",
"GroupName": "Inventory",
"Title": "Slot #9",
"KeyboardCode": "9",
"GamepadCode": "None"
},
{
"Name": "Slot0",
"GroupName": "Inventory",
"Title": "Slot #0",
"KeyboardCode": "0",
"GamepadCode": "None"
},
{
"Name": "SlotPrev",
"GroupName": "Inventory",
"Title": "Previous Slot",
"KeyboardCode": "mouse4",
"GamepadCode": "SwitchLeftBumper"
},
{
"Name": "SlotNext",
"GroupName": "Inventory",
"Title": "Next Slot",
"KeyboardCode": "mouse5",
"GamepadCode": "SwitchRightBumper"
},
{
"Name": "View",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "C",
"GamepadCode": "RightJoystickButton"
},
{
"Name": "Voice",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "v",
"GamepadCode": "None"
},
{
"Name": "Drop",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "g",
"GamepadCode": "None"
},
{
"Name": "Flashlight",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "f",
"GamepadCode": "DpadNorth"
},
{
"Name": "Score",
"GroupName": "Other",
"Title": "Scoreboard",
"KeyboardCode": "tab",
"GamepadCode": "SwitchLeftMenu"
},
{
"Name": "Menu",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "Q",
"GamepadCode": "SwitchRightMenu"
},
{
"Name": "Chat",
"GroupName": "Other",
"Title": null,
"KeyboardCode": "enter",
"GamepadCode": "None"
}
],
"__guid": "1bf3705f-6117-4420-801f-7c8b1f69c816",
"__schema": "configdata",
"__type": "InputSettings",
"__version": 1
}

3
code/Assembly.cs Normal file
View File

@ -0,0 +1,3 @@
global using Sandbox;
global using System.Collections.Generic;
global using System.Linq;

53
code/LocalCar.cs Normal file
View File

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
using VeloX;
namespace Sandbox
{
internal class LocalCar : Component, Component.INetworkListener
{
void INetworkListener.OnDisconnected( Connection channel )
{
if ( Car?.ConnectionID == channel.Id )
DestroyGameObject();
}
[Property] VeloXCar Car { get; set; }
[Property] public Vector3 CameraOffset { get; set; }
private Angles EyeAngles { get; set; }
protected override void OnUpdate()
{
if ( !Car.IsDriver )
return;
UpdateEyeAngles();
CameraSetup();
}
private void UpdateEyeAngles()
{
Angles input = Input.AnalogLook;
Angles eyeAngles = EyeAngles;
eyeAngles += input;
eyeAngles.roll = 0f;
eyeAngles.pitch = eyeAngles.pitch.Clamp( 0f - 89, 89 );
EyeAngles = eyeAngles;
}
protected void CameraSetup()
{
var cam = Scene.Camera;
cam.WorldRotation = EyeAngles;
cam.WorldPosition = WorldPosition + Vector3.Up * CameraOffset.z + cam.WorldRotation.Backward * CameraOffset.x;
}
}
}

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VeloX;
namespace Sandbox;
public sealed class VeloXNetworkManager : Component, Component.INetworkListener
{
/// <summary>
/// The prefab to spawn for the player to control.
/// </summary>
[Property] public GameObject PlayerPrefab { get; set; }
protected override async Task OnLoad()
{
if ( Scene.IsEditor )
return;
if ( !Networking.IsActive )
{
LoadingScreen.Title = "Creating Lobby";
await Task.DelayRealtimeSeconds( 0.1f );
Networking.CreateLobby( new() );
}
}
/// <summary>
/// A client is fully connected to the server. This is called on the host.
/// </summary>
public void OnActive( Connection channel )
{
Log.Info( $"Player '{channel.DisplayName}' has joined the game" );
if ( !PlayerPrefab.IsValid() )
return;
var player = PlayerPrefab.Clone( WorldTransform, name: $"Player - {channel.DisplayName}" );
player.NetworkSpawn( channel );
player.Components.Get<VeloXCar>().ConnectionID = channel.Id;
}
}

28
velox_test.sbproj Normal file
View File

@ -0,0 +1,28 @@
{
"Title": "VeloX Test",
"Type": "game",
"Org": "meteorlab",
"Ident": "velox_test",
"Schema": 1,
"IncludeSourceFiles": false,
"Resources": null,
"PackageReferences": [],
"EditorReferences": null,
"Mounts": null,
"IsStandaloneOnly": false,
"Metadata": {
"MaxPlayers": 64,
"MinPlayers": 1,
"TickRate": 50,
"GameNetworkType": "Multiplayer",
"MapSelect": "Unrestricted",
"MapList": [
"facepunch.flatgrass"
],
"RankType": "None",
"PerMapRanking": false,
"LeaderboardType": "None",
"CsProjName": "",
"StartupScene": "scenes/minimal.scene"
}
}