Ejemplo n.º 1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        sparkNetwork = gameObject.AddComponent <GameSparksRTUnity> ();

        SceneManager.sceneLoaded   += OnSceneLoaded;
        SceneManager.sceneUnloaded += OnSceneUnloaded;

        MatchFoundMessage.Listener    = OnMatchFound;
        MatchNotFoundMessage.Listener = OnMatchNotFound;
        MatchUpdatedMessage.Listener  = OnMatchUpdated;

        GS.GameSparksAvailable += (isAvailable) => {
            this.isAvailable = isAvailable;
        };

        Update_SparkViews();
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }