Skip to content

Commit 128e7ff

Browse files
committed
Update doc
1 parent 3ba02c4 commit 128e7ff

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
11
# JCS_Instance
22

33
Singleton instance interface.
4+
5+
This file contain three classes.
6+
7+
### 1) JCS_Instance
8+
9+
See `Example.cs`:
10+
11+
```cs
12+
public class Example : JCS_Instance<Example>
13+
{
14+
private void Awake ()
15+
{
16+
instance = this;
17+
}
18+
}
19+
```
20+
21+
### 2) JCS_InstanceOld
22+
23+
Singleton instance interface to keep the old instance.
24+
25+
See `ExampleOld.cs`:
26+
27+
```cs
28+
public class ExampleOld : JCS_InstanceOld<Example>
29+
{
30+
private void Awake ()
31+
{
32+
CheckInstance(this);
33+
}
34+
}
35+
```
36+
37+
### 3) JCS_InstanceNew
38+
39+
Check singleton for keep the old one.
40+
41+
See `ExampleNew.cs`:
42+
43+
```cs
44+
public class ExampleNew : JCS_InstanceNew<Example>
45+
{
46+
private void Awake ()
47+
{
48+
CheckInstance(this);
49+
}
50+
}
51+
```

docs/ScriptReference/Interfaces/JCS_Settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Interface of all setting class.
1717

1818
## Example
1919

20-
ExampleSetting.cs
20+
Example.cs
2121

2222
```cs
23-
public class ExampleSetting : MonoBehaviour
23+
public class Example : JCS_Settings<Example>
2424
{
2525
private void Awake ()
2626
{

0 commit comments

Comments
 (0)