Exemplo n.º 1
0
        protected void OnLoginSuccessful(LoginSuccessfulEvent e)
        {
            StarService starService = application.serviceManager.get <StarService>() as StarService;
            StarModel   currentStar = starService.GetStarByName(e.player.currentNodeName);

            welcomeText.text = "Welcome to " + currentStar.name;
        }
Exemplo n.º 2
0
        protected void OnLogin(SocketIOEvent e)
        {
            //Debug.Log("LoginService: OnLogin() - Invoked");
            LoginSuccessfulEvent loginSuccessfulEvent = JsonConvert.DeserializeObject <LoginSuccessfulEvent>(e.data);

            this.starsList = loginSuccessfulEvent.starsList;
        }
        public void OnLogin(SocketIOEvent e)
        {
            //Debug.Log("LoginService: OnLogin() - Invoked");
            LoginSuccessfulEvent           loginSuccessfulEvent = JsonConvert.DeserializeObject <LoginSuccessfulEvent>(e.data);
            PlayerModel                    player    = loginSuccessfulEvent.player;
            Dictionary <string, StarModel> starsList = loginSuccessfulEvent.starsList;

            eventManager.DispatchEvent <Events.LoginSuccessfulEvent>(new Events.LoginSuccessfulEvent(player, starsList));
        }
 void OnLoginSuccessful(LoginSuccessfulEvent e)
 {
     Debug.Log("Login Successful, Populating WorldMap");
     foreach (KeyValuePair <string, StarModel> starEntry in e.starsList)
     {
         GameObject     instantiatedStar = Instantiate(starPrefab, starSpawn);
         Vector3        starPosition     = new Vector3(starEntry.Value.coordX, starEntry.Value.coordY, 0);
         StarController starController   = instantiatedStar.GetComponent <StarController>();
         starController.star = starEntry.Value;
         instantiatedStar.transform.position = starPosition;
     }
 }
Exemplo n.º 5
0
 void OnLoginSuccessful(LoginSuccessfulEvent e)
 {
     Debug.Log("Login Successful, Populating WorldMap");
     foreach (StarModel star in stars)
     {
         GameObject     instantiatedStar = Instantiate(starPrefab, starSpawn);
         Vector3        starPosition     = new Vector3(star.coordX, star.coordY, 0);
         StarController starData         = instantiatedStar.GetComponent <StarController>();
         starData.star = star;
         instantiatedStar.transform.position = starPosition;
     }
 }
Exemplo n.º 6
0
 protected void OnLoginSuccessful(LoginSuccessfulEvent e)
 {
     player       = e.player;
     playerLoaded = true;
 }
Exemplo n.º 7
0
 void OnLoginSuccessful(LoginSuccessfulEvent e)
 {
     ChangeState(GameState.StarMenu);
 }
 void OnLoginSuccessful(LoginSuccessfulEvent e)
 {
     PlayerPrefs.SetString("sessionId", e.player.sessionId);
     PlayerPrefs.SetInt("playerId", e.player.id);
     PlayerPrefs.Save();
 }