public override void MakeTriggerAction(AbsorptionGraph.GraphNode node, AbsorptionGraph graph) { // Debug.Log($"Make trigger action on transistor (input {InputType}, output {OutputType})!"); foreach (AbsorptionGraph.GraphNode nextNode in node.connectionsTo) { if (CanAbsorp(nextNode.shape)) { TileMapCell cell = TileMap.Instance.GetCellWithShape(nextNode.shape); if (cell != null) { cell.RemoveShape(); } } } SetAbsorbed(); }
public bool DropShape(Shape shape) { // get underlying tile TileMapCell cell = GetTileUnderMouse(); if (cell != null) { if (cell.DropHere(shape)) // drop successful { ShapesProducer.Instance.FreeShape(shape); CheckoutShapeTriggers(); CreateNextShapeSet(); return(true); } else { return(false); } } else { return(false); } }