private void evolve(SpecializationType type)
        {
            foreach (GameObject bee in EntityManager.Instance.Bees)
            {
                if (bee.tag == "WorkerBee" && bee.GetComponent <Selectable>().IsSelected)
                {
                    var spec = bee.GetComponent <Stats>();
                    if (spec.Spec.Type != SpecializationType.None)
                    {
                        continue;
                    }

                    if (UIController.Instance.resourceManager.RequireResources(Costs.Get("Spec" + type)))
                    {
                        spec.Specialize(type);
                        UIController.Instance.resourceManager.RemoveResources(Costs.Get("Spec" + type));
                        UIController.Instance.SetBeeLoadText(bee);
                    }
                    else
                    {
                        TextController.Instance.Add("Not enough resource to evolve into " + type + "!");
                    }
                    UIController.Instance.SetBottomPanel(UIController.BPType.Text);
                }
            }
        }
Beispiel #2
0
        private void growBee(string beeType)
        {
            var sel = EntityManager.Instance.Larvae.Where(x => x.GetComponent <Selectable>().IsSelected);

            foreach (var larvaObj in sel)
            {
                if (!UIController.Instance.resourceManager.RequireResources(Costs.Get(beeType)))
                {
                    TextController.Instance.Add("Not enough resources to evolve into " + beeType + "!");
                    return;
                }
                UIController.Instance.resourceManager.RemoveResources(Costs.Get(beeType));
                larvaObj.GetComponent <Larva>().StartGrowing(beeType);
            }
        }
Beispiel #3
0
        private string parseSpecial(Match m)
        {
            string txt = m.ToString();

            switch (txt[1])
            {
            case 'r':
                if (txt.Length > 4)
                {
                    return(Costs.Get(txt.Substring(2, txt.Length - 3)).ToString());
                }
                break;

            case 'n':
                return("\r\n");
            }
            return(txt);
        }