Beispiel #1
0
 public static void RegisterOneShot(WorkScheduler.Task task)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.registerOneShot(task);
     }
 }
Beispiel #2
0
 public static void UnregisterGlobal(WorkScheduler.Task task)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.unregisterGlobal(task);
     }
 }
Beispiel #3
0
 public static void Unregister(WorkScheduler.Task task, int token)
 {
     if (WorkScheduler.Instance != null)
     {
         WorkScheduler.Instance.unregister(task, token);
     }
 }
Beispiel #4
0
    private void unregister(WorkScheduler.Task 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);
    }
Beispiel #5
0
    private int register(WorkScheduler.Task 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(WorkScheduler.Task task)
    {
        int num = this.tasks.LastIndexOf(task);

        if (num >= 0)
        {
            this.tasks.RemoveAt(num);
        }
    }
 public bool Contains(WorkScheduler.Task task)
 {
     return(this.tasks.Contains(task));
 }
Beispiel #8
0
 private void registerOneShot(WorkScheduler.Task task)
 {
     this.oneShotScheduler.Register(task, true);
 }
Beispiel #9
0
 private void unregisterGlobal(WorkScheduler.Task task)
 {
     this.globalScheduler.Unregister(task);
 }
Beispiel #10
0
 public static void RegisterGlobal(WorkScheduler.Task task, bool force = false)
 {
     WorkScheduler.CheckConfig();
     WorkScheduler.Instance.registerGlobal(task, force);
 }
Beispiel #11
0
 private void registerGlobal(WorkScheduler.Task task, bool force)
 {
     this.globalScheduler.Register(task, force);
 }
Beispiel #12
0
 public static int Register(WorkScheduler.Task task, Vector3 position, bool force = false)
 {
     WorkScheduler.CheckConfig();
     return(WorkScheduler.Instance.register(task, position, force));
 }