Пример #1
0
    void AddWordListItem(WordDefinition definition, string displayWord, int count)
    {
        if (wordListItemPrefab == null)
        {
            Debug.Log("DetailPanelDehaviour: missin wordListItemPrefab");
            return;
        }

        displayWord = StringOperation.ToFirstUpper(displayWord) + " (" + definition.partOfSpeech + ".)";

        Debug.Log(displayWord);

        GameObject newItem = Instantiate(wordListItemPrefab, wordListItemContainer.transform);

        newItem.transform.localScale = Vector3.one;
        newItem.transform.Find(PANEL_WORD_LIST_ITEM_DEFINITION).GetComponent <Text>().text = definition.definition;
        Transform upperPart = newItem.transform.Find(PANEL_WORD_LIST_ITEM_UPPER_PART);

        upperPart.Find(PANEL_WORD_LIST_ITEM_UPPER_PART_WORD).GetComponent <Text>().text  = displayWord;
        upperPart.Find(PANEL_WORD_LIST_ITEM_UPPER_PART_COUNT).GetComponent <Text>().text = "x" + count;
    }
    public static void ConfigAbility(AbilityConfig config)
    {
        AbilityName abilityName = (AbilityName)System.Enum.Parse(typeof(AbilityName), StringOperation.ToFirstUpper(config.abilityName));

        if (!abilities.ContainsKey(abilityName))
        {
            Debug.Log("ability " + abilityName + " does not exist");
            return;
        }

        AbilityBehaviour ability = abilities[abilityName];

        ability.abilityEnabled = config.enabled;
        ability.isChargeMode   = config.isChargeMode;
        ability.chargeCount    = config.chargeCount;
    }
    void AddWordItem(string word, int count, GameObject parent)
    {
        GameObject newItem = Instantiate(remainingWordItemPrefab, parent.transform);

        newItem.transform.Find(REMAINING_WORD_ITEM_WORD).GetComponent <Text>().text  = StringOperation.ToFirstUpper(word);
        newItem.transform.Find(REMAINING_WORD_ITEM_COUNT).GetComponent <Text>().text = "x" + count;
        newItem.transform.localScale = Vector3.one;

        remainingWords[word.ToUpper()] = newItem;
    }