private void OnRecipeElementsFullySelected() { BuildingDef buildingDef = null; foreach (KeyValuePair <BuildingDef, KToggle> activeToggle in ActiveToggles) { if ((UnityEngine.Object)activeToggle.Value == (UnityEngine.Object)currentlySelectedToggle) { buildingDef = activeToggle.Key; break; } } DebugUtil.DevAssert(buildingDef, "def is null"); if ((bool)buildingDef) { if (buildingDef.isKAnimTile && buildingDef.isUtility) { IList <Tag> getSelectedElementAsList = productInfoScreen.materialSelectionPanel.GetSelectedElementAsList; BaseUtilityBuildTool baseUtilityBuildTool = (!((UnityEngine.Object)buildingDef.BuildingComplete.GetComponent <Wire>() != (UnityEngine.Object)null)) ? ((BaseUtilityBuildTool)UtilityBuildTool.Instance) : ((BaseUtilityBuildTool)WireBuildTool.Instance); baseUtilityBuildTool.Activate(buildingDef, getSelectedElementAsList); } else { BuildTool.Instance.Activate(buildingDef, productInfoScreen.materialSelectionPanel.GetSelectedElementAsList, null); } } }
private void OnRecipeElementsFullySelected() { if ((UnityEngine.Object)selectedBuilding == (UnityEngine.Object)null) { Debug.Log("No def!"); } if (selectedBuilding.isKAnimTile && selectedBuilding.isUtility) { IList <Tag> getSelectedElementAsList = productInfoScreen.materialSelectionPanel.GetSelectedElementAsList; BaseUtilityBuildTool baseUtilityBuildTool = (!((UnityEngine.Object)selectedBuilding.BuildingComplete.GetComponent <Wire>() != (UnityEngine.Object)null)) ? ((BaseUtilityBuildTool)UtilityBuildTool.Instance) : ((BaseUtilityBuildTool)WireBuildTool.Instance); baseUtilityBuildTool.Activate(selectedBuilding, getSelectedElementAsList); } else { BuildTool.Instance.Activate(selectedBuilding, productInfoScreen.materialSelectionPanel.GetSelectedElementAsList, null); } }