Example #1
0
    private void Start()
    {
        Dictionary <string, string[]> categoryElements = TextGenerator.FetchCategories(rawCardData.text);

        InstantiateTemplates(categoryElements);
        timeHandler.OnTimeChanged.AddListener(TestSpawnProbability);
    }
Example #2
0
    private string ComputeRandomName()
    {
        Dictionary <string, string[]> categoryElements = TextGenerator.FetchCategories(nameData.text);
        string template = TextGenerator.PickRandom("template", categoryElements);

        return(TextGenerator.Format(template, ingredients));
    }
Example #3
0
    protected override void InstantiateTemplates(Dictionary <string, string[]> categoryElements)
    {
        Dictionary <string, string[]> nameCategoryElements = TextGenerator.FetchCategories(rawNameData.text);

        string[] templates = categoryElements["template"];

        for (int i = 0; i < templates.Length; i++)
        {
            PostData newData = CreatePost(templates[i], categoryElements, nameCategoryElements);
            data.Add(newData);
        }

        foreach (PostData postData in data)
        {
            if (postData.Code == "00")
            {
                AddData(postData);
            }
        }
    }