Beispiel #1
0
    CSUI_BuildingIcon _createIcons(CSElectric cse)
    {
        CSUI_BuildingIcon bi = Instantiate(m_Supply.m_IconPrefab) as CSUI_BuildingIcon;

        bi.transform.parent        = m_Supply.m_Root.transform;
        bi.transform.localPosition = Vector3.zero;
        bi.transform.localRotation = Quaternion.identity;
        bi.transform.localScale    = Vector3.one;

        string[] iconStr = ItemProto.GetIconName(cse.ItemID);
        if (iconStr.Length != 0)
        {
            bi.IconName = iconStr[0];
        }
        else
        {
            bi.IconName = "";
        }
        bi.Description = cse.Name;

        m_Icons.Add(bi);

        return(bi);
    }