示例#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;
        }
示例#2
0
文件: AChannel.cs 项目: x1766233/DCET
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.Service     = service;
 }