public void ClearTiles() { int num; int num1; int num2; for (int i = 0; i < this.clearTileList.Count; i++) { this.desc.TileOffsetToXYOffset(this.clearTileList[i], out num, out num1, out num2); int num3 = Mathf.Min(num + this.desc.tileSize, this.desc.size) - num; int num4 = Mathf.Min(num1 + this.desc.tileSize, this.desc.size) - num1; if (!this.owner.useNativePath) { for (int j = 0; j < num4; j++) { Array.Clear(this.pixels, num2, num3); num2 += this.desc.size; } } else { WaterDynamics.RasterClearTile_Native(ref this.pixels[0], num2, this.desc.size, num3, num4); } } }
private void Unregister() { if (this.Image != null) { WaterDynamics.UnregisterInteraction(this); this.Image = null; } }
private void Unregister() { if (this.Image == null) { return; } WaterDynamics.UnregisterInteraction(this); this.Image = (WaterDynamics.Image)null; }
private bool SupportsNativePath() { bool flag = true; try { WaterDynamics.ImageDesc imageDesc = new WaterDynamics.ImageDesc(); byte[] numArray = new byte[1]; WaterDynamics.RasterBindImage_Native(ref imageDesc, ref numArray[0]); } catch (EntryPointNotFoundException entryPointNotFoundException) { Debug.Log("[WaterDynamics] Fast native path not available. Reverting to managed fallback."); flag = false; } return(flag); }
public void ClearTiles() { for (int index1 = 0; index1 < this.clearTileList.Count; ++index1) { int x; int y; int offset; int xyOffset = (int)this.desc.TileOffsetToXYOffset(this.clearTileList[index1], out x, out y, out offset); int num = Mathf.Min(x + this.desc.tileSize, this.desc.size) - x; int height = Mathf.Min(y + this.desc.tileSize, this.desc.size) - y; if (this.owner.useNativePath) { WaterDynamics.RasterClearTile_Native(ref this.pixels[0], offset, this.desc.size, num, height); } else { for (int index2 = 0; index2 < height; ++index2) { Array.Clear((Array)this.pixels, offset, num); offset += this.desc.size; } } } }
private void Register() { this.UpdateImage(); WaterDynamics.RegisterInteraction(this); }
public Target(WaterDynamics owner, Vector3 areaPosition, Vector3 areaSize) { this.owner = owner; this.desc = new WaterDynamics.TargetDesc(areaPosition, areaSize); }