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

        PubSubServerInstance.Subscribe(typeof(SuccessMessage), OnSuccess);
        PubSubServerInstance.Subscribe(typeof(FailureMessage), OnFailure);
    }
Exemplo n.º 2
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        PubSubServerInstance.Subscribe(typeof(StartGameMessage), OnStartGame);
        PubSubServerInstance.Subscribe(typeof(SuccessMessage), OnSuccess);
        PubSubServerInstance.Subscribe(typeof(FailureMessage), OnFailure);

        Debug.Log("IN AWAKE OF SCENE MANAGER");
    }