Ejemplo n.º 1
0
        public void LoadNearbyOres()
        {
            var nearbyObjects = MatrixManager.GetAdjacent <ObjectBehaviour>(registerObject.WorldPosition, true);

            foreach (var objectBehaviour in nearbyObjects)
            {
                var item = objectBehaviour.gameObject;
                if (Validations.HasItemTrait(item, CommonTraits.Instance.OreGeneral))
                {
                    AddOre(item);
                }
                else
                {
                    var oreBox = item.GetComponent <OreBox>();
                    if (oreBox != null)
                    {
                        var itemStorage  = oreBox.GetComponent <ItemStorage>();
                        var itemSlotList = itemStorage.GetItemSlots();
                        foreach (var itemSlot in itemSlotList)
                        {
                            if (itemSlot.IsEmpty)
                            {
                                continue;
                            }
                            AddOre(itemSlot.ItemObject);
                        }
                    }
                }
            }

            UpdateLaborPointsUI();
        }
Ejemplo n.º 2
0
        public void OnSpawnServer(SpawnInfo info)
        {
            scanner    = null;
            cloningPod = null;
            consoleGUI = null;
            //TODO: Support persistance of this info somewhere, such as to a circuit board.
            //scan for adjacent dna scanner and cloning pod
            scanner    = MatrixManager.GetAdjacent <DNAScanner>(registerTile.WorldPositionServer, true).FirstOrDefault();
            cloningPod = MatrixManager.GetAdjacent <CloningPod>(registerTile.WorldPositionServer, true).FirstOrDefault();

            if (cloningPod)
            {
                cloningPod.console = this;
            }
        }