void Start()
    {
        // Test
        Connection = FindObjectOfType <ConnectionController>();
        var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus);

        Connection.SetConnectionListener(gatewayConnectionListener);
        gatewayConnectionListener.SetMessageListener(this);

        if (!ConnectToLastServer())
        {
            ConnectTo("ws://127.0.0.1:2999");
        }

        UpdateConnectionStatus();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        Connection = FindObjectOfType<ConnectionController>();

        if (Connection == null || !Connection.IsConnected)
        {
            Application.LoadLevel("login");
            return;
        }

        var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus);
        gatewayConnectionListener.SetMessageListener(this);
        Connection.SetConnectionListener(gatewayConnectionListener);

        DontDestroyOnLoad(this);
        DontDestroyOnLoad(Player);

        // Setup player
        Player.transform.position = PersistentData.ZoneLoadData.PlayerPosition;

        Application.LoadLevel("world");
        Connection.SendMessage(MessageCode.PlayerInGame, new JSONObject());
    }
    // Use this for initialization
    void Start()
    {
        Connection = FindObjectOfType <ConnectionController>();

        if (Connection == null || !Connection.IsConnected)
        {
            Application.LoadLevel("login");
            return;
        }

        var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus);

        gatewayConnectionListener.SetMessageListener(this);
        Connection.SetConnectionListener(gatewayConnectionListener);

        DontDestroyOnLoad(this);
        DontDestroyOnLoad(Player);

        // Setup player
        Player.transform.position = PersistentData.ZoneLoadData.PlayerPosition;

        Application.LoadLevel("world");
        Connection.SendMessage(MessageCode.PlayerInGame, new JSONObject());
    }
Example #4
0
    void Start()
    {
        // Test
        Connection = FindObjectOfType<ConnectionController>();
        var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus);
        Connection.SetConnectionListener(gatewayConnectionListener);
        gatewayConnectionListener.SetMessageListener(this);

        if (!ConnectToLastServer())
        {
            ConnectTo("ws://127.0.0.1:2999");
        }

        UpdateConnectionStatus();
    }