Exemplo n.º 1
0
        void Awake()
        {
            roomState = RoomState.InMatch;
            if (Instance != null)
            {
                GameObject.Destroy(Instance.gameObject);
            }
            Instance = this;
            DontDestroyOnLoad(gameObject);

            matchRoom = gameObject.AddComponent <MatchRoom>();

            StartCoroutine(InitGameData());

            ml = gameObject.AddComponent <MainThreadLoop>();

            TextAsset bindata = Resources.Load("Config") as TextAsset;

            Debug.Log("nameMap " + bindata);

            ServerIP = ClientApp.Instance.remoteServerIP;
            Debug.LogError("ServerIP: " + ServerIP);

            state = WorldState.Connecting;
            StartCoroutine(InitConnect());
        }
Exemplo n.º 2
0
    private void Awake()
    {
        Instance = this;
        ml       = gameObject.AddComponent <MainThreadLoop>();

        StartCoroutine(ConnectServer());
    }
Exemplo n.º 3
0
        void Awake()
        {
            roomState = RoomState.InMatch;
            if (Instance != null)
            {
                GameObject.Destroy(Instance.gameObject);
            }
            Instance = this;
            DontDestroyOnLoad(gameObject);

            matchRoom = gameObject.AddComponent <MatchRoom>();

            StartCoroutine(InitGameData());

            ml = gameObject.AddComponent <MainThreadLoop>();

            TextAsset bindata = Resources.Load("Config") as TextAsset;

            Debug.Log("nameMap " + bindata);

            //ServerIP = ClientApp.Instance.remoteServerIP;
            Debug.LogError("ServerIP: " + ClientApp.Instance.QueryServerIP);

            state = WorldState.Connecting;
            StartCoroutine(FindIdleServerThenConnect());

            var eh = gameObject.AddComponent <EvtHandler>();

            eh.AddEvent(MyEvent.EventType.ExitScene, OnExit);

            gameObject.AddComponent <NetworkLatency>();
        }
Exemplo n.º 4
0
 void Awake()
 {
     if (SaveGame.saveGame == null)
     {
         gameObject.AddComponent <SaveGame>();
     }
     ml = gameObject.AddComponent <MainThreadLoop>();
 }
Exemplo n.º 5
0
        void Awake()
        {
            StartCoroutine(InitGameData());

            ml = gameObject.AddComponent <MainThreadLoop>();

            TextAsset bindata = Resources.Load("Config") as TextAsset;

            Debug.Log("nameMap " + bindata);

            ServerIP = ClientApp.Instance.remoteServerIP;
            Debug.LogError("ServerIP: " + ServerIP);

            state = WorldState.Connecting;
            //StartCoroutine(InitConnect());
        }
Exemplo n.º 6
0
        void Awake()
        {
            ml = gameObject.AddComponent <MainThreadLoop>();

            TextAsset bindata = Resources.Load("Config") as TextAsset;

            Debug.Log("nameMap " + bindata);
            if (bindata != null)
            {
                ServerIP = SimpleJSON.JSON.Parse(bindata.text).AsObject ["Server"];
            }
            Debug.LogError("ServerIP: " + ServerIP);

            state = WorldState.Connecting;
            StartCoroutine(InitConnect());
        }
Exemplo n.º 7
0
 private void Awake()
 {
     Instance = this;
     ml       = gameObject.AddComponent <MainThreadLoop>();
 }