public void ApplyGeneralItem(PickingGeneral item)
    {
        if (item == null)
        {
            this.gameObject.SetActive(false);
            return;
        }
        if (Faceid != null)
        {
            Faceid.spriteName = "map" + item.nLevel.ToString();            //map Image
            //Faceid.width=142;
            //Faceid.height=100;
            //Faceid.MakePixelPerfect();
        }

        if (PrettyNameCol != null)
        {
            PrettyNameCol.text = item.name;              //  map Name
        }
        if (PrettyLevelCol != null)
        {
            PrettyLevelCol.text = "Level " + item.nLevel.ToString();
        }
        if (GameManager.TankLevel >= item.nLevel)
        {
            lockSprite.gameObject.SetActive(false);
        }
    }
    void LateUpdate()
    {
        if (hasChanged == true)
        {
            hasChanged = false;

            PickingGeneral item = PickingGeneralManager.instance.GetItem(m_id);
            ApplyGeneralItem(item);
        }
    }
Exemple #3
0
    public void ApplyHireGeneral()
    {
        mGenerals.Clear();
        string[] maplist = { "map1", "map2", "map3", "map4", "map5", "map6", "map7", "map8", "map9", "map10", "map11" };
        int      cn      = 0;

        foreach (string mapName in maplist)
        {
            cn = cn + 1;
            PickingGeneral item = new PickingGeneral();
            item.nLevel = cn;
            item.name   = mapName;
            item.campIn = false;

            mGenerals.Add(item);
        }
    }