Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to make a singleton in unity

 void Awake()
 {
   if (instance == null)
     instance = this;
   else if (instance != this)
     Destroy(gameObject);
 }
Source by www.studica.com #
 
PREVIOUS NEXT
Tagged: #singleton #unity
ADD COMMENT
Topic
Name
3+4 =