public void unregister(WsTask task, int token) { int num = Mathf.Clamp(token / this.GridSize, 0, this.GridSize - 1); int num2 = Mathf.Clamp(token - num * this.GridSize, 0, this.GridSize - 1); this.schedulers[num, num2].Unregister(task); }
public static void RegisterOneShot(WsTask task) { if (WorkScheduler.Instance != null) { WorkScheduler.Instance.registerOneShot(task); } }
public static void UnregisterGlobal(WsTask task) { if (WorkScheduler.Instance != null) { WorkScheduler.Instance.unregisterGlobal(task); } }
public static void Unregister(WsTask task, int token) { if (WorkScheduler.Instance != null) { WorkScheduler.Instance.unregister(task, token); } }
public void Register(WsTask task, bool force = false) { if (force || !this.tasks.Contains(task)) { this.tasks.Add(task); } }
public int register(WsTask task, Vector3 position, bool force) { int num = Mathf.Clamp(this.WorldToGridX(position.x), 0, this.GridSize - 1); int num2 = Mathf.Clamp(this.WorldToGridY(position.z), 0, this.GridSize - 1); this.schedulers[num, num2].Register(task, force); return(num * this.GridSize + num2); }
public void Unregister(WsTask task) { if (this.tasks.Count > 0) { int num = this.tasks.LastIndexOf(task); if (num >= 0) { this.tasks.RemoveAt(num); } } }
public void registerOneShot(WsTask task) { this.oneShotScheduler.Register(task, true); }
public void unregisterGlobal(WsTask task) { this.globalScheduler.Unregister(task); }
public static void RegisterGlobal(WsTask task, bool force = false) { WorkScheduler.CheckConfig(); WorkScheduler.Instance.registerGlobal(task, force); }
public void registerGlobal(WsTask task, bool force) { this.globalScheduler.Register(task, force); }
public static int Register(WsTask task, Vector3 position, bool force = false) { WorkScheduler.CheckConfig(); return(WorkScheduler.Instance.register(task, position, force)); }
public bool Contains(WsTask task) { return(this.tasks.Contains(task)); }