Skip to content

Commit 10d751c

Browse files
committed
Scriptable Data & Events
1 parent be3af5c commit 10d751c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+746
-146
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Change Log:
22

3-
## 0.1.0
3+
## 1.0.0
44

5-
- Start Project:
6-
- ...
5+
- Base project.

CHANGELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/COMPANYNAME.PACKAGENAME.Editor.asmdef

Lines changed: 0 additions & 16 deletions
This file was deleted.

Editor/EditorExample.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 COMPANYNAME
3+
Copyright (c) 2021 Max Kruf
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
1-
# [COMPANYNAME]() - PACKAGENAME
2-
3-
Description.
1+
# ScriptableData
2+
## Data
3+
ScriptableData stores runtime data to be accessed by scripts that reference the ScriptableObject. It has a OnValueChangedEvent to subscribe when data changes.
4+
With this workflow you can remove dependencies and increase flexibility.
5+
### Extendable Data:
6+
```C#
7+
public class ScriptableData<T0> : ScriptableObject {}
8+
public class ScriptableData<T0, T1> : ScriptableObject {}
9+
public class ScriptableData<T0, T1, T2> : ScriptableObject {}
10+
public class ScriptableData<T0, T1, T2, T3> : ScriptableObject {}
11+
```
12+
### Example:
13+
```C#
14+
[CreateAssetMenu(menuName = "ScriptableData/Data/Vector3", order = 147)]
15+
public class SDVector3 : ScriptableData<Vector3> {}
16+
```
17+
## Events
18+
ScriptableEvent does not contain any runtime data but can be used to send events (with data) around.
19+
### Base Event
20+
```C#
21+
[CreateAssetMenu(menuName = "ScriptableData/Event/Event", order = 147)]
22+
public class ScriptableEvent : ScriptableObject {}
23+
```
24+
### Extendable Events:
25+
```C#
26+
public class ScriptableEvent<T0> : ScriptableObject {}
27+
public class ScriptableEvent<T0, T1> : ScriptableObject {}
28+
public class ScriptableEvent<T0, T1, T2> : ScriptableObject {}
29+
public class ScriptableEvent<T0, T1, T2, T3> : ScriptableObject {}
30+
```
31+
### Example:
32+
```C#
33+
[CreateAssetMenu(menuName = "ScriptableData/Event/Vector3", order = 147)]
34+
public class SEVector3 : ScriptableEvent<Vector3> {}
35+
```
436

537
## Install
6-
738
[Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html)
839

9-
[Unitypackage](https://github.com/COMPANYNAME/PACKAGENAME/releases)
10-
40+
[Unitypackage](https://github.com/maxartz15/ScriptableData/releases)
1141

1242
## LICENSE
13-
1443
Overall package is licensed under [MIT](/LICENSE.md), unless otherwise noted in the [3rd party licenses](/THIRD%20PARTY%20NOTICES.md) file and/or source code.

README.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/RuntimeExample.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)