public void Clear() { _life.Clear(); _blockUpdateCanceller.Cancel(); _blockUpdateQueue?.Dispose(); _meshBuilder?.Clear(); _filter.sharedMesh?.ForSelf(Destroy); _filter.sharedMesh = null; }
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) { } }
public void ResetDamage() { _meshBuilder.Clear(); _mesh.Clear(); }