Exemplo n.º 1
0
        public void On(LoginService.LoginSuccess_Server succ)
        {
            LiveGame live = new LiveGame(succ.creds);

            gamesByUsername[succ.creds.username] = live;
            gamesByGUID[succ.creds.userId]       = live;
            liveGames.Push(live);
            var game         = live.state;
            var createEntity = new EntityService.CreateEntityForUser();

            createEntity.userId = succ.creds.userId;
            server.On(createEntity);

            var ctrl = entity.AddComponent <Control>(succ.client.id);

            ctrl.mode = game.controlMode;
            ctrl.Send();
        }
Exemplo n.º 2
0
 /// <summary> Adds a component to this entity. </summary>
 /// <typeparam name="T"> Generic type of component to add </typeparam>
 /// <returns> Component of type T that was added </returns>
 public T AddComponent <T>() where T : Comp
 {
     return(service.AddComponent <T>(guid));
 }