public void CascateSell(GearFile file) { for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { if (!(y == 0 && x == 0) && !(y == 1 && x == 1) && (x == 0 || y == 0)) { Vector2 pos = new Vector2(x + file.x, y + file.y); Gear gear = GetGearByPos(pos); if (gear != null) { if (!CheckTileIsOverAdd(pos)) { gear.Sell(); } } gear = null; } } } }
public virtual void SetFile(GearFile newFile) { file = newFile; UpdateTransform(); }