public static Scene CreateScene(SceneType sceneType = SceneType.Client, string name = "Client", Scene parent = null, long id = 0) { Scene scene = (Scene)Game.ObjectPool.Fetch(typeof(Scene)); scene.Id = id != 0 ? id : IdGenerater.GenerateId(); scene.Name = name; scene.SceneType = sceneType; if (parent != null) { scene.Parent = parent; } scene.Domain = scene; return(scene); }
public ComponentQueue(string typeName) { Id = IdGenerater.GenerateId(); TypeName = typeName; #if !SERVER ViewGO = new GameObject(); ViewGO.name = GetType().Name; ViewGO.layer = LayerNames.GetLayerInt(LayerNames.HIDDEN); ViewGO.transform.SetParent(Game.transform, false); var componentView = ViewGO.AddComponent(typeof(ComponentView)) as ComponentView; if (componentView) { componentView.Component = this; } #endif }
protected Entity() { InstanceId = IdGenerater.GenerateId(); #if !SERVER if (!GetType().IsDefined(typeof(HideInHierarchy), true)) { ViewGO = new GameObject(); ViewGO.name = GetType().Name; ViewGO.layer = LayerNames.GetLayerInt(LayerNames.HIDDEN); ViewGO.transform.SetParent(Global.transform, false); var componentView = ViewGO.AddComponent(typeof(ComponentView)) as ComponentView; if (componentView) { componentView.Component = this; } } #endif }
protected AChannel(AService service, ChannelType channelType) { this.Id = IdGenerater.GenerateId(); this.ChannelType = channelType; this.Service = service; }