public void InitCreature(CCreatureDetail creature)
    {
        _wealthIcon.gameObject.SetActive(false);
        _itemIcon.gameObject.SetActive(false);

        foreach (Transform tr in _creatureIcon.GetComponentsInChildren <Transform>(true))
        {
            tr.gameObject.SetActive(true);
        }

        int iCreatureTID = CDATA_CREATURE_NEWVER.Get(creature.kCreatureID).m_iCreatureTID;

        _creatureIcon.SetIcon(iCreatureTID, enCreatureIcon_Type.GuildRaidReward);

        //_wealthParent.SetActive(false);
        //_itemParent.SetActive(false);

        //foreach (Transform tr in _creatureParent.GetComponentsInChildren<Transform>(true))
        //{
        //    tr.gameObject.SetActive(true);
        //}

        //int iCreatureTID = CDATA_CREATURE_NEWVER.Get(creature.kCreatureID).m_iCreatureTID;
        //DATA_CREATURE_NEWVER CreatureTable = UtilFunc.GetCreatureDataByTID(iCreatureTID);

        //_creatureSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_ICON_CREATUREHEAD, CreatureTable.m_szIcon);
        //_creatureGradeSprite.spriteName = string.Format("{0}{1}", "comm_thumbnailStar0", CreatureTable.m_iGrade);
        //_creatureClassSprite.spriteName = string.Format("{0}{1}", "UI_", CreatureTable.m_enCreatureArmy.ToString());

        //_IconNameLabel.text = StringTableManager.GetData(CreatureTable.iCreatureName);
    }
Beispiel #2
0
    //===================================================================================
    //
    // Default Method
    //
    //===================================================================================

    //===================================================================================
    //
    // Method
    //
    //===================================================================================
    public void Init(CCreatureDetail creatureData)
    {
        _enCardType = enCardType.Creature;

        _CreatureCardParent.SetActive(true);
        _ItemCardParent.SetActive(false);

        _CreatureIcon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, _CreatureCardParent.transform, "CreatureIcon");
        _CreatureIcon.SetIcon(creatureData.kCreatureKey, enCreatureIcon_Type.Shop);
        _CreatureIcon.RemoveBoxCollider();
        _CreatureIcon.RemoveDragScrollView();

        // default layer is 0
        Transform[] tran = _CreatureIcon.GetComponentsInChildren <Transform>(true);
        foreach (Transform t in tran)
        {
            t.gameObject.layer = 0;
        }

        _CreatureIcon.gameObject.SetActive(true);
    }