Beispiel #1
0
 private void FinishServices(Composite composite)
 {
     for (int i = 0; i < _runtimeServices.Count; i++)
         if (_runtimeServices[i].parent == composite)
         {
             if (_runtimeServices[i].subscription != null)
                 _runtimeServices[i].subscription.Dispose();
         }
 }
Beispiel #2
0
 private void InitializeService(Composite composite)
 {
     if (composite.services.Length > 0)
     {
         for (int i = 0; i < composite.services.Length; i++)
         {
             Service sv = composite.services[i];
             RuntimeService rs = new RuntimeService(composite, sv.tick);
             MonoBehaviour comp = GetEqualTypeComponent(sv.targetScript.GetType()) as MonoBehaviour;
             if (comp == null)
             {
                 comp = gameObject.AddComponent(sv.targetScript.GetType()) as MonoBehaviour;
                 IInitializable initializable = comp as IInitializable;
                 initializable.Initialize();
             }
             rs.serviceAction = Delegate.CreateDelegate(typeof(Action), comp, sv.targetMethod) as Action;
             _runtimeServices.Add(rs);
         }
     }
 }
Beispiel #3
0
 private void FinishComposite(Composite composite)
 {
     _currentChildNodeIndex[composite as Node] = 0;
     FinishServices(composite);
 }
Beispiel #4
0
 private void FinishComposite(Composite composite)
 {
     _currentChildNodeIndex[composite as Node] = 0;
     FinishServices(composite);
 }