Example #1
0
 protected override void OnDragTool(int cell, int distFromOrigin)
 {
     for (int i = 0; i < 39; i++)
     {
         if (IsActiveLayer((ObjectLayer)i))
         {
             GameObject gameObject = Grid.Objects[cell, i];
             if (!((Object)gameObject == (Object)null))
             {
                 EmptyConduitWorkable component = gameObject.GetComponent <EmptyConduitWorkable>();
                 if (!((Object)component == (Object)null))
                 {
                     if (DebugHandler.InstantBuildMode)
                     {
                         component.EmptyPipeContents();
                     }
                     else
                     {
                         component.MarkForEmptying();
                         Prioritizable component2 = gameObject.GetComponent <Prioritizable>();
                         if ((Object)component2 != (Object)null)
                         {
                             component2.SetMasterPriority(ToolMenu.Instance.PriorityScreen.GetLastSelectedPriority());
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
        protected override void OnDragTool(int cell, int distFromOrigin)
        {
            for (int index = 0; index < 40; ++index)
            {
                if (MultiToolParameterMenu.Instance.IsActiveLayer((ObjectLayer)index))
                {
                    GameObject gameObject = Grid.Objects[cell, index];

                    if (gameObject != null)
                    {
                        EmptyConduitWorkable conduitWorkable = gameObject.GetComponent <EmptyConduitWorkable>();

                        if (conduitWorkable != null)
                        {
                            if (DebugHandler.InstantBuildMode)
                            {
                                conduitWorkable.EmptyPipeContents();
                            }

                            else
                            {
                                conduitWorkable.MarkForEmptying();

                                Prioritizable prioritizable = gameObject.GetComponent <Prioritizable>();
                                if (prioritizable != null)
                                {
                                    prioritizable.SetMasterPriority(ToolMenu.Instance.PriorityScreen.GetLastSelectedPriority());
                                }
                            }
                        }
                    }
                }
            }
        }