Beispiel #1
0
        protected override void OnPrefabInit()
        {
            base.OnPrefabInit();
            //Add an inert input and output port to the building. Inert ports do not automatically perform any behavior such as automatically taking in, outtputing, or filtering. The behavior is expected to be implemented by the Building when
            //using inert ports.
            inputPort  = multiIn.AddInputPortInert(conduitType, inputOffset);
            outputPort = multiOut.AddOutputPortInert(conduitType, outputOffset);
            //We can use input or output port, since they both give us the same manager.
            IConduitFlow conduitFlow = inputPort.GetConduitManager();

            //Buildings such as pipes, bridges, valves, and shutoffs have a default priority, meaning they execute after consumers but before dispensers.
            conduitFlow.AddConduitUpdater(OnConduitTick, ConduitFlowPriority.Default);
        }