Skip to content

Commit 5ef57c5

Browse files
jared-marsauGitHub Enterprise
authored andcommitted
Availability Attributes and Runtime Availability checks. (#3)
Introduces availability checks to Apple.Core. This comes in two parts: Availability attributes and runtime Availability checks. Attributes are used to decorate C# API calls with availability information including the specific versions of each OS that an API was introduced, deprecated, renamed, or obsoleted. Availability checks allow users to wrap blocks of code which call API that may only be available in certain runtimes. By wrapping these code blocks, users can prevent the wrapped code from being called on unsupported OS versions.
1 parent 932a1d0 commit 5ef57c5

22 files changed

+801
-24
lines changed

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# CHANGELOG
22
All notable changes to this project will be documented in this file.
33

4+
## [1.0.4] - 2023-07-25
5+
### Added
6+
- API Availability checking
7+
- Sample to highlight use of new API availability check feature.
8+
- API Availability attributes to communicate API availability information to users and attach availability metadata to Apple Unity plug-in C# API
9+
410
## [1.0.3] - 2022-12-16
511
### Changed
612
- Updated logging in AppleFrameworkUtility

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos.meta

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

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample.meta

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

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scenes.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!29 &1
4+
OcclusionCullingSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 2
7+
m_OcclusionBakeSettings:
8+
smallestOccluder: 5
9+
smallestHole: 0.25
10+
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
13+
--- !u!104 &2
14+
RenderSettings:
15+
m_ObjectHideFlags: 0
16+
serializedVersion: 9
17+
m_Fog: 0
18+
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19+
m_FogMode: 3
20+
m_FogDensity: 0.01
21+
m_LinearFogStart: 0
22+
m_LinearFogEnd: 300
23+
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24+
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25+
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26+
m_AmbientIntensity: 1
27+
m_AmbientMode: 0
28+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29+
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30+
m_HaloStrength: 0.5
31+
m_FlareStrength: 1
32+
m_FlareFadeSpeed: 3
33+
m_HaloTexture: {fileID: 0}
34+
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35+
m_DefaultReflectionMode: 0
36+
m_DefaultReflectionResolution: 128
37+
m_ReflectionBounces: 1
38+
m_ReflectionIntensity: 1
39+
m_CustomReflection: {fileID: 0}
40+
m_Sun: {fileID: 0}
41+
m_IndirectSpecularColor: {r: 0.44657815, g: 0.49641192, b: 0.57481617, a: 1}
42+
m_UseRadianceAmbientProbe: 0
43+
--- !u!157 &3
44+
LightmapSettings:
45+
m_ObjectHideFlags: 0
46+
serializedVersion: 12
47+
m_GIWorkflowMode: 1
48+
m_GISettings:
49+
serializedVersion: 2
50+
m_BounceScale: 1
51+
m_IndirectOutputScale: 1
52+
m_AlbedoBoost: 1
53+
m_EnvironmentLightingMode: 0
54+
m_EnableBakedLightmaps: 1
55+
m_EnableRealtimeLightmaps: 0
56+
m_LightmapEditorSettings:
57+
serializedVersion: 12
58+
m_Resolution: 2
59+
m_BakeResolution: 40
60+
m_AtlasSize: 1024
61+
m_AO: 0
62+
m_AOMaxDistance: 1
63+
m_CompAOExponent: 1
64+
m_CompAOExponentDirect: 0
65+
m_ExtractAmbientOcclusion: 0
66+
m_Padding: 2
67+
m_LightmapParameters: {fileID: 0}
68+
m_LightmapsBakeMode: 1
69+
m_TextureCompression: 1
70+
m_FinalGather: 0
71+
m_FinalGatherFiltering: 1
72+
m_FinalGatherRayCount: 256
73+
m_ReflectionCompression: 2
74+
m_MixedBakeMode: 2
75+
m_BakeBackend: 1
76+
m_PVRSampling: 1
77+
m_PVRDirectSampleCount: 32
78+
m_PVRSampleCount: 512
79+
m_PVRBounces: 2
80+
m_PVREnvironmentSampleCount: 256
81+
m_PVREnvironmentReferencePointCount: 2048
82+
m_PVRFilteringMode: 1
83+
m_PVRDenoiserTypeDirect: 1
84+
m_PVRDenoiserTypeIndirect: 1
85+
m_PVRDenoiserTypeAO: 1
86+
m_PVRFilterTypeDirect: 0
87+
m_PVRFilterTypeIndirect: 0
88+
m_PVRFilterTypeAO: 0
89+
m_PVREnvironmentMIS: 1
90+
m_PVRCulling: 1
91+
m_PVRFilteringGaussRadiusDirect: 1
92+
m_PVRFilteringGaussRadiusIndirect: 5
93+
m_PVRFilteringGaussRadiusAO: 2
94+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
95+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
96+
m_PVRFilteringAtrousPositionSigmaAO: 1
97+
m_ExportTrainingData: 0
98+
m_TrainingDataDestination: TrainingData
99+
m_LightProbeSampleCountMultiplier: 4
100+
m_LightingDataAsset: {fileID: 0}
101+
m_LightingSettings: {fileID: 0}
102+
--- !u!196 &4
103+
NavMeshSettings:
104+
serializedVersion: 2
105+
m_ObjectHideFlags: 0
106+
m_BuildSettings:
107+
serializedVersion: 2
108+
agentTypeID: 0
109+
agentRadius: 0.5
110+
agentHeight: 2
111+
agentSlope: 45
112+
agentClimb: 0.4
113+
ledgeDropHeight: 0
114+
maxJumpAcrossDistance: 0
115+
minRegionArea: 2
116+
manualCellSize: 0
117+
cellSize: 0.16666667
118+
manualTileSize: 0
119+
tileSize: 256
120+
accuratePlacement: 0
121+
maxJobWorkers: 0
122+
preserveTilesOutsideBounds: 0
123+
debug:
124+
m_Flags: 0
125+
m_NavMeshData: {fileID: 0}
126+
--- !u!1 &958602989
127+
GameObject:
128+
m_ObjectHideFlags: 0
129+
m_CorrespondingSourceObject: {fileID: 0}
130+
m_PrefabInstance: {fileID: 0}
131+
m_PrefabAsset: {fileID: 0}
132+
serializedVersion: 6
133+
m_Component:
134+
- component: {fileID: 958602991}
135+
- component: {fileID: 958602990}
136+
m_Layer: 0
137+
m_Name: Directional Light
138+
m_TagString: Untagged
139+
m_Icon: {fileID: 0}
140+
m_NavMeshLayer: 0
141+
m_StaticEditorFlags: 0
142+
m_IsActive: 1
143+
--- !u!108 &958602990
144+
Light:
145+
m_ObjectHideFlags: 0
146+
m_CorrespondingSourceObject: {fileID: 0}
147+
m_PrefabInstance: {fileID: 0}
148+
m_PrefabAsset: {fileID: 0}
149+
m_GameObject: {fileID: 958602989}
150+
m_Enabled: 1
151+
serializedVersion: 10
152+
m_Type: 1
153+
m_Shape: 0
154+
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
155+
m_Intensity: 1
156+
m_Range: 10
157+
m_SpotAngle: 30
158+
m_InnerSpotAngle: 21.80208
159+
m_CookieSize: 10
160+
m_Shadows:
161+
m_Type: 2
162+
m_Resolution: -1
163+
m_CustomResolution: -1
164+
m_Strength: 1
165+
m_Bias: 0.05
166+
m_NormalBias: 0.4
167+
m_NearPlane: 0.2
168+
m_CullingMatrixOverride:
169+
e00: 1
170+
e01: 0
171+
e02: 0
172+
e03: 0
173+
e10: 0
174+
e11: 1
175+
e12: 0
176+
e13: 0
177+
e20: 0
178+
e21: 0
179+
e22: 1
180+
e23: 0
181+
e30: 0
182+
e31: 0
183+
e32: 0
184+
e33: 1
185+
m_UseCullingMatrixOverride: 0
186+
m_Cookie: {fileID: 0}
187+
m_DrawHalo: 0
188+
m_Flare: {fileID: 0}
189+
m_RenderMode: 0
190+
m_CullingMask:
191+
serializedVersion: 2
192+
m_Bits: 4294967295
193+
m_RenderingLayerMask: 1
194+
m_Lightmapping: 4
195+
m_LightShadowCasterMode: 0
196+
m_AreaSize: {x: 1, y: 1}
197+
m_BounceIntensity: 1
198+
m_ColorTemperature: 6570
199+
m_UseColorTemperature: 0
200+
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
201+
m_UseBoundingSphereOverride: 0
202+
m_UseViewFrustumForShadowCasterCull: 1
203+
m_ShadowRadius: 0
204+
m_ShadowAngle: 0
205+
--- !u!4 &958602991
206+
Transform:
207+
m_ObjectHideFlags: 0
208+
m_CorrespondingSourceObject: {fileID: 0}
209+
m_PrefabInstance: {fileID: 0}
210+
m_PrefabAsset: {fileID: 0}
211+
m_GameObject: {fileID: 958602989}
212+
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
213+
m_LocalPosition: {x: 0, y: 3, z: 0}
214+
m_LocalScale: {x: 1, y: 1, z: 1}
215+
m_Children: []
216+
m_Father: {fileID: 0}
217+
m_RootOrder: 1
218+
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
219+
--- !u!1 &967978706
220+
GameObject:
221+
m_ObjectHideFlags: 0
222+
m_CorrespondingSourceObject: {fileID: 0}
223+
m_PrefabInstance: {fileID: 0}
224+
m_PrefabAsset: {fileID: 0}
225+
serializedVersion: 6
226+
m_Component:
227+
- component: {fileID: 967978708}
228+
- component: {fileID: 967978707}
229+
m_Layer: 0
230+
m_Name: AvailabilityExample
231+
m_TagString: Untagged
232+
m_Icon: {fileID: 0}
233+
m_NavMeshLayer: 0
234+
m_StaticEditorFlags: 0
235+
m_IsActive: 1
236+
--- !u!114 &967978707
237+
MonoBehaviour:
238+
m_ObjectHideFlags: 0
239+
m_CorrespondingSourceObject: {fileID: 0}
240+
m_PrefabInstance: {fileID: 0}
241+
m_PrefabAsset: {fileID: 0}
242+
m_GameObject: {fileID: 967978706}
243+
m_Enabled: 1
244+
m_EditorHideFlags: 0
245+
m_Script: {fileID: 11500000, guid: 25ff094883f2547338111f23f56375ba, type: 3}
246+
m_Name:
247+
m_EditorClassIdentifier:
248+
--- !u!4 &967978708
249+
Transform:
250+
m_ObjectHideFlags: 0
251+
m_CorrespondingSourceObject: {fileID: 0}
252+
m_PrefabInstance: {fileID: 0}
253+
m_PrefabAsset: {fileID: 0}
254+
m_GameObject: {fileID: 967978706}
255+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
256+
m_LocalPosition: {x: 0, y: 0, z: 0}
257+
m_LocalScale: {x: 1, y: 1, z: 1}
258+
m_Children: []
259+
m_Father: {fileID: 0}
260+
m_RootOrder: 2
261+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
262+
--- !u!1 &1307164342
263+
GameObject:
264+
m_ObjectHideFlags: 0
265+
m_CorrespondingSourceObject: {fileID: 0}
266+
m_PrefabInstance: {fileID: 0}
267+
m_PrefabAsset: {fileID: 0}
268+
serializedVersion: 6
269+
m_Component:
270+
- component: {fileID: 1307164345}
271+
- component: {fileID: 1307164344}
272+
- component: {fileID: 1307164343}
273+
m_Layer: 0
274+
m_Name: Main Camera
275+
m_TagString: MainCamera
276+
m_Icon: {fileID: 0}
277+
m_NavMeshLayer: 0
278+
m_StaticEditorFlags: 0
279+
m_IsActive: 1
280+
--- !u!81 &1307164343
281+
AudioListener:
282+
m_ObjectHideFlags: 0
283+
m_CorrespondingSourceObject: {fileID: 0}
284+
m_PrefabInstance: {fileID: 0}
285+
m_PrefabAsset: {fileID: 0}
286+
m_GameObject: {fileID: 1307164342}
287+
m_Enabled: 1
288+
--- !u!20 &1307164344
289+
Camera:
290+
m_ObjectHideFlags: 0
291+
m_CorrespondingSourceObject: {fileID: 0}
292+
m_PrefabInstance: {fileID: 0}
293+
m_PrefabAsset: {fileID: 0}
294+
m_GameObject: {fileID: 1307164342}
295+
m_Enabled: 1
296+
serializedVersion: 2
297+
m_ClearFlags: 1
298+
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
299+
m_projectionMatrixMode: 1
300+
m_GateFitMode: 2
301+
m_FOVAxisMode: 0
302+
m_SensorSize: {x: 36, y: 24}
303+
m_LensShift: {x: 0, y: 0}
304+
m_FocalLength: 50
305+
m_NormalizedViewPortRect:
306+
serializedVersion: 2
307+
x: 0
308+
y: 0
309+
width: 1
310+
height: 1
311+
near clip plane: 0.3
312+
far clip plane: 1000
313+
field of view: 60
314+
orthographic: 0
315+
orthographic size: 5
316+
m_Depth: -1
317+
m_CullingMask:
318+
serializedVersion: 2
319+
m_Bits: 4294967295
320+
m_RenderingPath: -1
321+
m_TargetTexture: {fileID: 0}
322+
m_TargetDisplay: 0
323+
m_TargetEye: 3
324+
m_HDR: 1
325+
m_AllowMSAA: 1
326+
m_AllowDynamicResolution: 0
327+
m_ForceIntoRT: 0
328+
m_OcclusionCulling: 1
329+
m_StereoConvergence: 10
330+
m_StereoSeparation: 0.022
331+
--- !u!4 &1307164345
332+
Transform:
333+
m_ObjectHideFlags: 0
334+
m_CorrespondingSourceObject: {fileID: 0}
335+
m_PrefabInstance: {fileID: 0}
336+
m_PrefabAsset: {fileID: 0}
337+
m_GameObject: {fileID: 1307164342}
338+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
339+
m_LocalPosition: {x: 0, y: 1, z: -10}
340+
m_LocalScale: {x: 1, y: 1, z: 1}
341+
m_Children: []
342+
m_Father: {fileID: 0}
343+
m_RootOrder: 0
344+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scenes/AvailabilitySample.unity.meta

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

0 commit comments

Comments
 (0)