Skip to content

Commit d6f0622

Browse files
committed
initial support for Unity 6.3
1 parent b8fc8f0 commit d6f0622

18 files changed

Lines changed: 1243 additions & 533 deletions

3rdparty/ExCSS.Unity.dll

247 KB
Binary file not shown.

3rdparty/ExCSS.Unity.dll.meta

Lines changed: 15 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc Assets/UI Assets/Panel Settings.asset

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ MonoBehaviour:
1212
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
1313
m_Name: Panel Settings
1414
m_EditorClassIdentifier:
15-
themeUss: {fileID: -4733365628477956816, guid: 7f4b69a09aa4dc9409800e41bd40d6cd, type: 3}
15+
themeUss: {fileID: -4733365628477956816, guid: 60354c5667877d740be9555e34dbf9ca, type: 3}
1616
m_DisableNoThemeWarning: 0
1717
m_TargetTexture: {fileID: 0}
1818
m_RenderMode: 0
19-
m_WorldSpaceLayer: 0
19+
m_ColliderUpdateMode: 0
20+
m_ColliderIsTrigger: 1
2021
m_ScaleMode: 0
2122
m_ReferenceSpritePixelsPerUnit: 100
2223
m_PixelsPerUnit: 100
@@ -33,14 +34,19 @@ MonoBehaviour:
3334
m_ClearColor: 0
3435
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
3536
m_VertexBudget: 0
37+
m_TextureSlotCount: 8
3638
m_DynamicAtlasSettings:
3739
m_MinAtlasSize: 64
3840
m_MaxAtlasSize: 4096
3941
m_MaxSubTextureSize: 64
4042
m_ActiveFilters: -1
4143
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
42-
m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
43-
m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0}
44+
m_DefaultShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
45+
m_RuntimeGaussianBlurShader: {fileID: 20300, guid: 0000000000000000f000000000000000, type: 0}
46+
m_RuntimeColorEffectShader: {fileID: 20301, guid: 0000000000000000f000000000000000, type: 0}
47+
m_SDFShader: {fileID: 19011, guid: 0000000000000000f000000000000000, type: 0}
48+
m_BitmapShader: {fileID: 9001, guid: 0000000000000000f000000000000000, type: 0}
49+
m_SpriteShader: {fileID: 19012, guid: 0000000000000000f000000000000000, type: 0}
4450
m_ICUDataAsset: {fileID: 0}
4551
forceGammaRendering: 0
4652
textSettings: {fileID: 0}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
@import url("unity-theme://default");
1+
@import url("unity-theme://default");
2+
VisualElement {}

Misc Assets/UI Assets/UnityThemes/UnityDefaultRuntimeTheme.tss.meta

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/CustomStyleSheets/CSSSpec.cs

Lines changed: 83 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,114 @@
33

