Thank you for your interest in contributing to Life in Between XR! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Pull Request Process
- Testing Requirements
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Respect different viewpoints and experiences
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/XRTrainRide.git cd XRTrainRide - Add upstream remote:
git remote add upstream https://github.com/Caerii/XRTrainRide.git
- Set up the project (see Setup Guide)
- Create a branch for your work:
git checkout -b feature/your-feature-name
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions/updates
Follow conventional commit format:
type(scope): subject
body (optional)
footer (optional)
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formattingrefactor: Code refactoringtest: Testschore: Maintenance
Example:
feat(search): Add autocomplete filtering by transit line
Implemented filtering of search results based on selected
transit line to improve relevance of location suggestions.
git fetch upstream
git checkout main
git merge upstream/main
git push origin main-
Naming Conventions:
- Classes:
PascalCase(e.g.,LineSelector) - Methods:
PascalCase(e.g.,SelectLine) - Variables:
camelCase(e.g.,selectedLine) - Constants:
UPPER_CASE(e.g.,MAX_LINES) - Private fields:
m_camelCaseor_camelCase
- Classes:
-
File Organization:
- One class per file
- File name matches class name
- Scripts in
Assets/Scripts/
-
Code Formatting:
- Use 4 spaces for indentation
- Use braces for all control structures
- Add XML comments for public APIs
-
Component Organization:
- Use
[SerializeField]for private fields exposed in Inspector - Use
[Header]and[Tooltip]attributes for better Inspector UX - Keep MonoBehaviour scripts focused and single-purpose
- Use
-
Performance:
- Cache component references in
Awake()orStart() - Avoid
FindObjectOfType()inUpdate() - Use object pooling for frequently instantiated objects
- Minimize allocations in hot paths
- Cache component references in
-
Scene Organization:
- Use clear, descriptive GameObject names
- Organize hierarchy logically
- Use empty GameObjects as containers when needed
using UnityEngine;
/// <summary>
/// Manages transit line selection and state.
/// </summary>
public class LineSelector : MonoBehaviour
{
[Header("Line Configuration")]
[Tooltip("List of available transit lines")]
[SerializeField] private List<Line> m_linesList;
/// <summary>
/// Selects a transit line and deselects all others.
/// </summary>
/// <param name="selectedLineName">Name of the line to select</param>
public void SelectLine(string selectedLineName)
{
if (string.IsNullOrEmpty(selectedLineName))
{
Debug.LogWarning("Line name cannot be null or empty");
return;
}
foreach (Line line in m_linesList)
{
line.selected = line.name == selectedLineName;
}
}
}- Update documentation if you've changed functionality
- Add tests if applicable
- Test on target devices (ARCore-compatible Android device)
- Ensure code compiles without warnings
- Follow coding standards
- Code follows project style guidelines
- Self-review completed
- Comments added for complex code
- Documentation updated
- No new warnings generated
- Tested on target device
- Changes tested in relevant scenes
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Screenshots (if applicable)
Add screenshots for UI changes
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] Tested on device-
Test in Unity Editor:
- Open relevant test scenes
- Verify functionality works as expected
- Check for console errors/warnings
-
Test on Device:
- Build and deploy to ARCore-compatible device
- Test AR functionality
- Verify performance is acceptable
- Test on different Android versions if possible
-
Test Scenes:
Test00_Autocomplete.unity: Test autocomplete featuresTest01_3dMap.unity: Test 3D map renderingScene00_MainMenu.unity: Test main menu flow
- New features should include basic test scenarios
- Bug fixes should include regression tests
- AR features must be tested on physical devices
- Automated Checks: PRs are checked for build success
- Code Review: At least one maintainer reviews
- Testing: Reviewer may test on device
- Feedback: Address any requested changes
- Merge: Once approved, PR is merged
- Open an issue for questions
- Check existing issues for similar questions
- Review Architecture Documentation for system design
- See API Reference for code details
Thank you for contributing to Life in Between XR!