Esempio n. 1
0
 public Game()
 {
     globalComps            = new ComponentRegistry();
     tickings               = new RemovalSafeList <ITicking>();
     controllerEnterMessage = new Message <IGameController>();
     controllerExitMessage  = new Message <IGameController>();
 }
Esempio n. 2
0
 public AutoController(Game game)
 {
     this.game       = game;
     this.aList      = new ActivatableList();
     this.dList      = new DisposableList();
     this.sceneComps = new ComponentRegistry();
 }
Esempio n. 3
0
        public static ComponentJanitor NewAndActivate(object component, ComponentRegistry coll, int key)
        {
            ComponentJanitor okd = new ComponentJanitor(component, coll, key);

            okd.Active = true;
            return(okd);
        }
Esempio n. 4
0
 public ComponentJanitor(object component, ComponentRegistry registry, int key)
 {
     UnityEngine.Debug.Assert(component != null, "Component is null");
     UnityEngine.Debug.Assert(registry != null, "Registry is null");
     this.component = component;
     this.reg       = registry;
     this.key       = key;
 }
Esempio n. 5
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }
            this.Active   = false;
            this.disposed = true;
            IDisposable d = component as IDisposable;

            if (d != null)
            {
                d.Dispose();
            }
            component = null;
            reg       = null;
            key       = -1;
        }