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

            okd.Active = true;
            return(okd);
        }
示例#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;
 }
示例#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;
        }