예제 #1
0
    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);
            }
        }
    }
예제 #2
0
 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);
     }
 }