Ejemplo n.º 1
0
    void SetupIcons()
    {
        int count = 0;

        PlaceCategory[] tempCategories = PlacesRanking.instance.categories;
        tempCategories = tempCategories.OrderBy(c => c.category).ToArray();
        foreach (var item in tempCategories)
        {
            GameObject tempIcon = Instantiate(iconBoxPrefab, transform.position, transform.rotation);
            tempIcon.transform.SetParent(iconsSpawn);
            tempIcon.transform.localScale = tempIcon.transform.lossyScale;
            tempIcon.SetActive(true);
            IconBox tempIconBox = tempIcon.GetComponent <IconBox>();
            tempIconBox.SetupIcon(item.smallIcon, item.id, item.Category.color);
            customIcons.Add(tempIconBox);
            count++;
        }
    }