예제 #1
0
        public AGSBorderComponent(IRenderPipeline pipeline)
        {
            _pipeline = pipeline;
            var backPool  = new ObjectPool <BorderBackInstruction>(pool => new BorderBackInstruction(pool), 2);
            var frontPool = new ObjectPool <BorderFrontInstruction>(pool => new BorderFrontInstruction(pool), 2);

            _back  = new BorderBack(this, backPool);
            _front = new BorderFront(this, frontPool);
        }
예제 #2
0
        public override void Dispose()
        {
            var entity = Entity;

            if (entity != null)
            {
                _pipeline.Unsubscribe(entity.ID, _back);
                _pipeline.Unsubscribe(entity.ID, _front);
            }
            _back?.Dispose();
            _front?.Dispose();
            _back  = null;
            _front = null;
            base.Dispose();
        }