Example #1
0
 private void Awake()
 {
     lock (singletonLock) {
         GameSparksUnity[] instances = GameObject.FindObjectsOfType <GameSparksUnity>();
         if (instances != null && instances.Length > 1 && instance != this)
         {
             Debug.Log("Destroying duplicate GameSparksUnity game object.");
             Destroy(this);
         }
         else
         {
             instance = this;
         }
     }
 }
Example #2
0
    void Awake()
    {
        Instance = this;

        SlGS = gameObject.AddComponent <GameSparksUnity>();
    }