Пример #1
0
        public void Clear()
        {
            _life.Clear();
            _blockUpdateCanceller.Cancel();
            _blockUpdateQueue?.Dispose();
            _meshBuilder?.Clear();

            _filter.sharedMesh?.ForSelf(Destroy);
            _filter.sharedMesh = null;
        }
Пример #2
0
        void UpdateBlockQuads()         // Executed in a worker thread
        {
            try
            {
                // cancel the ongoing update
                _blockUpdateCanceller.Cancel();

                CancellationToken token = _blockUpdateCanceller.Token;

                // Clear previous mesh data
                _meshBuilder.Clear();

                // Update mesh data with current quads
                foreach ((Quad quad, byte block) in _quadBuilder.Build(token))
                {
                    _meshBuilder.Add(quad, block);

                    token.ThrowIfCancellationRequested();
                }
            }
            catch (OperationCanceledException)
            {
            }
        }
Пример #3
0
 public void ResetDamage()
 {
     _meshBuilder.Clear();
     _mesh.Clear();
 }