Example #1
0
 void ClearSelection()
 {
     if (perkSelected == null)
     {
         return;
     }
     SetToNormal(perkSelected);
     perkSelected = null;
 }
Example #2
0
    public void OnItemButton(GameObject butObj)
    {
        PerkItemUI _item = butObj.GetComponent <PerkItemUI>();

        if (_item == perkSelected)
        {
            return;
        }
        ClearSelection();
        perkSelected = _item;
        SetToSelected(_item);
        UpdateDisplay();
    }
Example #3
0
 protected override void init()
 {
     // init perkList
     itemList = new List <PerkItemUI>();
     for (int i = 0; i < GamePreferences.perkList.Count; i++)
     {
         GameObject _obj  = Utils.Spawn(pfItemObj, scrollViewContent);
         PerkItemUI _item = _obj.GetComponent <PerkItemUI>();
         itemList.Add(_item);
         _item.Init(GamePreferences.perkList[i]);
         _item.SetToNormal();
     }
     //select the first item
     StartCoroutine(SelectFirst());
 }
Example #4
0
 public void SetToNormal(PerkItemUI perkItem)
 {
     perkItem.SetToNormal();
 }
Example #5
0
 public void SetToSelected(PerkItemUI perkItem)
 {
     perkItem.SetToSelected();
     selectHighlightT.position = perkItem.transform.position;
 }