/////////////////
 // Constructor //
 /////////////////
 void Awake()
 {
     if (Smanager != null && Smanager != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         Smanager = this;
     }
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     instance = GetComponent <SurpriseManager>(); //required for singleton with instance in scene
 }