Skip to content

Commit

Permalink
Merge pull request #19 from poirierlouis/patch-1
Browse files Browse the repository at this point in the history
Update wiki to add a note about ScriptableService
  • Loading branch information
psiberx authored Jun 29, 2024
2 parents 8029cdd + df5a2ef commit f0af149
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ Service instance can be accessed using service container:
let myService = GameInstance.GetScriptableServiceContainer().GetService(n"MyService") as MyService;
```

**Note:** if you declare `MyService` in a module, you must include the full path of the module to get the service:

```swift
module MyModule.Services

class MyService extends ScriptableService {
// ...
}

let myService = GameInstance.GetScriptableServiceContainer().GetService(n"MyModule.Services.MyService") as MyService;
```

Service properties marked as `persistent` will keep their state forever.
Unlike scriptable systems, service state storage is not tied to save files.

Expand Down

0 comments on commit f0af149

Please sign in to comment.