Currently, this README only contains development relevant information.
Feel free to add more by creating doc/update-readme branch and update this.
- Create a Branch:
git checkout -b feature/feature-name
Refer to branch naming for details. - Develop the Feature: Implement and test your feature in Unity.
- Commit Regularly: Commit your changes with clear, concise messages.
- Open a Pull Request: Push your branch and open a PR to the
mainbranch. - Link to Issues: Reference any relevant issues in your PR description to automatically close them when the PR is merged.
- Request Review: Have at least one team member review your PR.
- Merge after Approval: Once approved, merg the PR into
main.
-
Creating Issues:
- Create issues in GitHub Issues to track bugs, feature requests, and tasks.
- Assign labels such as
bug,feature,reasearch,design, etc.
-
Using GitHub Projects:
- Use GitHub Projects to organize issues and PRs into sprints or kanban-style boards.
- Move issues across columns (e.g.,
To Do,In Progress,Review,Done) to track progress.
-
Resolving Issues:
- Reference issues in your commits or PRs using
Fixes #issue_numberorCloses #issue_numberto automatically close them when the code is merged. - Ensure the issue is fully resolved before closing.
- Reference issues in your commits or PRs using
-
Milestones:
- Create milestones for major project phases or releases.
- Assign issues and PRs to milestones to track progress towards specific goals.
- Follow the structure:
feat: Add new featurefix: Resolve Bugrefactor: Code improvementsdoc: Update documentationstyle: Code style changes (formatting, etc.)chore: Routine tasks (e.g., package updates or any other non-fitting items with the above)
- Use the following conventions
feature/feature-namefor new featuresbugfix/bug-descriptionfor bug fixeshotfix/hotfix-descriptionfor urgent fixesdoc/update-readmefor documentation updateschore/task-namefor routine tasks such as updating packages or refactoringtest/test-featurefor tests on current feature
- Private Members:
_camelCaseExample:_playerHealth,_enemyList - Public Members:
PascalCaseExample:PlayerHealth,EnemyList - Local Variables:
camelCaseExample:currentHealth,enemyCount - Constants:
SCREAMING_SNAKE_CASEExample:MAX_HEALTH,DEFAULT_SPEED - Methods:
PascalCaseExample:CalculateDamage(),SpawnEnemies()
- MonoBehaviour Methods:
- Standard Unity methods like
Start(),Update(),Awake()should always use PascalCase.
- Standard Unity methods like
- Script Organization:
- Group related methods together, and consider using regions (
#region,#endregion) to organize large scripts.
- Group related methods together, and consider using regions (
- Serialization:
- Use
[SerializeField]for private variables that need to be exposed in the Unity Inspector. - Use properties instead of public fields when appropriate to encapsulate access to data.
// Property with a private field private int _num; public int Num { get { return _num; } set { if (value >= 0) // Example of validation { _num = value; } else { throw new ArgumentOutOfRangeException("Num must be non-negative."); } } }
- Use
- Null Checks:
- Always perform null checks before accessing objects.
- Example:
if (enemy != null) { enemy.TakeDamage(); }
- Error Handling:
- Handle exceptions gracefully, logging errors where necessary.
- Commenting:
- Comment your code where the logic is complex or non-obvious.
- Use XML documentation comments (
///) for public methods and properties.