コード例 #1
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        PubSubServerInstance.Subscribe(typeof(SuccessMessage), OnSuccess);
        PubSubServerInstance.Subscribe(typeof(FailureMessage), OnFailure);
    }
コード例 #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");
    }