Fantasy
搜索结果

    显示/隐藏目录

    Scene 类

    表示一个场景实体,用于创建与管理特定的游戏场景信息。

    继承
    object
    Entity
    Scene
    实现
    IEntity
    IDisposable
    IPool
    继承成员
    Entity.Id
    Entity.RunTimeId
    Entity.IsDisposed
    Entity.Scene
    Entity.Parent
    Entity.Type
    Entity.GetParent<T>()
    Entity.Create<T>(Scene, bool, bool)
    Entity.Create<T>(Scene, long, bool, bool)
    Entity.AddComponent<T>(bool)
    Entity.AddComponent<T>(long, bool)
    Entity.AddComponent(Entity)
    Entity.AddComponent<T>(T)
    Entity.GetComponent<T>()
    Entity.GetComponent(Type)
    Entity.GetComponent<T>(long)
    Entity.GetOrAddComponent<T>(bool)
    Entity.RemoveComponent<T>(bool)
    Entity.RemoveComponent<T>(long, bool)
    Entity.RemoveComponent(Entity, bool)
    Entity.RemoveComponent<T>(T, bool)
    Entity.Deserialize(Scene, bool)
    Entity.ForEachSingleCollection
    Entity.ForEachTransfer
    Entity.ForEachMultiEntity
    Entity.ForEachEntity
    Entity.IsPool()
    Entity.SetIsPool(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy
    程序集: Fantasy.Net.dll
    语法
    public class Scene : Entity, IEntity, IDisposable, IPool

    属性

    | 编辑本文 查看源代码

    CoroutineLockComponent

    Scene下的协程锁组件

    声明
    public CoroutineLockComponent CoroutineLockComponent { get; }
    属性值
    类型 描述
    CoroutineLockComponent
    | 编辑本文 查看源代码

    EntityComponent

    Scene下的ESC系统组件

    声明
    public EntityComponent EntityComponent { get; }
    属性值
    类型 描述
    EntityComponent
    | 编辑本文 查看源代码

    EntityIdFactory

    Entity实体Id的生成器

    声明
    public EntityIdFactory EntityIdFactory { get; }
    属性值
    类型 描述
    EntityIdFactory
    | 编辑本文 查看源代码

    EventComponent

    Scene下的事件系统组件

    声明
    public EventComponent EventComponent { get; }
    属性值
    类型 描述
    EventComponent
    | 编辑本文 查看源代码

    MessagePoolComponent

    Scene下的网络消息对象池组件

    声明
    public MessagePoolComponent MessagePoolComponent { get; }
    属性值
    类型 描述
    MessagePoolComponent
    | 编辑本文 查看源代码

    NetworkMessagingComponent

    Scene下的内网消息发送组件

    声明
    public NetworkMessagingComponent NetworkMessagingComponent { get; }
    属性值
    类型 描述
    NetworkMessagingComponent
    | 编辑本文 查看源代码

    Process

    所在的Process

    声明
    public Process Process { get; }
    属性值
    类型 描述
    Process
    | 编辑本文 查看源代码

    RuntimeIdFactory

    Entity实体RuntimeId的生成器

    声明
    public RuntimeIdFactory RuntimeIdFactory { get; }
    属性值
    类型 描述
    RuntimeIdFactory
    | 编辑本文 查看源代码

    SceneConfigId

    SceneConfig的Id

    声明
    public uint SceneConfigId { get; }
    属性值
    类型 描述
    uint
    | 编辑本文 查看源代码

    SceneType

    Scene类型,对应SceneConfig的SceneType

    声明
    public int SceneType { get; }
    属性值
    类型 描述
    int
    | 编辑本文 查看源代码

    SingleCollectionComponent

    Scene下的Entity分表组件

    声明
    public SingleCollectionComponent SingleCollectionComponent { get; }
    属性值
    类型 描述
    SingleCollectionComponent
    | 编辑本文 查看源代码

    TimerComponent

    Scene下的任务调度器系统组件

    声明
    public TimerComponent TimerComponent { get; }
    属性值
    类型 描述
    TimerComponent
    | 编辑本文 查看源代码

    World

    所属的世界

    声明
    public World World { get; }
    属性值
    类型 描述
    World

    方法

    | 编辑本文 查看源代码

    AddEntity(Entity)

    添加一个实体到当前Scene下

    声明
    public void AddEntity(Entity entity)
    参数
    类型 名称 描述
    Entity entity

    实体实例

    | 编辑本文 查看源代码

    Create(Process, MachineConfig, SceneConfig)

    创建一个新的Scene

    声明
    public static FTask<Scene> Create(Process process, MachineConfig machineConfig, SceneConfig sceneConfig)
    参数
    类型 名称 描述
    Process process

    所属的Process

    MachineConfig machineConfig

    对应的MachineConfig配置文件

    SceneConfig sceneConfig

    对应的SceneConfig配置文件

    返回
    类型 描述
    FTask<Scene>

    创建成功后会返回创建的Scene的实例

    | 编辑本文 查看源代码

    CreateSubScene(Scene, int, Action<Scene, Scene>)

    在Scene下面创建一个子Scene,一般用于副本,或者一些特殊的场景。

    声明
    public static FTask<Scene> CreateSubScene(Scene parentScene, int sceneType, Action<Scene, Scene> onSubSceneComplete)
    参数
    类型 名称 描述
    Scene parentScene

    主Scene的实例

    int sceneType

    SceneType,可以在SceneType里找到,例如:SceneType.Addressable

    Action<Scene, Scene> onSubSceneComplete

    子Scene创建成功后执行的委托,可以传递null

    返回
    类型 描述
    FTask<Scene>
    | 编辑本文 查看源代码

    Dispose()

    Scene销毁方法,执行了该方法会把当前Scene下的所有实体都销毁掉。

    声明
    public override void Dispose()
    重写
    Entity.Dispose()
    | 编辑本文 查看源代码

    GetEntity(long)

    根据RunTimeId查询一个实体

    声明
    public Entity GetEntity(long runTimeId)
    参数
    类型 名称 描述
    long runTimeId

    实体的RunTimeId

    返回
    类型 描述
    Entity

    返回的实体

    | 编辑本文 查看源代码

    GetEntity<T>(long)

    根据RunTimeId查询一个实体

    声明
    public T GetEntity<T>(long runTimeId) where T : Entity
    参数
    类型 名称 描述
    long runTimeId

    实体的RunTimeId

    返回
    类型 描述
    T

    返回的实体

    类型参数
    名称 描述
    T

    要查询实体的泛型类型

    | 编辑本文 查看源代码

    GetSession(long)

    根据runTimeId获得Session

    声明
    public Session GetSession(long runTimeId)
    参数
    类型 名称 描述
    long runTimeId
    返回
    类型 描述
    Session
    异常
    类型 条件
    Exception
    | 编辑本文 查看源代码

    RemoveEntity(Entity)

    删除一个实体,仅是删除不会指定实体的销毁方法

    声明
    public bool RemoveEntity(Entity entity)
    参数
    类型 名称 描述
    Entity entity

    实体实例

    返回
    类型 描述
    bool

    返回一个bool值来提示是否删除了这个实体

    | 编辑本文 查看源代码

    RemoveEntity(long)

    删除一个实体,仅是删除不会指定实体的销毁方法

    声明
    public bool RemoveEntity(long runTimeId)
    参数
    类型 名称 描述
    long runTimeId

    实体的RunTimeId

    返回
    类型 描述
    bool

    返回一个bool值来提示是否删除了这个实体

    | 编辑本文 查看源代码

    TryGetEntity(long, out Entity)

    根据RunTimeId查询一个实体

    声明
    public bool TryGetEntity(long runTimeId, out Entity entity)
    参数
    类型 名称 描述
    long runTimeId

    实体的RunTimeId

    Entity entity

    实体实例

    返回
    类型 描述
    bool

    返回一个bool值来提示是否查找到这个实体

    | 编辑本文 查看源代码

    TryGetEntity<T>(long, out T)

    根据RunTimeId查询一个实体

    声明
    public bool TryGetEntity<T>(long runTimeId, out T entity) where T : Entity
    参数
    类型 名称 描述
    long runTimeId

    实体的RunTimeId

    T entity

    实体实例

    返回
    类型 描述
    bool

    返回一个bool值来提示是否查找到这个实体

    类型参数
    名称 描述
    T

    要查询实体的泛型类型

    实现

    IEntity
    IDisposable
    IPool

    扩展方法

    JsonHelper.ToJson<T>(T)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX