예제 #1
0
    private void setToInv(inventory inv)
    {
        print("setting to inv: " + inv);
        int curCount = 0;

        foreach (ressources res in System.Enum.GetValues(typeof(ressources)))
        {
            var amount = inv.getAmount(res);
            displaysExt[curCount].transform.GetChild(1).GetComponent <Text>().text = amount.ToString();
            curCount++;
        }
    }
예제 #2
0
    /*public void removeOrdered(HPHandler.ressourceStack stack) {
     *  foreach(HPHandler.ressourceStack elem in ordered) {
     *      if(elem.Equals(stack)) {
     *          ordered.Remove(elem);
     *          missing.Add(elem);
     *      }
     *  }
     *
     * }*/


    private void reloadMissing()
    {
        missing.Clear();
        var iterateList = Info.getCost();

        if (overrideCost != null)
        {
            iterateList = overrideCost;
        }

        foreach (ressourceStack stack in iterateList)
        {
            inventory      inv          = this.GetComponent <inventory>();
            ressourceStack stillMissing = stack;
            stillMissing.addAmount(-inv.getAmount(stack.getRessource()));
            missing.Add(stillMissing);
        }
    }
예제 #3
0
        public override void update(float availUran)
        {
            if (!inited)
            {
                init();
            }

            if (invController.getAmount(ressources.Uranium) > 0.2)
            {
                this.invController.add(new ressourceStack(-0.1f * Time.deltaTime, ressources.Uranium));
                this.temperature += 10f * Time.deltaTime * (generateMultiplier);
            }

            base.update(availUran);

            if (this.temperature > 2000)
            {
                this.gameObject.GetComponent <HPHandler>().HP -= 50 * Time.deltaTime;
            }
        }