Example #1
0
    private void CreateCreatureIcon(PvPCreaturesData creatureInfos)
    {
        ClearCreatureIcon();

        for (int i = 0; i < creatureInfos.Count; i++)
        {
            PvPCreatureInfo info = creatureInfos[i];

            CreatureIcon icon  = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, _creatureIconTransforms[i], "CreatureIcon");
            int          Level = info.Level;
            icon.SetIcon(Level, info.forceCount, info.awake, CDATA_CREATURE_NEWVER.Get(info.enID), enCreatureIcon_Type.PvpDetail);
            icon.CreatureKey = info.key;
            icon.RemoveDragScrollView();
            UIEventListener.Get(icon.gameObject).onClick = OnClickIcon;

            _creatureIconList.Add(icon);
        }
    }
Example #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);
    }