44
namespace OneJS.CustomStyleSheets {
55
public static class CSSSpec {
6-
private static readonly Regex rgx =
7-
new Regex(
8-
"(?<id>#[-]?\\w[\\w-]*)|(?<class>\\.[\\w-]+)|(?<pseudoclass>:[\\w-]+(\\((?<param>.+)\\))?)|(?<type>[^\\-]\\w+)|(?<wildcard>\\*)|\\s+",
9-
RegexOptions.IgnoreCase | RegexOptions.Compiled);
10-
private const int typeSelectorWeight = 1;
11-
private const int classSelectorWeight = 10;
12-
private const int idSelectorWeight = 100;
13-
146
public static int GetSelectorSpecificity(string selector) {
15-
int selectorSpecificity = 0;
7+
int result = 0;
168
StyleSelectorPart[] parts;
17-
if (CSSSpec.ParseSelector(selector, out parts))
18-
selectorSpecificity = CSSSpec.GetSelectorSpecificity(parts);
19-
return selectorSpecificity;
9+
bool flag = CSSSpec.ParseSelector(selector, out parts);
10+
if (flag) {
11+
result = CSSSpec.GetSelectorSpecificity(parts);
12+
}
13+
return result;
2014
}
2115

16+
// Token: 0x06003A6B RID: 14955 RVA: 0x000E4930 File Offset: 0x000E2B30
2217
public static int GetSelectorSpecificity(StyleSelectorPart[] parts) {
23-
int selectorSpecificity = 1;
24-
for (int index = 0; index < parts.Length; ++index) {
25-
switch (parts[index].type) {
18+
int num = 1;
19+
for (int i = 0; i < parts.Length; i++) {
20+
switch (parts[i].type) {
2621
case StyleSelectorType.Type:
27-
++selectorSpecificity;
22+
num++;
2823
break;
2924
case StyleSelectorType.Class:
3025
case StyleSelectorType.PseudoClass:
31-
selectorSpecificity += 10;
26+
num += 10;
3227
break;
3328
case StyleSelectorType.RecursivePseudoClass:
3429
throw new ArgumentException("Recursive pseudo classes are not supported");
3530
case StyleSelectorType.ID:
36-
selectorSpecificity += 100;
31+
num += 100;
3732
break;
3833
}
3934
}
40-
return selectorSpecificity;
35+
return num;
36+
}
37+
38+
// Token: 0x06003A6C RID: 14956 RVA: 0x000E49AC File Offset: 0x000E2BAC
39+
public static bool ValidateSelector(string selector) {
40+
return CSSSpec.rgx.Matches(selector).Count > 0;
4141
}
4242

43+
// Token: 0x06003A6D RID: 14957 RVA: 0x000E49D4 File Offset: 0x000E2BD4
4344
public static bool ParseSelector(string selector, out StyleSelectorPart[] parts) {
4445
MatchCollection matchCollection = CSSSpec.rgx.Matches(selector);
4546
int count = matchCollection.Count;
46-
if (count < 1) {
47-
parts = (StyleSelectorPart[])null;
48-
return false;
49-
}
50-
parts = new StyleSelectorPart[count];
51-
for (int i = 0; i < count; ++i) {
52-
Match match = matchCollection[i];
53-
StyleSelectorType styleSelectorType = StyleSelectorType.Unknown;
54-
string str1 = string.Empty;
55-
if (!string.IsNullOrEmpty(match.Groups["wildcard"].Value)) {
56-
str1 = "*";
57-
styleSelectorType = StyleSelectorType.Wildcard;
58-
} else if (!string.IsNullOrEmpty(match.Groups["id"].Value)) {
59-
str1 = match.Groups["id"].Value.Substring(1);
60-
styleSelectorType = StyleSelectorType.ID;
61-
} else if (!string.IsNullOrEmpty(match.Groups["class"].Value)) {
62-
str1 = match.Groups["class"].Value.Substring(1);
63-
styleSelectorType = StyleSelectorType.Class;
64-
} else if (!string.IsNullOrEmpty(match.Groups["pseudoclass"].Value)) {
65-
string str2 = match.Groups["param"].Value;
66-
if (!string.IsNullOrEmpty(str2)) {
67-
str1 = str2;
68-
styleSelectorType = StyleSelectorType.RecursivePseudoClass;
47+
bool flag = count < 1;
48+
bool result;
49+
if (flag) {
50+
parts = null;
51+
result = false;
52+
} else {
53+
parts = new StyleSelectorPart[count];
54+
for (int i = 0; i < count; i++) {
55+
Match match = matchCollection[i];
56+
StyleSelectorType type = StyleSelectorType.Unknown;
57+
string value = string.Empty;
58+
bool flag2 = !string.IsNullOrEmpty(match.Groups["wildcard"].Value);
59+
if (flag2) {
60+
value = "*";
61+
type = StyleSelectorType.Wildcard;
6962
} else {
70-
str1 = match.Groups["pseudoclass"].Value.Substring(1);
71-
styleSelectorType = StyleSelectorType.PseudoClass;
63+
bool flag3 = !string.IsNullOrEmpty(match.Groups["id"].Value);
64+
if (flag3) {
65+
value = match.Groups["id"].Value.Substring(1);
66+
type = StyleSelectorType.ID;
67+
} else {
68+
bool flag4 = !string.IsNullOrEmpty(match.Groups["class"].Value);
69+
if (flag4) {
70+
value = match.Groups["class"].Value.Substring(1);
71+
type = StyleSelectorType.Class;
72+
} else {
73+
bool flag5 = !string.IsNullOrEmpty(match.Groups["pseudoclass"].Value);
74+
if (flag5) {
75+
string value2 = match.Groups["param"].Value;
76+
bool flag6 = !string.IsNullOrEmpty(value2);
77+
if (flag6) {
78+
value = value2;
79+
type = StyleSelectorType.RecursivePseudoClass;
80+
} else {
81+
value = match.Groups["pseudoclass"].Value.Substring(1);
82+
type = StyleSelectorType.PseudoClass;
83+
}
84+
} else {
85+
bool flag7 = !string.IsNullOrEmpty(match.Groups["type"].Value);
86+
if (flag7) {
87+
value = match.Groups["type"].Value;
88+
type = StyleSelectorType.Type;
89+
}
90+
}
91+
}
92+
}
7293
}
73-
} else if (!string.IsNullOrEmpty(match.Groups["type"].Value)) {
74-
str1 = match.Groups["type"].Value;
75-
styleSelectorType = StyleSelectorType.Type;
94+
parts[i] = new StyleSelectorPart {
95+
type = type,
96+
value = value
97+
};
7698
}
77-
parts[i] = new StyleSelectorPart() {
78-
type = styleSelectorType,
79-
value = str1
80-
};
99+
result = true;
81100
}
82-
return true;
101+
return result;
83102
}
103+
104+
// Token: 0x04001D3E RID: 7486
105+
private static readonly Regex rgx = new Regex("(?<id>#[-]?\\w[\\w-]*)|(?<class>\\.[\\w-]+)|(?<pseudoclass>:[\\w-]+(\\((?<param>.+)\\))?)|(?<type>([^\\-]\\w+|\\w+))|(?<wildcard>\\*)|\\s+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
106+
107+
// Token: 0x04001D3F RID: 7487
108+
private const int typeSelectorWeight = 1;
109+
110+
// Token: 0x04001D40 RID: 7488
111+
private const int classSelectorWeight = 10;
112+
113+
// Token: 0x04001D41 RID: 7489
114+
private const int idSelectorWeight = 100;
84115
}
85116
}

0 commit comments

Comments
 (0)