Exemple #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());
        }
Exemple #2
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>();
        }
Exemple #3
0
        protected override void Awake()
        {
            base.Awake();
            var go = new GameObject("NetMatchScene");

            netScene = go.AddComponent <NetMatchScene>();
        }
Exemple #4
0
        protected override void Awake()
        {
            base.Awake();
            CameraController.Instance.gameObject.SetActive(false);
            var go = new GameObject("NetMatchScene");

            netScene = go.AddComponent <NetMatchScene>();
        }
Exemple #5
0
 void Start()
 {
     nm = GetComponent <NetMatchScene>();
 }