Fantasy
搜索结果

    显示/隐藏目录

    CoroutineLockComponent 类

    协程锁组件

    继承
    object
    Entity
    CoroutineLockComponent
    实现
    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.Async
    程序集: Fantasy.Net.dll
    语法
    public class CoroutineLockComponent : Entity, IEntity, IDisposable, IPool

    方法

    | 编辑本文 查看源代码

    Create(long)

    创建一个新的协程锁 使用这个方法创建的协程锁,需要手动释放管理CoroutineLock。 不会再CoroutineLockComponent理进行管理。

    声明
    public CoroutineLock Create(long coroutineLockType)
    参数
    类型 名称 描述
    long coroutineLockType
    返回
    类型 描述
    CoroutineLock
    | 编辑本文 查看源代码

    Dispose()

    销毁当前实体,销毁后会自动销毁当前实体下的所有实体。

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

    Release(int, long)

    解除一个协程锁。

    声明
    public void Release(int coroutineLockType, long coroutineLockQueueKey)
    参数
    类型 名称 描述
    int coroutineLockType
    long coroutineLockQueueKey
    | 编辑本文 查看源代码

    Wait(long, long, string, int)

    请求一个协程锁。 使用这个方法创建的协程锁,会自动释放CoroutineLockQueueType。

    声明
    public FTask<WaitCoroutineLock> Wait(long coroutineLockType, long coroutineLockQueueKey, string tag = null, int time = 30000)
    参数
    类型 名称 描述
    long coroutineLockType

    锁类型

    long coroutineLockQueueKey

    锁队列Id

    string tag

    当某些锁超时,需要一个标记来方便排查问题,正常的情况下这个默认为null就可以。

    int time

    设置锁的超时时间,让超过设置的时间会触发超时,保证锁不会因为某一个锁一直不解锁导致卡住的问题。

    返回
    类型 描述
    FTask<WaitCoroutineLock>

    返回的WaitCoroutineLock通过Dispose来解除这个锁、建议用using来保住这个锁。 也可以返回的WaitCoroutineLock通过CoroutineLockComponent.UnLock来解除这个锁。

    实现

    IEntity
    IDisposable
    IPool

    扩展方法

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