Example #1
0
    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);
    }
Example #2
0
 public static void RegisterOneShot(WsTask task)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.registerOneShot(task);
     }
 }
Example #3
0
 public static void UnregisterGlobal(WsTask task)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.unregisterGlobal(task);
     }
 }
Example #4
0
 public static void Unregister(WsTask task, int token)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.unregister(task, token);
     }
 }
Example #5
0
 public void Register(WsTask task, bool force = false)
 {
     if (force || !this.tasks.Contains(task))
     {
         this.tasks.Add(task);
     }
 }
Example #6
0
    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);
    }
Example #7
0
 public void Unregister(WsTask task)
 {
     if (this.tasks.Count > 0)
     {
         int num = this.tasks.LastIndexOf(task);
         if (num >= 0)
         {
             this.tasks.RemoveAt(num);
         }
     }
 }
Example #8
0
 public void registerOneShot(WsTask task)
 {
     this.oneShotScheduler.Register(task, true);
 }
Example #9
0
 public void unregisterGlobal(WsTask task)
 {
     this.globalScheduler.Unregister(task);
 }
Example #10
0
 public static void RegisterGlobal(WsTask task, bool force = false)
 {
     WorkScheduler.CheckConfig();
     WorkScheduler.Instance.registerGlobal(task, force);
 }
Example #11
0
 public void registerGlobal(WsTask task, bool force)
 {
     this.globalScheduler.Register(task, force);
 }
Example #12
0
 public static int Register(WsTask task, Vector3 position, bool force = false)
 {
     WorkScheduler.CheckConfig();
     return(WorkScheduler.Instance.register(task, position, force));
 }
Example #13
0
 public bool Contains(WsTask task)
 {
     return(this.tasks.Contains(task));
 }