Skip to content

Commit 56a41e1

Browse files
authored
[SpriteKit] Fix all availability attributes in this framework. (#22674)
* Add/adjust availability attributes. * Remove !.NET availability attributes / code. This is a step towards fixing #21185.
1 parent 5347e9d commit 56a41e1

11 files changed

+21
-418
lines changed

runtime/bindings-generator.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,19 @@ static IEnumerable<FunctionData> GetFunctionData ()
11511151
}
11521152
);
11531153

1154+
data.Add (
1155+
new FunctionData {
1156+
Comment = " // NativeHandle func (NativeHandleType, Vector2)",
1157+
Prefix = "simd__",
1158+
Variants = Variants.msgSend | Variants.msgSendSuper,
1159+
ReturnType = Types.NativeHandle,
1160+
Parameters = new ParameterData [] {
1161+
new ParameterData { TypeData = Types.NativeHandle },
1162+
new ParameterData { TypeData = Types.Vector2 },
1163+
},
1164+
}
1165+
);
1166+
11541167
data.Add (
11551168
new FunctionData {
11561169
Comment = " // IntPtr func (IntPtr, Vector2, Vector2); @try",

src/SpriteKit/SKAction.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
#nullable enable
1515

1616
namespace SpriteKit {
17-
18-
#if !NET
19-
[Obsolete ("Use 'SKActionTimingFunction2' instead.")]
20-
public delegate void SKActionTimingFunction (float /* float, not CGFloat */ time);
21-
#endif
22-
2317
public partial class SKAction {
2418

2519
/// <param name="size">To be added.</param>
@@ -31,10 +25,5 @@ public static SKAction ResizeTo (CGSize size, double duration)
3125
{
3226
return SKAction.ResizeTo (size.Width, size.Height, duration);
3327
}
34-
35-
#if !NET
36-
[Obsolete ("Use 'TimingFunction2' instead.")]
37-
public virtual SKActionTimingFunction? TimingFunction { get; set; }
38-
#endif
3928
}
4029
}

src/SpriteKit/SKNode.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
namespace SpriteKit {
2121
public partial class SKNode : IEnumerable, IEnumerable<SKNode> {
22-
#if NET
2322
/// <typeparam name="T">To be added.</typeparam>
2423
/// <param name="file">
2524
///
@@ -33,7 +32,6 @@ public partial class SKNode : IEnumerable, IEnumerable<SKNode> {
3332
[SupportedOSPlatform ("macos")]
3433
[SupportedOSPlatform ("maccatalyst")]
3534
[SupportedOSPlatform ("tvos")]
36-
#endif
3735
public static T? FromFile<T> (string file) where T : SKNode
3836
{
3937
var fileHandle = CFString.CreateNative (file);
@@ -81,7 +79,6 @@ IEnumerator IEnumerable.GetEnumerator ()
8179
return GetEnumerator ();
8280
}
8381

84-
#if NET
8582
/// <param name="filename">To be added.</param>
8683
/// <param name="types">To be added.</param>
8784
/// <param name="error">To be added.</param>
@@ -92,7 +89,6 @@ IEnumerator IEnumerable.GetEnumerator ()
9289
[SupportedOSPlatform ("macos")]
9390
[SupportedOSPlatform ("ios")]
9491
[SupportedOSPlatform ("maccatalyst")]
95-
#endif
9692
public static SKNode? Create (string filename, Type [] types, out NSError error)
9793
{
9894
// Let's fail early.
@@ -112,7 +108,6 @@ IEnumerator IEnumerable.GetEnumerator ()
112108
}
113109
}
114110

115-
#if NET
116111
/// <param name="filename">To be added.</param>
117112
/// <param name="classes">To be added.</param>
118113
/// <param name="error">To be added.</param>
@@ -123,7 +118,6 @@ IEnumerator IEnumerable.GetEnumerator ()
123118
[SupportedOSPlatform ("macos")]
124119
[SupportedOSPlatform ("ios")]
125120
[SupportedOSPlatform ("maccatalyst")]
126-
#endif
127121
public static SKNode? Create (string filename, NSSet<Class> classes, out NSError error)
128122
{
129123
// `filename` will be checked by `Create` later

src/SpriteKit/SKShapeNode.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
namespace SpriteKit {
1717
public partial class SKShapeNode : SKNode {
18-
19-
#if NET
2018
/// <param name="points">To be added.</param>
2119
/// <summary>Creates a new shape node from the specified <paramref name="points" />.</summary>
2220
/// <returns>To be added.</returns>
@@ -25,7 +23,6 @@ public partial class SKShapeNode : SKNode {
2523
[SupportedOSPlatform ("macos")]
2624
[SupportedOSPlatform ("maccatalyst")]
2725
[SupportedOSPlatform ("tvos")]
28-
#endif
2926
public static SKShapeNode FromPoints (CGPoint [] points)
3027
{
3128
if (points is null)
@@ -34,7 +31,6 @@ public static SKShapeNode FromPoints (CGPoint [] points)
3431
return FromPoints (ref points [0], (nuint) points.Length);
3532
}
3633

37-
#if NET
3834
/// <param name="points">To be added.</param>
3935
/// <param name="offset">To be added.</param>
4036
/// <param name="length">To be added.</param>
@@ -45,7 +41,6 @@ public static SKShapeNode FromPoints (CGPoint [] points)
4541
[SupportedOSPlatform ("macos")]
4642
[SupportedOSPlatform ("maccatalyst")]
4743
[SupportedOSPlatform ("tvos")]
48-
#endif
4944
public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length)
5045
{
5146
if (points is null)
@@ -56,7 +51,6 @@ public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length)
5651
return FromPoints (ref points [offset], (nuint) length);
5752
}
5853

59-
#if NET
6054
/// <param name="points">To be added.</param>
6155
/// <summary>Creates a new shape node from the specified spline <paramref name="points" />.</summary>
6256
/// <returns>To be added.</returns>
@@ -65,7 +59,6 @@ public static SKShapeNode FromPoints (CGPoint [] points, int offset, int length)
6559
[SupportedOSPlatform ("macos")]
6660
[SupportedOSPlatform ("maccatalyst")]
6761
[SupportedOSPlatform ("tvos")]
68-
#endif
6962
public static SKShapeNode FromSplinePoints (CGPoint [] points)
7063
{
7164
if (points is null)
@@ -74,7 +67,6 @@ public static SKShapeNode FromSplinePoints (CGPoint [] points)
7467
return FromSplinePoints (ref points [0], (nuint) points.Length);
7568
}
7669

77-
#if NET
7870
/// <param name="points">To be added.</param>
7971
/// <param name="offset">To be added.</param>
8072
/// <param name="length">To be added.</param>
@@ -85,7 +77,6 @@ public static SKShapeNode FromSplinePoints (CGPoint [] points)
8577
[SupportedOSPlatform ("macos")]
8678
[SupportedOSPlatform ("maccatalyst")]
8779
[SupportedOSPlatform ("tvos")]
88-
#endif
8980
public static SKShapeNode FromSplinePoints (CGPoint [] points, int offset, int length)
9081
{
9182
if (points is null)

0 commit comments

Comments
 (0)