Example #1
0
    void Update()
    {
        CalculateScore();

        //Add new agents
        int slump = Random.Range(0, 100);

        //Debug.Log(BlackBoard.Instance.GetAgentsInClan(clan) + " " + BlackBoard.Instance.GetPopulationCap(clan) + " " + BlackBoard.Instance.GetScore(clan) + " " + slump);
        if ((BlackBoard.Instance.GetAgentsInClan(clan) < BlackBoard.Instance.GetPopulationCap(clan)) && (BlackBoard.Instance.GetScore(clan) > 100) && (slump < 80))
        {
            BlackBoard.Instance.UpdateScore(clan, "Created Agent");
            //TODO: fix so that the supremecommander can more units of same color that is currently in the tribe
            StartCoroutine(unitCommander.AddAgent(clan.Substring(0, clan.Length - 5)));
        }

        //Create new buildings
        if (BlackBoard.Instance.GetTaskTree(clan).GetLeafs().Count == 0)
        {
            AddNewGoals();
        }
    }