FindSelectableOnDown() public method

public FindSelectableOnDown ( ) : Selectable
return Selectable
コード例 #1
0
 private Selectable Next(Selectable current)
 {
     switch (Direction)
     {
         case DirectionEnum.UpDown:
             return current.FindSelectableOnDown();
         case DirectionEnum.LeftRight:
             return current.FindSelectableOnRight();
     }
     return current.FindSelectableOnDown();
 }
コード例 #2
0
 static public int FindSelectableOnDown(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.Selectable self = (UnityEngine.UI.Selectable)checkSelf(l);
         var ret = self.FindSelectableOnDown();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #3
0
 static int FindSelectableOnDown(IntPtr L)
 {
     L.ChkArgsCount(1);
     UnityEngine.UI.Selectable obj = (UnityEngine.UI.Selectable)L.ChkUnityObjectSelf(1, "UnityEngine.UI.Selectable");
     UnityEngine.UI.Selectable o   = obj.FindSelectableOnDown();
     L.PushLightUserData(o);
     return(1);
 }
コード例 #4
0
 static int FindSelectableOnDown(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 1);
     UnityEngine.UI.Selectable obj = (UnityEngine.UI.Selectable)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.Selectable");
     UnityEngine.UI.Selectable o   = obj.FindSelectableOnDown();
     LuaScriptMgr.Push(L, o);
     return(1);
 }
コード例 #5
0
 static public int FindSelectableOnDown(IntPtr l)
 {
     try {
         UnityEngine.UI.Selectable self = (UnityEngine.UI.Selectable)checkSelf(l);
         var ret = self.FindSelectableOnDown();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #6
0
	static public int FindSelectableOnDown(IntPtr l) {
		try {
			UnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);
			var ret=self.FindSelectableOnDown();
			pushValue(l,ret);
			return 1;
		}
		catch(Exception e) {
			LuaDLL.luaL_error(l, e.ToString());
			return 0;
		}
	}
コード例 #7
0
 static int QPYX_FindSelectableOnDown_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         UnityEngine.UI.Selectable QPYX_obj_YXQP = (UnityEngine.UI.Selectable)ToLua.CheckObject <UnityEngine.UI.Selectable>(L_YXQP, 1);
         UnityEngine.UI.Selectable QPYX_o_YXQP   = QPYX_obj_YXQP.FindSelectableOnDown();
         ToLua.Push(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
コード例 #8
0
 static int FindSelectableOnDown(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.UI.Selectable obj = (UnityEngine.UI.Selectable)ToLua.CheckObject(L, 1, typeof(UnityEngine.UI.Selectable));
         UnityEngine.UI.Selectable o   = obj.FindSelectableOnDown();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #9
0
ファイル: pb_GUIUtility.cs プロジェクト: procore3d/giles
		/**
		 * Get the next selectable to the right, or if null, the next selectable down and left-most.
		 */
		public static Selectable GetNextSelectable(Selectable current)
		{
			if(current == null)
				return null;

			Selectable next = current.FindSelectableOnRight();

			if(next != null)
			{
				return next;
			}
			else
			{
				next = current.FindSelectableOnDown();

				if(next == null)
					return null;

				Selectable left = next;

				while(next != null)
				{
					left = left.FindSelectableOnLeft();

					if(left == null)
						return next;

					next = left;
				}
			}

			return null;
		}
コード例 #10
0
        private static void DrawNavigationForSelectable(Selectable sel)
        {
            if (sel == null)
                return;

            Transform transform = sel.transform;
            bool active = Selection.transforms.Any(e => e == transform);
            Handles.color = new Color(1.0f, 0.9f, 0.1f, active ? 1.0f : 0.4f);
            DrawNavigationArrow(-Vector2.right, sel, sel.FindSelectableOnLeft());
            DrawNavigationArrow(Vector2.right, sel, sel.FindSelectableOnRight());
            DrawNavigationArrow(Vector2.up, sel, sel.FindSelectableOnUp());
            DrawNavigationArrow(-Vector2.up, sel, sel.FindSelectableOnDown());
        }
コード例 #11
0
    /// <summary>
    /// Shows a specific panel.
    /// </summary>
    /// <param name="panelName"> The requested panel name.</param>
    public void ShowPanel(String panelName)
    {
        currentSelected = null;
        GameObject currentPanel = transform.FindChild (panelName).gameObject;
        currentPanel.SetActive (true);
        foreach (Transform t in currentPanel.transform)
        {
            // Activate the game panel.
            t.gameObject.SetActive(true);

            // Find any selectable object.
            if (currentSelected == null)
            {
                currentSelected = t.gameObject.GetComponent<Selectable>();
            }
        }

        lowestSelectable = currentSelected;
        highestSelectable = currentSelected;

        while (lowestSelectable.FindSelectableOnDown() != null)
        {
            lowestSelectable = lowestSelectable.FindSelectableOnDown();
        }
        while (highestSelectable.FindSelectableOnUp() != null)
        {
            highestSelectable = highestSelectable.FindSelectableOnUp();
        }

        currentSelected = highestSelectable;

        // This is necessary to refresh the selected game object if the same was already selected.
        if (eventSystem.currentSelectedGameObject == highestSelectable.gameObject)
        {
            eventSystem.SetSelectedGameObject (lowestSelectable.gameObject);
        }
        eventSystem.SetSelectedGameObject (highestSelectable.gameObject);

        // This is necessary to reopen any cute menu elements that are not option panels.
        foreach (Transform t in gameObject.transform)
        {
            if (!(t.gameObject.name.ToLower().Contains("panel")))
            {
                t.gameObject.SetActive(true);
            }
        }
    }
コード例 #12
0
 private static void DrawNavigationForSelectable(Selectable sel)
 {
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   SelectableEditor.\u003CDrawNavigationForSelectable\u003Ec__AnonStorey1 selectableCAnonStorey1 = new SelectableEditor.\u003CDrawNavigationForSelectable\u003Ec__AnonStorey1();
   if ((UnityEngine.Object) sel == (UnityEngine.Object) null)
     return;
   // ISSUE: reference to a compiler-generated field
   selectableCAnonStorey1.transform = sel.transform;
   // ISSUE: reference to a compiler-generated method
   Handles.color = new Color(1f, 0.9f, 0.1f, !((IEnumerable<Transform>) Selection.transforms).Any<Transform>(new Func<Transform, bool>(selectableCAnonStorey1.\u003C\u003Em__0)) ? 0.4f : 1f);
   SelectableEditor.DrawNavigationArrow(-Vector2.right, sel, sel.FindSelectableOnLeft());
   SelectableEditor.DrawNavigationArrow(Vector2.right, sel, sel.FindSelectableOnRight());
   SelectableEditor.DrawNavigationArrow(Vector2.up, sel, sel.FindSelectableOnUp());
   SelectableEditor.DrawNavigationArrow(-Vector2.up, sel, sel.FindSelectableOnDown());
 }