Exemple #1
0
 public void AddChildJob(Job childJob) {
     if (_childJobStack == null) {
         _childJobStack = new Stack<Job>();
     }
     _childJobStack.Push(childJob);
 }
Exemple #2
0
        public void RemoveChildJob(Job childJob) {
            if (_childJobStack.Contains(childJob)) {
                var childStack = new Stack<Job>(_childJobStack.Count - 1);
                var allCurrentChildren = _childJobStack.ToArray();
                System.Array.Reverse(allCurrentChildren);

                for (var i = 0; i < allCurrentChildren.Length; i++) {
                    var j = allCurrentChildren[i];
                    if (j != childJob)
                        childStack.Push(j);
                }
                // assign the new stack
                _childJobStack = childStack;
            }
        }
Exemple #3
0
 public Job CreateAndAddChildJob(IEnumerator coroutine, Action<bool> jobCompleted = null) {
     var j = new Job(coroutine, false, "ChildJob", jobCompleted: jobCompleted);
     AddChildJob(j);
     return j;
 }