public void disClickedBtn() { if(PlayerPrefs.HasKey("card_sort")){ type_ = (EZCardSort.Type)(PlayerPrefs.GetInt("card_sort")); } switch(type_){ case EZCardSort.Type.Lv: btn_ = _lv; break; case EZCardSort.Type.Quality: btn_ = _qua; break; case EZCardSort.Type.MagicType: btn_ = _pro; break; case EZCardSort.Type.Attack: btn_ = _attack; break; case EZCardSort.Type.Speed: btn_ = _speed; break; case EZCardSort.Type.MaxHealth: btn_ = _hp; break; } btn_.isChecked = true; }
public void disClickedBtn() { if (PlayerPrefs.HasKey("card_sort")) { type_ = (EZCardSort.Type)(PlayerPrefs.GetInt("card_sort")); } switch (type_) { case EZCardSort.Type.Lv: btn_ = _lv; break; case EZCardSort.Type.Quality: btn_ = _qua; break; case EZCardSort.Type.MagicType: btn_ = _pro; break; case EZCardSort.Type.Attack: btn_ = _attack; break; case EZCardSort.Type.Speed: btn_ = _speed; break; case EZCardSort.Type.MaxHealth: btn_ = _hp; break; } btn_.isChecked = true; }
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(); }
public void Awake() { if (PlayerPrefs.HasKey("card_sort")) { type_ = (EZCardSort.Type)(PlayerPrefs.GetInt("card_sort")); } sort(type_); }
public void Awake() { if(PlayerPrefs.HasKey("card_sort")){ type_ = (EZCardSort.Type)(PlayerPrefs.GetInt("card_sort")); } sort(type_); }
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(); }
private void setBtnByType(EZCardSort.Type type) { string name = ""; switch (type) { case EZCardSort.Type.Lv: name = "bagLv"; break; case EZCardSort.Type.Quality: name = "bagQua"; break; case EZCardSort.Type.MagicType: name = "bagPro"; break; case EZCardSort.Type.Attack: name = "bagAttack"; break; case EZCardSort.Type.Speed: name = "bagSpeed"; break; case EZCardSort.Type.MaxHealth: name = "bagHP"; break; } GameObject target = GameObject.FindGameObjectWithTag("InfoView"); if (target) { target.SendMessage("setbtnSortBg", name, SendMessageOptions.DontRequireReceiver); } }