gg.easy.airship 0.1.2206 → 0.1.2207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Runtime/Code/AirshipConst.cs +1 -0
- package/Runtime/Code/Bundles/SystemRoot.cs +0 -3
- package/Runtime/Code/CoreUI/Components/AirshipVersionOverlay.cs +2 -0
- package/Runtime/Code/CoreUI/CoreLoadingScreen.prefab +85 -16
- package/Runtime/Code/CoreUI/MainMenu/MainMenuLoadingScreen.prefab +3 -3
- package/Runtime/Code/Luau/ReflectionList.cs +2 -0
- package/Runtime/Code/TSCodeGen/TypeGenerator.cs +3 -0
- package/Runtime/Code/UI/UIOutline.cs +57 -29
- package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
- package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
- package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
- package/package.json +1 -1
|
@@ -507,9 +507,6 @@ public class SystemRoot : Singleton<SystemRoot> {
|
|
|
507
507
|
|
|
508
508
|
files.Remove(br.m_path);
|
|
509
509
|
files.Add(br.m_path, br);
|
|
510
|
-
#if AIRSHIP_STAGING
|
|
511
|
-
Debug.Log($"Added shared lua file {br.m_path}");
|
|
512
|
-
#endif
|
|
513
510
|
}
|
|
514
511
|
|
|
515
512
|
public static string GetLoadedAssetBundleKey(AirshipPackage package, string assetBundleFile) {
|
|
@@ -199,7 +199,7 @@ MonoBehaviour:
|
|
|
199
199
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
200
200
|
m_Name:
|
|
201
201
|
m_EditorClassIdentifier:
|
|
202
|
-
m_Material: {fileID:
|
|
202
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
203
203
|
m_Color: {r: 0.1764706, g: 0.1764706, b: 0.1764706, a: 1}
|
|
204
204
|
m_RaycastTarget: 0
|
|
205
205
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
@@ -303,7 +303,7 @@ MonoBehaviour:
|
|
|
303
303
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
304
304
|
m_Name:
|
|
305
305
|
m_EditorClassIdentifier:
|
|
306
|
-
m_Material: {fileID:
|
|
306
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
307
307
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
308
308
|
m_RaycastTarget: 1
|
|
309
309
|
m_RaycastPadding: {x: -5, y: -5, z: -5, w: -5}
|
|
@@ -902,6 +902,7 @@ RectTransform:
|
|
|
902
902
|
m_LocalScale: {x: 0.92927, y: 0.92927, z: 0.92927}
|
|
903
903
|
m_ConstrainProportionsScale: 1
|
|
904
904
|
m_Children:
|
|
905
|
+
- {fileID: 3150721537713762228}
|
|
905
906
|
- {fileID: 4779218538534976006}
|
|
906
907
|
- {fileID: 119913748507233629}
|
|
907
908
|
- {fileID: 1580868800969815117}
|
|
@@ -935,16 +936,16 @@ MonoBehaviour:
|
|
|
935
936
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
936
937
|
m_Name:
|
|
937
938
|
m_EditorClassIdentifier:
|
|
938
|
-
m_Material: {fileID:
|
|
939
|
-
m_Color: {r: 0.
|
|
939
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
940
|
+
m_Color: {r: 0.15686275, g: 0.17254902, b: 0.22352941, a: 1}
|
|
940
941
|
m_RaycastTarget: 0
|
|
941
942
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
942
943
|
m_Maskable: 0
|
|
943
944
|
m_OnCullStateChanged:
|
|
944
945
|
m_PersistentCalls:
|
|
945
946
|
m_Calls: []
|
|
946
|
-
m_Sprite: {fileID:
|
|
947
|
-
m_Type:
|
|
947
|
+
m_Sprite: {fileID: 0}
|
|
948
|
+
m_Type: 0
|
|
948
949
|
m_PreserveAspect: 0
|
|
949
950
|
m_FillCenter: 1
|
|
950
951
|
m_FillMethod: 4
|
|
@@ -965,7 +966,7 @@ MonoBehaviour:
|
|
|
965
966
|
m_Script: {fileID: 11500000, guid: ec18a89aa0caf4669ae44f413c827581, type: 3}
|
|
966
967
|
m_Name:
|
|
967
968
|
m_EditorClassIdentifier:
|
|
968
|
-
radius:
|
|
969
|
+
radius: 10
|
|
969
970
|
image: {fileID: 6904609107978231724}
|
|
970
971
|
--- !u!1 &4572541668520597265
|
|
971
972
|
GameObject:
|
|
@@ -1612,7 +1613,7 @@ MonoBehaviour:
|
|
|
1612
1613
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
1613
1614
|
m_Name:
|
|
1614
1615
|
m_EditorClassIdentifier:
|
|
1615
|
-
m_Material: {fileID:
|
|
1616
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
1616
1617
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
1617
1618
|
m_RaycastTarget: 1
|
|
1618
1619
|
m_RaycastPadding: {x: -5, y: -5, z: -5, w: -5}
|
|
@@ -1758,7 +1759,7 @@ MonoBehaviour:
|
|
|
1758
1759
|
m_Name:
|
|
1759
1760
|
m_EditorClassIdentifier:
|
|
1760
1761
|
m_Material: {fileID: 0}
|
|
1761
|
-
m_Color: {r: 0.
|
|
1762
|
+
m_Color: {r: 0.07058824, g: 0.078431375, b: 0.101960786, a: 1}
|
|
1762
1763
|
m_RaycastTarget: 1
|
|
1763
1764
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
1764
1765
|
m_Maskable: 1
|
|
@@ -1836,7 +1837,7 @@ MonoBehaviour:
|
|
|
1836
1837
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
1837
1838
|
m_Name:
|
|
1838
1839
|
m_EditorClassIdentifier:
|
|
1839
|
-
m_Material: {fileID:
|
|
1840
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
1840
1841
|
m_Color: {r: 0.74074405, g: 0.751691, b: 0.7735849, a: 1}
|
|
1841
1842
|
m_RaycastTarget: 1
|
|
1842
1843
|
m_RaycastPadding: {x: -5, y: -5, z: -5, w: -5}
|
|
@@ -2113,6 +2114,74 @@ MonoBehaviour:
|
|
|
2113
2114
|
m_hasFontAssetChanged: 0
|
|
2114
2115
|
m_baseMaterial: {fileID: 0}
|
|
2115
2116
|
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
|
2117
|
+
--- !u!1 &6635855963037703408
|
|
2118
|
+
GameObject:
|
|
2119
|
+
m_ObjectHideFlags: 0
|
|
2120
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
2121
|
+
m_PrefabInstance: {fileID: 0}
|
|
2122
|
+
m_PrefabAsset: {fileID: 0}
|
|
2123
|
+
serializedVersion: 6
|
|
2124
|
+
m_Component:
|
|
2125
|
+
- component: {fileID: 3150721537713762228}
|
|
2126
|
+
- component: {fileID: 3185627290722957685}
|
|
2127
|
+
- component: {fileID: 5690351040481940385}
|
|
2128
|
+
m_Layer: 5
|
|
2129
|
+
m_Name: Outline
|
|
2130
|
+
m_TagString: Untagged
|
|
2131
|
+
m_Icon: {fileID: 0}
|
|
2132
|
+
m_NavMeshLayer: 0
|
|
2133
|
+
m_StaticEditorFlags: 0
|
|
2134
|
+
m_IsActive: 1
|
|
2135
|
+
--- !u!224 &3150721537713762228
|
|
2136
|
+
RectTransform:
|
|
2137
|
+
m_ObjectHideFlags: 0
|
|
2138
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
2139
|
+
m_PrefabInstance: {fileID: 0}
|
|
2140
|
+
m_PrefabAsset: {fileID: 0}
|
|
2141
|
+
m_GameObject: {fileID: 6635855963037703408}
|
|
2142
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
2143
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
2144
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
2145
|
+
m_ConstrainProportionsScale: 0
|
|
2146
|
+
m_Children: []
|
|
2147
|
+
m_Father: {fileID: 2046571341396879633}
|
|
2148
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
2149
|
+
m_AnchorMin: {x: 0, y: 0}
|
|
2150
|
+
m_AnchorMax: {x: 1, y: 1}
|
|
2151
|
+
m_AnchoredPosition: {x: 0, y: 0}
|
|
2152
|
+
m_SizeDelta: {x: 0, y: 0}
|
|
2153
|
+
m_Pivot: {x: 0.5, y: 0.5}
|
|
2154
|
+
--- !u!222 &3185627290722957685
|
|
2155
|
+
CanvasRenderer:
|
|
2156
|
+
m_ObjectHideFlags: 0
|
|
2157
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
2158
|
+
m_PrefabInstance: {fileID: 0}
|
|
2159
|
+
m_PrefabAsset: {fileID: 0}
|
|
2160
|
+
m_GameObject: {fileID: 6635855963037703408}
|
|
2161
|
+
m_CullTransparentMesh: 1
|
|
2162
|
+
--- !u!114 &5690351040481940385
|
|
2163
|
+
MonoBehaviour:
|
|
2164
|
+
m_ObjectHideFlags: 0
|
|
2165
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
2166
|
+
m_PrefabInstance: {fileID: 0}
|
|
2167
|
+
m_PrefabAsset: {fileID: 0}
|
|
2168
|
+
m_GameObject: {fileID: 6635855963037703408}
|
|
2169
|
+
m_Enabled: 1
|
|
2170
|
+
m_EditorHideFlags: 0
|
|
2171
|
+
m_Script: {fileID: 11500000, guid: c280d1ddc7af1a04e8f71ea529d0c27f, type: 3}
|
|
2172
|
+
m_Name:
|
|
2173
|
+
m_EditorClassIdentifier:
|
|
2174
|
+
m_Material: {fileID: 0}
|
|
2175
|
+
m_Color: {r: 1, g: 1, b: 1, a: 0.050980393}
|
|
2176
|
+
m_RaycastTarget: 1
|
|
2177
|
+
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
2178
|
+
m_Texture: {fileID: 0}
|
|
2179
|
+
_outlineWidth: 2
|
|
2180
|
+
_cornerRadius: 10
|
|
2181
|
+
_cornerSegments: 18
|
|
2182
|
+
_mappingBias: 0.5
|
|
2183
|
+
_slightlyThickerCorners: 0
|
|
2184
|
+
_fillCenter: 0
|
|
2116
2185
|
--- !u!1 &6903882144118719595
|
|
2117
2186
|
GameObject:
|
|
2118
2187
|
m_ObjectHideFlags: 0
|
|
@@ -2416,7 +2485,7 @@ MonoBehaviour:
|
|
|
2416
2485
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
2417
2486
|
m_Name:
|
|
2418
2487
|
m_EditorClassIdentifier:
|
|
2419
|
-
m_Material: {fileID:
|
|
2488
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
2420
2489
|
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
|
2421
2490
|
m_RaycastTarget: 1
|
|
2422
2491
|
m_RaycastPadding: {x: -5, y: -5, z: -5, w: -5}
|
|
@@ -2685,7 +2754,7 @@ MonoBehaviour:
|
|
|
2685
2754
|
m_PrefabInstance: {fileID: 0}
|
|
2686
2755
|
m_PrefabAsset: {fileID: 0}
|
|
2687
2756
|
m_GameObject: {fileID: 7631553834785869233}
|
|
2688
|
-
m_Enabled:
|
|
2757
|
+
m_Enabled: 0
|
|
2689
2758
|
m_EditorHideFlags: 0
|
|
2690
2759
|
m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3}
|
|
2691
2760
|
m_Name:
|
|
@@ -2768,7 +2837,7 @@ MonoBehaviour:
|
|
|
2768
2837
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
2769
2838
|
m_Name:
|
|
2770
2839
|
m_EditorClassIdentifier:
|
|
2771
|
-
m_Material: {fileID:
|
|
2840
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
2772
2841
|
m_Color: {r: 1, g: 0.9607843, b: 0.9607843, a: 1}
|
|
2773
2842
|
m_RaycastTarget: 0
|
|
2774
2843
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
@@ -2858,7 +2927,7 @@ MonoBehaviour:
|
|
|
2858
2927
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
2859
2928
|
m_Name:
|
|
2860
2929
|
m_EditorClassIdentifier:
|
|
2861
|
-
m_Material: {fileID:
|
|
2930
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
2862
2931
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
|
2863
2932
|
m_RaycastTarget: 0
|
|
2864
2933
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
@@ -2950,7 +3019,7 @@ MonoBehaviour:
|
|
|
2950
3019
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
2951
3020
|
m_Name:
|
|
2952
3021
|
m_EditorClassIdentifier:
|
|
2953
|
-
m_Material: {fileID:
|
|
3022
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
2954
3023
|
m_Color: {r: 0.21698111, g: 0.21698111, b: 0.21698111, a: 1}
|
|
2955
3024
|
m_RaycastTarget: 1
|
|
2956
3025
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
@@ -3297,7 +3366,7 @@ PrefabInstance:
|
|
|
3297
3366
|
- target: {fileID: 8404357530465985221, guid: f4a774ea871d94897b410c2210fd5105, type: 3}
|
|
3298
3367
|
propertyPath: m_Material
|
|
3299
3368
|
value:
|
|
3300
|
-
objectReference: {fileID:
|
|
3369
|
+
objectReference: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
3301
3370
|
m_RemovedComponents: []
|
|
3302
3371
|
m_RemovedGameObjects: []
|
|
3303
3372
|
m_AddedGameObjects: []
|
|
@@ -907,7 +907,7 @@ MonoBehaviour:
|
|
|
907
907
|
m_Name:
|
|
908
908
|
m_EditorClassIdentifier:
|
|
909
909
|
m_Material: {fileID: 0}
|
|
910
|
-
m_Color: {r: 0.
|
|
910
|
+
m_Color: {r: 0.07058824, g: 0.078431375, b: 0.101960786, a: 1}
|
|
911
911
|
m_RaycastTarget: 1
|
|
912
912
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
913
913
|
m_Maskable: 1
|
|
@@ -1252,7 +1252,7 @@ MonoBehaviour:
|
|
|
1252
1252
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
|
1253
1253
|
m_Name:
|
|
1254
1254
|
m_EditorClassIdentifier:
|
|
1255
|
-
m_Material: {fileID:
|
|
1255
|
+
m_Material: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
1256
1256
|
m_Color: {r: 1, g: 0.9607843, b: 0.9607843, a: 1}
|
|
1257
1257
|
m_RaycastTarget: 0
|
|
1258
1258
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
|
@@ -1519,7 +1519,7 @@ PrefabInstance:
|
|
|
1519
1519
|
- target: {fileID: 8404357530465985221, guid: f4a774ea871d94897b410c2210fd5105, type: 3}
|
|
1520
1520
|
propertyPath: m_Material
|
|
1521
1521
|
value:
|
|
1522
|
-
objectReference: {fileID:
|
|
1522
|
+
objectReference: {fileID: 2100000, guid: 517dcfc7bf08549efa5108b97eb2e6cc, type: 2}
|
|
1523
1523
|
m_RemovedComponents: []
|
|
1524
1524
|
m_RemovedGameObjects: []
|
|
1525
1525
|
m_AddedGameObjects: []
|
|
@@ -21,6 +21,7 @@ using UnityEngine.UIElements;
|
|
|
21
21
|
using LightType = UnityEngine.LightType;
|
|
22
22
|
using UnityEngine.Tilemaps;
|
|
23
23
|
using UnityEngine.VFX;
|
|
24
|
+
using UnityEngine.Video;
|
|
24
25
|
using Slider = UnityEngine.UI.Slider;
|
|
25
26
|
|
|
26
27
|
#if UNITY_EDITOR
|
|
@@ -163,6 +164,7 @@ namespace Luau {
|
|
|
163
164
|
[typeof(Text)] = LuauContextAll,
|
|
164
165
|
[typeof(RectMask2D)] = LuauContextAll,
|
|
165
166
|
[typeof(WheelFrictionCurve)] = LuauContextAll,
|
|
167
|
+
[typeof(VideoPlayer)] = LuauContextAll,
|
|
166
168
|
|
|
167
169
|
// Particles
|
|
168
170
|
[typeof(ParticleSystem)] = LuauContextAll,
|
|
@@ -55,6 +55,7 @@ using Code.Voice;
|
|
|
55
55
|
using Unity.Mathematics;
|
|
56
56
|
using UnityEngine.InputSystem;
|
|
57
57
|
using UnityEngine.Splines;
|
|
58
|
+
using UnityEngine.Video;
|
|
58
59
|
using TouchPhase = UnityEngine.TouchPhase;
|
|
59
60
|
|
|
60
61
|
public class TypeGenerator : MonoBehaviour
|
|
@@ -231,6 +232,8 @@ public class TypeGenerator : MonoBehaviour
|
|
|
231
232
|
typeof(UniversalRenderPipelineAsset),
|
|
232
233
|
typeof(WheelFrictionCurve),
|
|
233
234
|
typeof(WheelHit),
|
|
235
|
+
typeof(VideoPlayer),
|
|
236
|
+
typeof(RenderTexture),
|
|
234
237
|
|
|
235
238
|
// Mirror
|
|
236
239
|
typeof(NetworkServer),
|
|
@@ -7,16 +7,16 @@ using UnityEngine.UI;
|
|
|
7
7
|
public class UIOutline : Graphic
|
|
8
8
|
{
|
|
9
9
|
[SerializeField] Texture m_Texture;
|
|
10
|
-
[SerializeField, Range(0f, 500f)] float _outlineWidth =
|
|
11
|
-
[SerializeField, Range(0f, 500f)] float _cornerRadius =
|
|
12
|
-
[SerializeField, Range(1, 20)] int _cornerSegments =
|
|
10
|
+
[SerializeField, Range(0f, 500f)] float _outlineWidth = 1f;
|
|
11
|
+
[SerializeField, Range(0f, 500f)] float _cornerRadius = 10f;
|
|
12
|
+
[SerializeField, Range(1, 20)] int _cornerSegments = 18;
|
|
13
13
|
[SerializeField, Range(0f, 1f)] float _mappingBias = 0.5f;
|
|
14
14
|
[SerializeField, Tooltip("This should be enabled for very thin outlines that won't render well on low res monitors.")]
|
|
15
15
|
bool _slightlyThickerCorners = false;
|
|
16
16
|
[SerializeField] bool _fillCenter;
|
|
17
17
|
|
|
18
|
-
private Vector3[] _corners = new Vector3[4];
|
|
19
|
-
private List<UIVertex> _verts = new List<UIVertex>();
|
|
18
|
+
private readonly Vector3[] _corners = new Vector3[4];
|
|
19
|
+
private readonly List<UIVertex> _verts = new List<UIVertex>();
|
|
20
20
|
|
|
21
21
|
public override Texture mainTexture => m_Texture == null ? s_WhiteTexture : m_Texture;
|
|
22
22
|
|
|
@@ -31,22 +31,38 @@ public class UIOutline : Graphic
|
|
|
31
31
|
{
|
|
32
32
|
vh.Clear();
|
|
33
33
|
|
|
34
|
-
// Clamp corner radius
|
|
35
34
|
var rect = rectTransform.rect;
|
|
36
|
-
var clampedCornerRadius = Mathf.Min((Mathf.Min(rect.width, rect.height) / 2f), _cornerRadius);
|
|
37
35
|
|
|
38
|
-
//
|
|
36
|
+
// Clamp corner radius so arcs make sense
|
|
37
|
+
var clampedCornerRadius = Mathf.Min(Mathf.Min(rect.width, rect.height) * 0.5f, _cornerRadius);
|
|
38
|
+
|
|
39
|
+
// Clamp outline so inner radius doesn't go negative
|
|
40
|
+
var clampedOutlineWidth = Mathf.Min(_outlineWidth, clampedCornerRadius);
|
|
41
|
+
|
|
42
|
+
// For INNER stroke:
|
|
43
|
+
// Outer boundary is the rect itself (rounded).
|
|
44
|
+
// Inner boundary is inset by outline width.
|
|
45
|
+
var outerRadius = clampedCornerRadius;
|
|
46
|
+
var innerRadius = clampedCornerRadius - clampedOutlineWidth;
|
|
47
|
+
|
|
48
|
+
// Get rect corners
|
|
39
49
|
rectTransform.GetLocalCorners(_corners);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_corners[
|
|
43
|
-
_corners[
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
// Move corners to arc centers (inset by outer radius)
|
|
52
|
+
_corners[0] += new Vector3(outerRadius, outerRadius, 0f); // bottom-left
|
|
53
|
+
_corners[1] += new Vector3(outerRadius, -outerRadius, 0f); // top-left
|
|
54
|
+
_corners[2] += new Vector3(-outerRadius, -outerRadius, 0f); // top-right
|
|
55
|
+
_corners[3] += new Vector3(-outerRadius, outerRadius, 0f); // bottom-right
|
|
56
|
+
|
|
57
|
+
// Calculate dimensions along the OUTER boundary (since that's what we draw first)
|
|
58
|
+
var height = (_corners[1].y - _corners[0].y);
|
|
59
|
+
var width = (_corners[2].x - _corners[1].x);
|
|
48
60
|
var edgeLengths = new[] { height, width, height, width };
|
|
49
|
-
|
|
61
|
+
|
|
62
|
+
// Use bias between outer and inner radius for UV mapping around the shape
|
|
63
|
+
var mappedRadius = Mathf.Lerp(innerRadius, outerRadius, _mappingBias);
|
|
64
|
+
var circumference = 2f * Mathf.PI * mappedRadius;
|
|
65
|
+
|
|
50
66
|
var around = height * 2f + width * 2f + circumference;
|
|
51
67
|
var cornerLength = circumference / 4f;
|
|
52
68
|
var segmentLength = cornerLength / _cornerSegments;
|
|
@@ -54,25 +70,33 @@ public class UIOutline : Graphic
|
|
|
54
70
|
var vert = new UIVertex { color = color };
|
|
55
71
|
_verts.Clear();
|
|
56
72
|
|
|
57
|
-
// Create corners
|
|
58
73
|
var u = 0f;
|
|
74
|
+
|
|
59
75
|
for (var c = 0; c < 4; c++)
|
|
60
76
|
{
|
|
61
|
-
// Create verts
|
|
62
77
|
var origin = _corners[c];
|
|
78
|
+
|
|
63
79
|
for (var i = 0; i < _cornerSegments + 1; i++)
|
|
64
80
|
{
|
|
65
|
-
var
|
|
81
|
+
var t = (float)i / _cornerSegments;
|
|
82
|
+
var angle = t * Mathf.PI / 2f + Mathf.PI * 0.5f - Mathf.PI * c * 1.5f;
|
|
66
83
|
var direction = new Vector3(Mathf.Cos(-angle), Mathf.Sin(-angle), 0f);
|
|
67
84
|
|
|
68
|
-
|
|
85
|
+
// OUTER edge (at rect boundary)
|
|
86
|
+
vert.position = origin + direction * outerRadius;
|
|
69
87
|
vert.uv0 = new Vector2(u, 0f);
|
|
70
88
|
_verts.Add(vert);
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
// INNER edge (inset)
|
|
91
|
+
var effectiveOutline = clampedOutlineWidth;
|
|
92
|
+
if (i < _cornerSegments && i > 0 && _slightlyThickerCorners)
|
|
93
|
+
{
|
|
94
|
+
effectiveOutline = Mathf.Min(outerRadius, 1.2f * effectiveOutline);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var effectiveInnerRadius = Mathf.Max(0f, outerRadius - effectiveOutline);
|
|
98
|
+
|
|
99
|
+
vert.position = origin + direction * effectiveInnerRadius;
|
|
76
100
|
vert.uv0 = new Vector2(u, 1f);
|
|
77
101
|
_verts.Add(vert);
|
|
78
102
|
|
|
@@ -84,13 +108,17 @@ public class UIOutline : Graphic
|
|
|
84
108
|
}
|
|
85
109
|
|
|
86
110
|
if (i < _cornerSegments)
|
|
111
|
+
{
|
|
87
112
|
u += segmentLength / around;
|
|
113
|
+
}
|
|
88
114
|
else
|
|
115
|
+
{
|
|
89
116
|
u += edgeLengths[c] / around;
|
|
117
|
+
}
|
|
90
118
|
}
|
|
91
119
|
}
|
|
92
120
|
|
|
93
|
-
//
|
|
121
|
+
// Close the loop (duplicate first outer+inner)
|
|
94
122
|
vert = _verts[0];
|
|
95
123
|
vert.uv0 = new Vector2(1f, 0f);
|
|
96
124
|
_verts.Add(vert);
|
|
@@ -106,11 +134,11 @@ public class UIOutline : Graphic
|
|
|
106
134
|
_verts.Add(vert);
|
|
107
135
|
}
|
|
108
136
|
|
|
109
|
-
// Add verts to VertexHelper
|
|
110
137
|
foreach (var vertex in _verts)
|
|
138
|
+
{
|
|
111
139
|
vh.AddVert(vertex);
|
|
140
|
+
}
|
|
112
141
|
|
|
113
|
-
// Add triangles to VertexHelper
|
|
114
142
|
if (_fillCenter)
|
|
115
143
|
{
|
|
116
144
|
for (var v = 0; v < vh.currentVertCount - 3; v += 3)
|
|
@@ -131,4 +159,4 @@ public class UIOutline : Graphic
|
|
|
131
159
|
}
|
|
132
160
|
}
|
|
133
161
|
}
|
|
134
|
-
}
|
|
162
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|