Skip to content

Commit

Permalink
Update: README.md & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arimger committed Aug 28, 2024
1 parent 4f744fd commit 37e7ea1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
28 changes: 23 additions & 5 deletions Assets/Editor Toolbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,11 @@ Allows to serialize Types and pick them through a dedicated picker.

```csharp
[TypeConstraint(typeof(Collider), AllowAbstract = false, AllowObsolete = false, TypeSettings = TypeSettings.Class, TypeGrouping = TypeGrouping.None)]
public SerializedType var1;
public SerializedType serializedType;

public void Usage()
{
var type = var1.Type;
System.Type type = serializedType.Type;
}
```

Expand All @@ -825,19 +825,19 @@ public void Usage()
Allows to serialize SceneAssets and use them in Runtime.

```csharp
public SerializedScene scene;
public SerializedScene serializedScene;

public void Usage()
{
UnityEngine.SceneManagement.SceneManager.LoadScene(scene.BuildIndex);
UnityEngine.SceneManagement.SceneManager.LoadScene(serializedScene.BuildIndex);
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializedscene.png)
```csharp
[SceneDetails]
public SerializedScene scene;
public SerializedScene serializedScene;
```
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenedetails.png)
Expand Down Expand Up @@ -875,12 +875,30 @@ public void Usage()

Allows to serialize DateTime.

```csharp
public SerializedDateTime serializedDateTime;

public void Usage()
{
System.DateTime dateTime = serializedDateTime;
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddate.png)
#### SerializedDirectory

Allows to serialize folders in form of assets and retrieve direct paths in runtime.

```csharp
public SerializedDirectory serializeDirectory;

public void Usage()
{
string path = serializeDirectory.DirectoryPath;
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddirectory.png)
## Editor Extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class SerializedScene : ISerializationCallbackReceiver
[SerializeField]
private int buildIndex;


void ISerializationCallbackReceiver.OnBeforeSerialize()
{
UpdateProperties();
Expand Down
Binary file modified Docs/serializedtype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,11 @@ Allows to serialize Types and pick them through a dedicated picker.

```csharp
[TypeConstraint(typeof(Collider), AllowAbstract = false, AllowObsolete = false, TypeSettings = TypeSettings.Class, TypeGrouping = TypeGrouping.None)]
public SerializedType var1;
public SerializedType serializedType;

public void Usage()
{
var type = var1.Type;
System.Type type = serializedType.Type;
}
```

Expand All @@ -825,19 +825,19 @@ public void Usage()
Allows to serialize SceneAssets and use them in Runtime.

```csharp
public SerializedScene scene;
public SerializedScene serializedScene;

public void Usage()
{
UnityEngine.SceneManagement.SceneManager.LoadScene(scene.BuildIndex);
UnityEngine.SceneManagement.SceneManager.LoadScene(serializedScene.BuildIndex);
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializedscene.png)
```csharp
[SceneDetails]
public SerializedScene scene;
public SerializedScene serializedScene;
```
![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scenedetails.png)
Expand Down Expand Up @@ -875,12 +875,30 @@ public void Usage()

Allows to serialize DateTime.

```csharp
public SerializedDateTime serializedDateTime;

public void Usage()
{
System.DateTime dateTime = serializedDateTime;
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddate.png)
#### SerializedDirectory

Allows to serialize folders in form of assets and retrieve direct paths in runtime.

```csharp
public SerializedDirectory serializeDirectory;

public void Usage()
{
string path = serializeDirectory.DirectoryPath;
}
```

![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/serializeddirectory.png)
## Editor Extensions
Expand Down

0 comments on commit 37e7ea1

Please sign in to comment.