public override void applyAction(BlockAction action) { UpdatePressure pu = action as UpdatePressure; if (pu != null) { Liquid liq = pu.changed as Liquid; if (liq != null) { float otherPressure = liq.getPressure(); if (liq.getCoordinates().y > coords.y) { otherPressure += liq.density; } } } else { Debug.LogError("Unknown action: " + action); } }
public override bool Equals(object obj) { UpdatePressure o = obj as UpdatePressure; return(o != null && target.Equals(o.target) && changed.Equals(o.changed)); }