Example #1
0
        public override void OnMapLoaded()
        {
            InitializeLinks();

            Wire wire = item.GetComponent <Wire>();

            if (wire != null)
            {
                wire.Locked = true;
                wire.Hidden = true;
                if (wire.Connections.Contains(null))
                {
                    wire.Drop(null);
                }
            }

            if (!item.linkedTo.Any())
            {
                return;
            }

            List <MapEntity> linked = new List <MapEntity>(item.linkedTo);

            foreach (MapEntity entity in linked)
            {
                if (!(entity is Item linkedItem))
                {
                    continue;
                }

                var dockingPort = linkedItem.GetComponent <DockingPort>();
                if (dockingPort != null)
                {
                    Dock(dockingPort);
                }
            }
        }