Пример #1
0
 // Token: 0x060000F2 RID: 242 RVA: 0x00008FD4 File Offset: 0x000071D4
 public int Compare(string x, string y)
 {
     x = FileUtil2.GetFileName(x);
     y = FileUtil2.GetFileName(y);
     if (string.Compare(x, y, StringComparison.OrdinalIgnoreCase) > 0)
     {
         return(this._greaterResult);
     }
     if (string.Compare(x, y, StringComparison.OrdinalIgnoreCase) < 0)
     {
         return(this._smallerResult);
     }
     return(0);
 }
Пример #2
0
        // Token: 0x06000182 RID: 386 RVA: 0x0000B71C File Offset: 0x0000991C
        public static string GetFileNameWithoutExtension(string assetPath)
        {
            if (string.IsNullOrEmpty(assetPath))
            {
                return("");
            }
            string fileName = FileUtil2.GetFileName(assetPath);
            int    num      = fileName.LastIndexOf('.');

            if (num == -1)
            {
                return(fileName);
            }
            return(fileName.Substring(0, num));
        }
Пример #3
0
        // Token: 0x06000155 RID: 341 RVA: 0x0000A8E0 File Offset: 0x00008AE0
        public static void PathLabel(Rect position, string text, bool selected, Color selectedColor, GUIStyle selectedStyle, Color unselectedColor, GUIStyle unselectedStyle)
        {
            string text2 = text;
            Color  color = GUI.color;

            GUI.color = (selected ? selectedColor : unselectedColor);
            int num = 0;

            for (;;)
            {
                num++;
                if (num >= 5 || EditorStyles.label.CalcSize(GUIContent2.Temp(text)).x <= position.width)
                {
                    goto IL_158;
                }
                text = text.Replace("/.../", "/");
                int num2 = text.LastIndexOf('/');
                if (num2 == -1)
                {
                    break;
                }
                int num3 = text.LastIndexOf('/', num2 - 1);
                if (num3 == -1)
                {
                    break;
                }
                string str  = text.Substring(num2 + 1);
                string str2 = text.Substring(0, num3);
                text = str2 + "/.../" + str;
            }
            text = ".../" + FileUtil2.GetFileName(text2);
            if (EditorStyles.label.CalcSize(GUIContent2.Temp(text)).x > position.width)
            {
                Rect rect = position;
                rect.x         += rect.width - 18f;
                rect.width      = 16f;
                position.width -= rect.width;
                GUI.Label(position, GUIContent2.Temp(text, text2), selected ? selectedStyle : unselectedStyle);
                GUI.Label(rect, GUIContent2.Temp("...", text2), selected ? selectedStyle : unselectedStyle);
                goto IL_179;
            }
            GUI.Label(position, GUIContent2.Temp(text), selected ? selectedStyle : unselectedStyle);
            goto IL_179;
IL_158:
            GUI.Label(position, GUIContent2.Temp(text, (num > 1) ? text2 : ""), selected ? selectedStyle : unselectedStyle);
IL_179:
            GUI.color = color;
        }