Exemplo n.º 1
0
        public static Scene CreateScene(long id, string name, SceneType sceneType, Scene parent = null)
        {
            Scene scene = (Scene)Game.ObjectPool.Fetch(typeof(Scene));
            scene.Id = id;

            Game.EventSystem.Remove(scene.InstanceId);

            // 高14位是进程id
            scene.InstanceId = IdGenerater.GenerateSceneInstanceId(id);

            Game.EventSystem.RegisterSystem(scene);

            if (parent != null)
            {
                scene.Parent = parent;
            }
            scene.Domain = scene;

            scene.Name = name;
            scene.SceneType = sceneType;

            return scene;
        }
Exemplo n.º 2
0
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.Service     = service;
 }