You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-10Lines changed: 83 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,23 +7,86 @@ It is used for showing ScriptableObjects which are created in your project, in d
7
7
# Usage Example
8
8
1. Clone this repository or download the latest [release package available](https://github.com/ATHellboy/ScriptableObjectMultiSelectDropdown/releases) (There isn't an example folder in `.unitypackage`).
9
9
10
-
2. Create `ScriptableObject` class which you want to create specified objects by that.
10
+
2. There are some options here:
11
+
* Create a `ScriptableObject` class which you want to create specified objects by that.
11
12
12
13
```cs
13
14
usingUnityEngine;
14
15
15
16
[CreateAssetMenu(menuName="Create Block")]
16
17
publicclassBlock : ScriptableObject
17
18
{
18
-
// Some fields
19
+
// Some fields and functions
20
+
}
21
+
```
22
+
23
+
* Create a class that inherits another `ScriptableObject` class.
24
+
25
+
```cs
26
+
usingUnityEngine;
27
+
28
+
[CreateAssetMenu(menuName="Blocks/Sand")]
29
+
publicclassSandBlock : Block
30
+
{
31
+
// Some fields and functions
32
+
}
33
+
```
34
+
35
+
* Create a abstract `ScriptableObject` class then antoher class which inherits this abstract class.
* Create an interface and some `ScriptableObject` classes which inherit this interface. The interface is used for grouping.
57
+
58
+
```cs
59
+
publicinterfaceIBlock
60
+
{
61
+
// Some properties and functions signature
62
+
}
63
+
```
64
+
65
+
```cs
66
+
usingUnityEngine;
67
+
68
+
[CreateAssetMenu(menuName="Blocks/Dirt")]
69
+
publicclassDirtBlock : ScriptableObject, IBlock
70
+
{
71
+
// Some fields and functions
72
+
}
73
+
```
74
+
75
+
```cs
76
+
usingUnityEngine;
77
+
78
+
[CreateAssetMenu(menuName="Blocks/Snow")]
79
+
publicclassSnowBlock : ScriptableObject, IBlock
80
+
{
81
+
// Some fields and functions
19
82
}
20
83
```
21
84
22
85
3. Create ScriptableObjects in the project.
23
86
24
87

25
88
26
-
4. Use `ScriptableObjectMultiSelectDropdown` attribute by setting type of specified ScriptableObject derived class and optional grouping (Default grouping is None) like this in `MonoBeahviour` or `ScriptableObject` derived classes.
89
+
4. Use `ScriptableObjectMultiSelectDropdown` attribute by setting type of specified `ScriptableObject` derived class and optional grouping (Default grouping is `None`) behind `ScriptableObjectReference` type variable like these in MonoBeahviour or ScriptableObject derived classes.
0 commit comments