VR Development Framework
v 1.0.0
Main Page
Related Pages
Namespaces
Classes
All
Classes
Namespaces
Functions
Variables
Enumerations
Enumerator
Properties
Events
Pages
AVR
Core
Singleton< T >
_Instance
Awake
Instance
OnApplicationQuit
SetInstance
void AVR.Core.Singleton< T >.SetInstance
(
)
inline
private
Definition at line
32
of file
Singleton.cs
.
33
{
34
if
(
_Instance
!= null &&
_Instance
!=
this
)
35
{
36
AVR_DevConsole.cwarn(this.name +
" is marked as Singleton but another instance was found in the scene. Continuing to use old one."
,
this
);
37
return
;
38
}
39
40
Instance
= gameObject.GetComponent<T>();
41
42
if
(
Instance
== null)
43
{
44
AVR_DevConsole.cerror(this.name +
" is marked as a Singleton of type "
+ typeof(T).ToString() +
" but no component of this type was found!"
,
this
);
45
}
46
47
DontDestroyOnLoad(
this
);
48
}
AVR.Core.Singleton< T >.Instance
static T Instance
Definition:
Singleton.cs:13
AVR.Core.Singleton< T >._Instance
static T _Instance
Definition:
Singleton.cs:25