void Start()
    {
        levelManager = FindObjectOfType <LevelManager>();

        if (!levelManager)
        {
            throw new UnityException("Level manager could not be found");
        }

        gameState = GameState.LOBBY;

        gameObject.AddComponent <MessageQueue>();
        gameObject.AddComponent <ConnectionManager>();

        NetworkRequestTable.init();
        NetworkResponseTable.init();

        cManager = gameObject.GetComponent <ConnectionManager>();

        if (cManager)
        {
            cManager.setupSocket();
            Debug.Log("Connecting to server...");
            StartCoroutine(UpdateLoop(1f / Constants.updatesPerSecond));
        }
    }
Exemplo n.º 2
0
    void Awake()
    {
        mainObject = GameObject.Find("MainObject");

        NetworkRequestTable.init();
        NetworkResponseTable.init();
    }
Exemplo n.º 3
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);

        gameObject.AddComponent <MessageQueue>();
        gameObject.AddComponent <ConnectionManager>();

        NetworkRequestTable.init();
        NetworkResponseTable.init();
    }
Exemplo n.º 4
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);

        gameObject.AddComponent("MessageQueue");
        gameObject.AddComponent("ConnectionManager");

        NetworkRequestTable.init();
        NetworkResponseTable.init();

        SpeciesTable.initialize();
    }
Exemplo n.º 5
0
    //ConnectionManager cManager = null;
    void Awake()
    {
        //cManager = new ConnectionManager();


        gameObject.AddComponent <MessageQueue>();
        gameObject.AddComponent <ConnectionManager>();
        DontDestroyOnLoad(gameObject);

        NetworkRequestTable.init();
        NetworkResponseTable.init();

        SpeciesTable.initialize();
    }
Exemplo n.º 6
0
    void Awake()
    {
        sceneController = FindObjectOfType <SceneController>();
        if (!sceneController)
        {
            throw new UnityException("Scene Controller could not be found");
        }

        gameState = GameState.LOGIN;

        gameObject.AddComponent <MessageQueue>();
        gameObject.AddComponent <ConnectionManager>();

        NetworkRequestTable.init();
        NetworkResponseTable.init();
    }
Exemplo n.º 7
0
 void Awake()
 {
     //DontDestroyOnLoad(gameObject);
     NetworkRequestTable.init();
     NetworkResponseTable.init();
 }