FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Unity3DTraining/DesignPatterns/Singleton/UnitySingleton.cs at master · XINCGer/Unity3DTraining · GitHub
XINCGer
/
Unity3DTraining
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
9.1k
Code
Issues
6
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Unity3DTraining
/
DesignPatterns
/
Singleton
/
UnitySingleton.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (18 loc) · 369 Bytes
Breadcrumbs
Unity3DTraining
/
DesignPatterns
/
Singleton
/
UnitySingleton.cs
Copy path
File metadata and controls
22 lines (18 loc) · 369 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
Unity中的单例模式
*/
public
class
UnitySingleton
:
MonoBehaviour
{
private
static
UnitySingleton
_instance
=
null
;
void
Awake
(
)
{
_instance
=
this
;
}
public
static
UnitySingleton
GetInstance
(
)
{
return
_instance
;
}
}
public
class
Test
{
void
static
Main
(
string
[
]
args
)
{
UnitySingleton
.
GetInstance
(
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL