Beispiel #1
0
 public static Color32 PassAndReturnColor32(Color32 c)
 {
     return(InternalEditorUtility.INTERNAL_CALL_PassAndReturnColor32(ref c));
 }
Beispiel #2
0
        internal static bool RunningUnderWindows8()
        {
            bool orHigher = true;

            return(InternalEditorUtility.RunningUnderWindows8(orHigher));
        }
Beispiel #3
0
 public static Vector2 PassAndReturnVector2(Vector2 v)
 {
     return(InternalEditorUtility.INTERNAL_CALL_PassAndReturnVector2(ref v));
 }
Beispiel #4
0
 public static Bounds TransformBounds(Bounds b, Transform t)
 {
     return(InternalEditorUtility.INTERNAL_CALL_TransformBounds(ref b, t));
 }
Beispiel #5
0
 public static void SetCustomLighting(Light[] lights, Color ambient)
 {
     InternalEditorUtility.INTERNAL_CALL_SetCustomLighting(lights, ref ambient);
 }
Beispiel #6
0
        public static Version GetUnityVersion()
        {
            Version version = new Version(InternalEditorUtility.GetUnityVersionDigits());

            return(new Version(version.Major, version.Minor, version.Build, InternalEditorUtility.GetUnityRevision()));
        }
Beispiel #7
0
 public static Color[] ReadScreenPixel(Vector2 pixelPos, int sizex, int sizey)
 {
     return(InternalEditorUtility.INTERNAL_CALL_ReadScreenPixel(ref pixelPos, sizex, sizey));
 }
Beispiel #8
0
 public static Rect GetBoundsOfDesktopAtPoint(Vector2 pos)
 {
     return(InternalEditorUtility.INTERNAL_CALL_GetBoundsOfDesktopAtPoint(ref pos));
 }
Beispiel #9
0
 public static void SetRectTransformTemporaryRect(RectTransform rectTransform, Rect rect)
 {
     InternalEditorUtility.INTERNAL_CALL_SetRectTransformTemporaryRect(rectTransform, ref rect);
 }
Beispiel #10
0
 public static DragAndDropVisualMode SceneViewDrag(UnityEngine.Object dropUpon, Vector3 worldPosition, Vector2 viewportPosition, bool perform)
 {
     return(InternalEditorUtility.INTERNAL_CALL_SceneViewDrag(dropUpon, ref worldPosition, ref viewportPosition, perform));
 }
Beispiel #11
0
        public static bool IsValidFileName(string filename)
        {
            string text = InternalEditorUtility.RemoveInvalidCharsFromFileName(filename, false);

            return(!(text != filename) && !string.IsNullOrEmpty(text));
        }
Beispiel #12
0
        public static List <int> GetNewSelection(int clickedInstanceID, List <int> allInstanceIDs, List <int> selectedInstanceIDs, int lastClickedInstanceID, bool keepMultiSelection, bool useShiftAsActionKey, bool allowMultiSelection)
        {
            List <int> list  = new List <int>();
            bool       flag  = Event.current.shift || (EditorGUI.actionKey && useShiftAsActionKey);
            bool       flag2 = EditorGUI.actionKey && !useShiftAsActionKey;

            if (!allowMultiSelection)
            {
                flag2 = (flag = false);
            }
            if (flag2)
            {
                list.AddRange(selectedInstanceIDs);
                if (list.Contains(clickedInstanceID))
                {
                    list.Remove(clickedInstanceID);
                }
                else
                {
                    list.Add(clickedInstanceID);
                }
            }
            else
            {
                if (flag)
                {
                    if (clickedInstanceID == lastClickedInstanceID)
                    {
                        return(selectedInstanceIDs);
                    }
                    int num;
                    int num2;
                    if (!InternalEditorUtility.GetFirstAndLastSelected(allInstanceIDs, selectedInstanceIDs, out num, out num2))
                    {
                        list.Add(clickedInstanceID);
                        return(list);
                    }
                    int num3 = -1;
                    int num4 = -1;
                    for (int i = 0; i < allInstanceIDs.Count; i++)
                    {
                        if (allInstanceIDs[i] == clickedInstanceID)
                        {
                            num3 = i;
                        }
                        if (lastClickedInstanceID != 0 && allInstanceIDs[i] == lastClickedInstanceID)
                        {
                            num4 = i;
                        }
                    }
                    int num5 = 0;
                    if (num4 != -1)
                    {
                        num5 = ((num3 <= num4) ? -1 : 1);
                    }
                    int num6;
                    int num7;
                    if (num3 > num2)
                    {
                        num6 = num;
                        num7 = num3;
                    }
                    else
                    {
                        if (num3 >= num && num3 < num2)
                        {
                            if (num5 > 0)
                            {
                                num6 = num3;
                                num7 = num2;
                            }
                            else
                            {
                                num6 = num;
                                num7 = num3;
                            }
                        }
                        else
                        {
                            num6 = num3;
                            num7 = num2;
                        }
                    }
                    for (int j = num6; j <= num7; j++)
                    {
                        list.Add(allInstanceIDs[j]);
                    }
                }
                else
                {
                    if (keepMultiSelection && selectedInstanceIDs.Contains(clickedInstanceID))
                    {
                        list.AddRange(selectedInstanceIDs);
                        return(list);
                    }
                    list.Add(clickedInstanceID);
                }
            }
            return(list);
        }