コード例 #1
0
        private void Connect()
        {
            if (connected)
            {
                return;
            }
            LogicCircuitManager logicCircuitManager = Game.Instance.logicCircuitManager;
            UtilityNetworkManager <LogicCircuitNetwork, LogicWire> logicCircuitSystem = Game.Instance.logicCircuitSystem;

            connected = true;
            int outputCellOne = OutputCellOne;

            logicCircuitSystem.AddToNetworks(outputCellOne, this, true);
            outputOne = new LogicPortVisualizer(outputCellOne, LogicPortSpriteType.RibbonOutput);
            logicCircuitManager.AddVisElem(outputOne);
            int inputCellOne = InputCellOne;

            logicCircuitSystem.AddToNetworks(inputCellOne, inputOne, true);
            logicCircuitManager.AddVisElem((ILogicUIElement)inputOne);
            if (RequiresTwoInputs)
            {
                int inputCellTwo = InputCellTwo;
                logicCircuitSystem.AddToNetworks(inputCellTwo, inputTwo, true);
                logicCircuitManager.AddVisElem((ILogicUIElement)inputTwo);
            }
            RefreshAnimation();
        }
コード例 #2
0
 private void Connect()
 {
     if (!connected)
     {
         LogicCircuitManager logicCircuitManager = Game.Instance.logicCircuitManager;
         UtilityNetworkManager <LogicCircuitNetwork, LogicWire> logicCircuitSystem = Game.Instance.logicCircuitSystem;
         connected = true;
         int outputCell = base.OutputCell;
         logicCircuitSystem.AddToNetworks(outputCell, this, true);
         output = new LogicPortVisualizer(outputCell, LogicPortSpriteType.Output);
         logicCircuitManager.AddVisElem(output);
         int inputCellOne = base.InputCellOne;
         logicCircuitSystem.AddToNetworks(inputCellOne, inputOne, true);
         logicCircuitManager.AddVisElem(inputOne);
         if (base.RequiresTwoInputs)
         {
             int inputCellTwo = base.InputCellTwo;
             logicCircuitSystem.AddToNetworks(inputCellTwo, inputTwo, true);
             logicCircuitManager.AddVisElem(inputTwo);
         }
         RefreshAnimation();
     }
 }