Skip to content

Commit 078951d

Browse files
author
András Kurai
committed
add welcome page
1 parent dccd682 commit 078951d

File tree

4 files changed

+56
-4
lines changed

4 files changed

+56
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,4 @@ FodyWeavers.xsd
398398
# End of https://www.toptal.com/developers/gitignore/api/visualstudio
399399

400400
!.vscode/**/*
401+
.vscode/docfx-assistant
11 KB
Loading

Documentation/index.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,54 @@
1-
# This is the **HOMEPAGE**.
2-
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
3-
## Quick Start Notes:
4-
1. Add images to the *images* folder if the file is referencing an image.
1+
# Unity Resource Generator
2+
3+
Automatically generate a helper class for `Resources.Load` in Unity with the press of a button.
4+
5+
![Generate Button](~/images/intro/GenerateButton.png)
6+
7+
With this folder structure:
8+
9+
```
10+
Assets/
11+
├─ Resources/
12+
│ ├─ Coin.prefab
13+
│ ├─ Coin.mp3
14+
├─ Scenes/
15+
│ ├─ CoinRain.unity
16+
```
17+
18+
The following helper class is generated:
19+
20+
```csharp
21+
using UnityEngine;
22+
using UnityEngine.SceneManagement;
23+
24+
namespace Sample
25+
{
26+
// ReSharper disable PartialTypeWithSinglePart
27+
public static partial class ResourcePaths
28+
{
29+
30+
public static partial class Scenes
31+
{
32+
public const string CoinRain = "Scenes/CoinRain";
33+
34+
public static void LoadCoinRain(LoadSceneMode mode = LoadSceneMode.Single) =>
35+
SceneManager.LoadScene(CoinRain, mode);
36+
37+
public static AsyncOperation LoadAsyncCoinRain(LoadSceneMode mode = LoadSceneMode.Single) =>
38+
SceneManager.LoadSceneAsync(CoinRain, mode);
39+
}
40+
41+
public static partial class Prefabs
42+
{
43+
public const string Coin = "Coin";
44+
public static GameObject LoadCube() => Resources.Load<GameObject>(Coin);
45+
}
46+
47+
public static partial class AudioClips
48+
{
49+
public const string Coin = "Coin";
50+
public static AudioClip LoadCoin() => Resources.Load<AudioClip>(Coin);
51+
}
52+
}
53+
}
54+
```

ServeDocsLocal.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.\build.ps1 ServeDocs --skip

0 commit comments

Comments
 (0)