File tree Expand file tree Collapse file tree 2 files changed +50
-2
lines changed
docs/ScriptReference/Interfaces Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Original file line number Diff line number Diff line change 11# JCS_Instance
22
33Singleton 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+ ```
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments