-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
# JCS_Instance | ||
|
||
Singleton instance interface. | ||
|
||
This file contain three classes. | ||
|
||
### 1) JCS_Instance | ||
|
||
See `Example.cs`: | ||
|
||
```cs | ||
public class Example : JCS_Instance<Example> | ||
{ | ||
private void Awake () | ||
{ | ||
instance = this; | ||
} | ||
} | ||
``` | ||
|
||
### 2) JCS_InstanceOld | ||
|
||
Singleton instance interface to keep the old instance. | ||
|
||
See `ExampleOld.cs`: | ||
|
||
```cs | ||
public class ExampleOld : JCS_InstanceOld<Example> | ||
{ | ||
private void Awake () | ||
{ | ||
CheckInstance(this); | ||
} | ||
} | ||
``` | ||
|
||
### 3) JCS_InstanceNew | ||
|
||
Check singleton for keep the old one. | ||
|
||
See `ExampleNew.cs`: | ||
|
||
```cs | ||
public class ExampleNew : JCS_InstanceNew<Example> | ||
{ | ||
private void Awake () | ||
{ | ||
CheckInstance(this); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters