Skip to content

Commit 26def12

Browse files
Copilotxavierarpa
andcommitted
Add code quality improvements and performance optimizations
Co-authored-by: xavierarpa <44328679+xavierarpa@users.noreply.github.com>
1 parent f1efb24 commit 26def12

9 files changed

Lines changed: 847 additions & 23 deletions

File tree

.editorconfig

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
# Code files
13+
[*.{cs,csx,vb,vbx}]
14+
indent_style = space
15+
indent_size = 4
16+
end_of_line = crlf
17+
18+
# XML project files
19+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
# XML config files
24+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
25+
indent_style = space
26+
indent_size = 2
27+
28+
# JSON files
29+
[*.{json,json5}]
30+
indent_style = space
31+
indent_size = 2
32+
33+
# YAML files
34+
[*.{yml,yaml}]
35+
indent_style = space
36+
indent_size = 2
37+
38+
# Markdown files
39+
[*.md]
40+
trim_trailing_whitespace = false
41+
42+
# Unity specific files
43+
[*.{asmdef,asmref}]
44+
indent_style = space
45+
indent_size = 2
46+
47+
# Unity meta files
48+
[*.meta]
49+
indent_style = space
50+
indent_size = 2
51+
52+
# C# coding style
53+
[*.cs]
54+
# New line preferences
55+
csharp_new_line_before_open_brace = all
56+
csharp_new_line_before_else = true
57+
csharp_new_line_before_catch = true
58+
csharp_new_line_before_finally = true
59+
csharp_new_line_before_members_in_object_initializers = true
60+
csharp_new_line_before_members_in_anonymous_types = true
61+
62+
# Indentation preferences
63+
csharp_indent_case_contents = true
64+
csharp_indent_switch_labels = true
65+
66+
# Space preferences
67+
csharp_space_after_cast = false
68+
csharp_space_after_keywords_in_control_flow_statements = true
69+
csharp_space_between_method_call_parameter_list_parentheses = false
70+
csharp_space_between_method_declaration_parameter_list_parentheses = false
71+
csharp_space_between_parentheses = false
72+
csharp_space_before_colon_in_inheritance_clause = true
73+
csharp_space_after_colon_in_inheritance_clause = true
74+
csharp_space_around_binary_operators = before_and_after
75+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
76+
csharp_space_between_method_call_name_and_opening_parenthesis = false
77+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
78+
79+
# Organize usings
80+
dotnet_sort_system_directives_first = true
81+
dotnet_separate_import_directive_groups = false

.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Unity generated files
2+
[Ll]ibrary/
3+
[Tt]emp/
4+
[Oo]bj/
5+
[Bb]uild/
6+
[Bb]uilds/
7+
[Ll]ogs/
8+
[Uu]ser[Ss]ettings/
9+
10+
# MemoryCaptures can get excessive in size
11+
[Mm]emoryCaptures/
12+
13+
# Asset meta data should only be ignored when the corresponding asset is also ignored
14+
![Aa]ssets/**/*.meta
15+
16+
# Uncomment this line if you wish to ignore the asset store tools plugin
17+
# [Aa]ssets/AssetStoreTools*
18+
19+
# Autogenerated Jetbrains Rider plugin
20+
[Aa]ssets/Plugins/Editor/JetBrains*
21+
22+
# Visual Studio cache directory
23+
.vs/
24+
25+
# Gradle cache directory
26+
.gradle/
27+
28+
# Autogenerated VS/MD/Consulo solution and project files
29+
ExportedObj/
30+
.consulo/
31+
*.csproj
32+
*.unityproj
33+
*.sln
34+
*.suo
35+
*.tmp
36+
*.user
37+
*.userprefs
38+
*.pidb
39+
*.booproj
40+
*.svd
41+
*.pdb
42+
*.mdb
43+
*.opendb
44+
*.VC.db
45+
46+
# Unity3D generated meta files
47+
*.pidb.meta
48+
*.pdb.meta
49+
*.mdb.meta
50+
51+
# Unity3D generated file on crash reports
52+
sysinfo.txt
53+
54+
# Builds
55+
*.apk
56+
*.aab
57+
*.unitypackage
58+
*.unitypackage.meta
59+
60+
# Crashlytics generated file
61+
crashlytics-build.properties
62+
63+
# Packed Addressables
64+
[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
65+
66+
# Temporary auto-generated Android Assets
67+
[Aa]ssets/[Ss]treamingAssets/aa.meta
68+
[Aa]ssets/[Ss]treamingAssets/aa/*
69+
70+
# IDE and editor files
71+
.vscode/
72+
.idea/
73+
*.swp
74+
*.swo
75+
*~
76+
77+
# OS generated files
78+
.DS_Store
79+
.DS_Store?
80+
._*
81+
.Spotlight-V100
82+
.Trashes
83+
ehthumbs.db
84+
Thumbs.db
85+
86+
# Temporary files
87+
*.tmp
88+
*.bak
89+
*.orig
90+
91+
# Package manager files
92+
node_modules/
93+
npm-debug.log*
94+
yarn-debug.log*
95+
yarn-error.log*
96+
97+
# Test results
98+
TestResults/
99+
*.trx
100+
*.coverage
101+
*.coveragexml
102+
103+
# Documentation generation
104+
Documentation~/
105+
docfx_project/
106+
_site/
107+
108+
# Benchmark results
109+
BenchmarkDotNet.Artifacts/
110+
111+
# Local development files
112+
.env
113+
.env.local

CONTRIBUTING.md

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,101 @@
1-
# Contributing
2-
---
1+
# Contributing to UniFlux
2+
3+
Thank you for your interest in contributing to UniFlux! This document provides guidelines and information for contributors.
4+
35
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request)
4-
## All contributions are subject to the [Unity Contribution Agreement(UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement)
6+
7+
## Legal Requirements
8+
9+
All contributions are subject to the [Unity Contribution Agreement (UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement).
510
By making a pull request, you are confirming agreement to the terms and conditions of the UCA, including that your Contributions are your original creation and that you have complete right and authority to make your Contributions.
611

7-
## Once you have a change ready following these ground rules. Simply make a pull request
12+
## Development Setup
13+
14+
### Prerequisites
15+
- Unity 2019.3 or later
16+
- .NET compatible IDE (Visual Studio, Rider, VS Code)
17+
- Git
18+
19+
### Getting Started
20+
1. Fork and clone the repository
21+
2. Open the project in Unity or your preferred IDE
22+
3. Run existing tests to ensure everything works: `Tests/EditMode/`
23+
24+
## Coding Standards
25+
26+
### Code Style
27+
- Use 4 spaces for indentation (configured in .editorconfig)
28+
- Follow C# naming conventions
29+
- Add XML documentation for public APIs
30+
- Keep methods focused and small
31+
- Use `readonly` for fields that don't change after construction
32+
33+
### Performance Guidelines
34+
- Avoid unnecessary allocations in hot paths
35+
- Use `EqualityComparer<T>.Default` instead of `object.Equals()` for value types
36+
- Prefer direct enumeration over foreach when performance is critical
37+
- Cache expensive operations when possible
38+
39+
### Documentation
40+
- Add XML documentation comments for all public APIs
41+
- Include code examples in documentation when helpful
42+
- Update README.md if adding new features
43+
- Document any breaking changes in CHANGELOG.md
44+
45+
## Testing
46+
47+
### Test Requirements
48+
- Add unit tests for all new functionality
49+
- Ensure tests are deterministic and don't depend on external resources
50+
- Use descriptive test names that explain what is being tested
51+
- Include both positive and negative test cases
52+
53+
### Running Tests
54+
Tests are located in `Tests/EditMode/` and use NUnit framework. Run them through Unity's Test Runner or compatible test runner.
55+
56+
## Pull Request Process
57+
58+
### Before Submitting
59+
1. Ensure all tests pass
60+
2. Add tests for new functionality
61+
3. Update documentation as needed
62+
4. Follow the coding standards above
63+
5. Keep commits focused and atomic
64+
65+
### PR Guidelines
66+
- Provide a clear description of changes
67+
- Reference any related issues
68+
- Include test results if applicable
69+
- Be responsive to feedback and reviews
70+
71+
### Performance Impact
72+
If your changes affect performance:
73+
- Include benchmark results
74+
- Explain the performance implications
75+
- Consider backward compatibility
76+
77+
## Issue Reporting
78+
79+
When reporting issues:
80+
- Use the issue template if available
81+
- Provide clear reproduction steps
82+
- Include Unity version and platform information
83+
- Add relevant error messages or logs
84+
85+
## Architecture Considerations
86+
87+
UniFlux follows the Flux pattern:
88+
- **Actions**: Represent events or commands
89+
- **Dispatcher**: Central hub for dispatching actions
90+
- **Stores**: Hold application state and logic
91+
- **Views**: React to state changes
92+
93+
When contributing:
94+
- Maintain unidirectional data flow
95+
- Keep state mutations in stores
96+
- Avoid direct state access outside of stores
97+
- Consider performance implications of state changes
98+
99+
## License
100+
101+
By contributing to UniFlux, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)