Kanda SDK 0.6.0
Loading...
Searching...
No Matches
Package Layout

We follow Unity conventions for our package structure, with some specific organizational patterns for scripts. This structure is flexible and can be adapted as needed for specific packages or features, while still maintaining the overall organization principles.

Root Structure

  • Runtime/: Main runtime code
  • Editor/: Editor-specific code
  • Tests/:
    • Runtime/: Runtime tests
    • Editor/: Editor tests
  • Documentation~/: Documentation files
  • Samples~/: Example projects or scenes

Root Files

  • README.md: Documentation entrypoint
  • CHANGELOG.md: Version history
  • package.json: Unity package manifest
  • bitbucket-pipelines.yml: CI pipeline configuration (defines automated build, test, and deployment processes)

Naming Conventions

  • Folders: PascalCase (e.g., Components, Systems)
  • Files: PascalCase (e.g., PlayerController.cs, NetworkSystem.cs)

Script Organization

Scripts are organized by domain, feature, and type:

  1. Domain: Top-level category (e.g., Connection, Settings, Cloud)
  2. Feature: Specific functionality within a domain
  3. Type: Components, Systems, or sub-domains

This approach promotes keeping related scripts in close proximity, while retaining some separation of data models from functionality, as data models are typically used across multiple scripts in their domain.

DOTS/Netcode Features

For Entities or Netcode-based features:

Domain/
|-- Feature/
|-- Components/
|-- Systems/

Managed Code Features

For traditional managed code:

Domain/
|-- SubDomain1/
|-- SubDomain2/

Tests

The tests folder generally mirrors the structure of the main package.

Tests/
|-- Editor/
|-- Runtime/
|-- DOTSDomain/
|-- Feature/
|-- Components/
|-- Systems/
|-- ManagedDomain/
|-- SubDomain1/
|-- SubDomain2/

Example Structure

io.kanda.foundation/
|-- Runtime/
|-- Connection/
|-- GoInGame/
|-- Components/
|-- Systems/
|-- Lifecycle/
|-- Services/
|-- ContentSceneLoading/
|-- Components/
|-- Systems/
|-- Cloud/
|-- Auth/
|-- Endpoints/
|-- Models/
|-- Networking/
|-- Utilities/
|-- Tests/
|-- Runtime/
|-- Connection/
|-- GoInGame/
|-- Components/
|-- Systems/
|-- Editor/
|-- Documentation~/
|-- Samples~/
|-- README.md
|-- CHANGELOG.md
|-- package.json
|-- bitbucket-pipelines.yml

This structure promotes clarity and scalability while adhering to Unity package conventions. It can be adapted as needed for specific package requirements while maintaining overall organization principles.