void OnDrawGizmosSelected() { if (enable && smokeManager != null) { Vector3 gizmoSize = ((Vector3)size) / smokeManager.gridScale; Vector3Int gridPos = smokeManager.worldToGridPos(transform.position); Gizmos.DrawWireCube(smokeManager.gridToWorldPos(gridPos, true), gizmoSize); } }
void OnDrawGizmosSelected() { if (!enable || smokeManager == null) { return; } Vector3 gizmoSize = new Vector3(wallThickness, smokeManager.size.y, smokeManager.size.z) / smokeManager.gridScale; Vector3Int gridPos = new Vector3Int(smokeManager.worldToGridPos(transform.position).x, smokeManager.size.y / 2, smokeManager.size.z / 2); Vector3 windowSize = new Vector3(wallThickness, (int)((1f - wallAboveWindow - wallBelowWindow) * smokeManager.size.y), (int)((1f - wallLeftToWindow - wallRightToWindow) * smokeManager.size.z)) / smokeManager.gridScale; Vector3Int windowPos = gridPos + new Vector3Int(0, Mathf.RoundToInt((wallAboveWindow / 2f - wallBelowWindow / 2f) * smokeManager.size.y), Mathf.RoundToInt((wallRightToWindow / 2f - wallLeftToWindow / 2f) * smokeManager.size.z)); Gizmos.DrawWireCube(smokeManager.gridToWorldPos(gridPos, true), gizmoSize); Gizmos.DrawWireCube(smokeManager.gridToWorldPos(windowPos, true), windowSize); }