Example #1
0
    public void sort(EZCardSort.Type type)
    {
        type_ = type;
        IComparer<Transform> comparer = null;
        switch(type){
        case EZCardSort.Type.Lv:
            comparer = new LvComparer();
            break;
        case EZCardSort.Type.Quality:
            comparer = new QualityComparer();
            break;
        case EZCardSort.Type.MagicType:
            comparer = new MagicTypeComparer();
            break;
        case EZCardSort.Type.Attack:
            comparer = new AttackComparer();
            break;
        case EZCardSort.Type.Speed:
            comparer = new SpeedComparer();
            break;
        case EZCardSort.Type.MaxHealth:
            comparer = new MaxHealthComparer();
            break;

        }

        _table.comparer = comparer;
        _table.repositionNow = true;

        setBtnByType(type);
        PlayerPrefs.SetInt("card_sort", (int)(type_));
        PlayerPrefs.Save();
    }
Example #2
0
    public void sort(EZCardSort.Type type)
    {
        type_ = type;
        IComparer <Transform> comparer = null;

        switch (type)
        {
        case EZCardSort.Type.Lv:
            comparer = new LvComparer();
            break;

        case EZCardSort.Type.Quality:
            comparer = new QualityComparer();
            break;

        case EZCardSort.Type.MagicType:
            comparer = new MagicTypeComparer();
            break;

        case EZCardSort.Type.Attack:
            comparer = new AttackComparer();
            break;

        case EZCardSort.Type.Speed:
            comparer = new SpeedComparer();
            break;

        case EZCardSort.Type.MaxHealth:
            comparer = new MaxHealthComparer();
            break;
        }

        _table.comparer      = comparer;
        _table.repositionNow = true;

        setBtnByType(type);
        PlayerPrefs.SetInt("card_sort", (int)(type_));
        PlayerPrefs.Save();
    }