Skip to content

Commit

Permalink
Add the first bit of documentation on how the functionalities system …
Browse files Browse the repository at this point in the history
…works
  • Loading branch information
mvriel committed Jun 18, 2024
1 parent 0177a60 commit 6e603c3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
57 changes: 56 additions & 1 deletion docs/docs/developers/features/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# Functionalities

_This space is intentionally left blank._
At the core of Netherlands3D, various functionalities serve as building blocks. Each functionality represents a distinct
element or feature of the platform, designed to perform specific tasks.
These functionalities are modular, meaning they can be enabled or disabled individually based on user requirements or
the needs of a particular project.

This ability to toggle functionalities on and off ensures that you have control over the features you want to deploy in
your project.

## Configuring Functionalities

Furthermore, each functionality can be individually configured according to specific project requirements. Read more
about this in detail in the chapter about [configuration](../configuration.md).

Through additional configuration settings, you have the flexibility to adjust the functionality's behavior and
characteristics to match your project's needs. You'll have access to a broad range of settings allowing you to refine
each element of your project in detail.

To give some context to the above: examples of additional configuration options are API keys, URLs of services,
default values for new projects and more.

## How does it work

In Unity's context for the Netherlands3D platform, each functionality is encapsulated in a ScriptableObject. Exploring
further, you'll discover that each ScriptableObject is highly configurable, granting you the ability to tailor it to
satisfy specific demands.

### Key Components

#### ScriptableObjects
The ScriptableObjects for the functionalities can be located in the `Scriptables/Functionalities` folder. Each
ScriptableObject represents a distinct functionality in the application, and can be configured to define its behavior
and properties within the application.

#### Functionality System

The code powering the functionality system is hosted within the embedded package named
`eu.netherlands3d.eu.twin-functionalities`. Digging into this package reveals the design and implementation of
the system that manages and orchestrates the functionalities.

#### The Functionality Script

At the core, the Functionality script exists as a foundational unit for the ScriptableObject. Here is where you define
key attributes such as its title, description, ID, and any additional configuration. This script performs the following
roles:

1. **Title and Description**: The title and description fields of the ScriptableObject are primarily designed for your
reference in the settings screen of the application.

2. **Functionality ID**: The ID (or code) is used to refer to the functionality from the configuration file. This ID attribute
is instrumental in organizing and managing configurations of functionalities within the system robustly.

3. **Enabled State**: The enabled state of the functionality indicates whether it's active or inactive. The system can query
this status to determine the functionality's availability and act accordingly in any part of the application.

4. **Additional Configuration**: The ScriptableObject also includes an additional configuration section where you can define
supplementary settings and properties that control its behavior within your application.
File renamed without changes.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ nav:
- 'docs/developers/features/layers.md'
- 'docs/developers/features/geojson.md'
- 'Packages':
- 'docs/developers/packages/creating-and-managing-packages.md'
- 'docs/developers/packages/index.md'
- 'User interface':
- 'docs/developers/ui/introduction.md'
- 'docs/developers/ui/keeping-our-documentation-current.md'
Expand Down

0 comments on commit 6e603c3

Please sign in to comment.