Esempio n. 1
0
        internal override void onFocus(Action focusAction, Direction d)
        {
            TVBehaviour v = findNexTVBehaviour(d);

            TVSystem.getInstance().changeFocus(d, v);
            base.onFocus(focusAction, d);
        }
Esempio n. 2
0
 public void setInitTvView(TVBehaviour t = null)
 {
     currentItem = t == null ? currentItem : t;
     if (currentItem != null)
     {
         setAllUnFocus();
         currentItem.focus(true);
     }
 }
Esempio n. 3
0
 public void changeFocus(Direction d, TVBehaviour nextF)
 {
     currentItem.onLeaveFocus(() => {
         currentItem.focus(false);
     });
     currentItem = nextF;
     nextF.onFocus(() => {
         nextF.focus(true);
     }, d);
 }
Esempio n. 4
0
 public TVBehaviour getByDirection(Direction d)
 {
     if (onDirection(d))
     {
         TVBehaviour ans = getNextTVBehaviourByDirection(d);
         if (ans == null)
         {
             return(findCustomTVBehaviour(d));
         }
         else
         {
             return(ans);
         }
     }
     else
     {
         return(null);
     }
 }
Esempio n. 5
0
 private void move(float h, float v)
 {
     if (Mathf.Abs(h) > 0 || Mathf.Abs(v) > 0)
     {
         if (!_moveing)
         {
             _moveing = true;
             Direction   d     = getDirection(h, v);
             TVBehaviour nextF = currentItem.getByDirection(d);
             if (nextF != null)
             {
                 changeFocus(d, nextF);
             }
         }
     }
     else
     {
         _moveing = false;
     }
 }