From 7320c239bdc064a65199830e0f8dc6b7f7dfcb9c Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Thu, 3 Nov 2016 15:05:31 +0100 Subject: [PATCH 1/2] [spritekit] Update for iOS 10.2 beta 1 --- src/spritekit.cs | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/spritekit.cs b/src/spritekit.cs index 4331609fd4e7..77540ad3bcc9 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -299,14 +299,18 @@ partial interface SKNode : NSCoding, NSCopying { [Export ("attributeValues", ArgumentSemantic.Copy)] NSDictionary AttributeValues { get; set; } +#if !XAMCORE_4_0 + [Obsolete ("Please use the subtype's method")] [iOS (9,0),Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] SKAttributeValue GetValue (string key); + [Obsolete ("Please use the subtype's method")] [iOS (9,0),Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif #if !WATCH // Extensions from GameplayKit, inlined to avoid ugly static extension syntax @@ -376,6 +380,15 @@ partial interface SKEffectNode : SKWarpable { [NullAllowed] // by default this property is null [Export ("shader", ArgumentSemantic.Retain)] SKShader Shader { get; set; } + + [iOS (9,0), Mac(10,11)] + [Export ("valueForAttributeNamed:")] + [return: NullAllowed] + SKAttributeValue GetValue (string key); + + [iOS (9,0), Mac(10,11)] + [Export ("setValue:forAttributeNamed:")] + void SetValue (SKAttributeValue value, string key); } delegate Vector3 SKFieldForceEvaluator (/* vector_float3 */ Vector4 position, /* vector_float3 */ Vector4 velocity, float /* float, not CGFloat */ mass, float /* float, not CGFloat */ charge, double time); @@ -712,6 +725,15 @@ partial interface SKSpriteNode : SKWarpable { [TV (10,0)] [Export ("scaleToSize:")] void ScaleTo (CGSize size); + + [iOS (9,0), Mac(10,11)] + [Export ("valueForAttributeNamed:")] + [return: NullAllowed] + SKAttributeValue GetValue (string key); + + [iOS (9,0), Mac(10,11)] + [Export ("setValue:forAttributeNamed:")] + void SetValue (SKAttributeValue value, string key); } [Watch (3,0)] @@ -935,6 +957,15 @@ partial interface SKEmitterNode { [iOS (9,0)][Mac (10,11, onlyOn64 : true)] [Export ("particleRenderOrder", ArgumentSemantic.Assign)] SKParticleRenderOrder ParticleRenderOrder { get; set; } + + [iOS (9,0), Mac(10,11)] + [Export ("valueForAttributeNamed:")] + [return: NullAllowed] + SKAttributeValue GetValue (string key); + + [iOS (9,0), Mac(10,11)] + [Export ("setValue:forAttributeNamed:")] + void SetValue (SKAttributeValue value, string key); } [Watch (3,0)] @@ -1053,6 +1084,15 @@ partial interface SKShapeNode { [iOS (8,0), Mac (10,10)] [Export ("lineLength")] nfloat LineLength { get; } + + [iOS (9,0), Mac(10,11)] + [Export ("valueForAttributeNamed:")] + [return: NullAllowed] + SKAttributeValue GetValue (string key); + + [iOS (9,0), Mac(10,11)] + [Export ("setValue:forAttributeNamed:")] + void SetValue (SKAttributeValue value, string key); } [Watch (3,0)] @@ -2981,6 +3021,15 @@ interface SKTileMapNode : NSCopying, NSCoding [Export ("tileMapNodesWithTileSet:columns:rows:tileSize:fromNoiseMap:tileTypeNoiseMapThresholds:")] SKTileMapNode[] FromTileSet (SKTileSet tileSet, nuint columns, nuint rows, CGSize tileSize, GKNoiseMap noiseMap, NSNumber[] thresholds); #endif + + [iOS (9,0), Mac(10,11)] + [Export ("valueForAttributeNamed:")] + [return: NullAllowed] + SKAttributeValue GetValue (string key); + + [iOS (9,0), Mac(10,11)] + [Export ("setValue:forAttributeNamed:")] + void SetValue (SKAttributeValue value, string key); } [Watch (3,0)] From 4e3928202386134945d3a422bfb0c4d35eff7d8f Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 7 Nov 2016 19:18:16 +0100 Subject: [PATCH 2/2] [spritekit] Updated code based on comments --- src/spritekit.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/spritekit.cs b/src/spritekit.cs index 77540ad3bcc9..062b85aeff56 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -300,13 +300,13 @@ partial interface SKNode : NSCoding, NSCopying { NSDictionary AttributeValues { get; set; } #if !XAMCORE_4_0 - [Obsolete ("Please use the subtype's method")] + // [Obsolete ("Please use the subtype's method")] [iOS (9,0),Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] SKAttributeValue GetValue (string key); - [Obsolete ("Please use the subtype's method")] + // [Obsolete ("Please use the subtype's method")] [iOS (9,0),Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); @@ -381,6 +381,7 @@ partial interface SKEffectNode : SKWarpable { [Export ("shader", ArgumentSemantic.Retain)] SKShader Shader { get; set; } +#if XAMCORE_4_0 [iOS (9,0), Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] @@ -389,6 +390,7 @@ partial interface SKEffectNode : SKWarpable { [iOS (9,0), Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif } delegate Vector3 SKFieldForceEvaluator (/* vector_float3 */ Vector4 position, /* vector_float3 */ Vector4 velocity, float /* float, not CGFloat */ mass, float /* float, not CGFloat */ charge, double time); @@ -726,6 +728,7 @@ partial interface SKSpriteNode : SKWarpable { [Export ("scaleToSize:")] void ScaleTo (CGSize size); +#if XAMCORE_4_0 [iOS (9,0), Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] @@ -734,6 +737,7 @@ partial interface SKSpriteNode : SKWarpable { [iOS (9,0), Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif } [Watch (3,0)] @@ -958,6 +962,7 @@ partial interface SKEmitterNode { [Export ("particleRenderOrder", ArgumentSemantic.Assign)] SKParticleRenderOrder ParticleRenderOrder { get; set; } +#if XAMCORE_4_0 [iOS (9,0), Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] @@ -966,6 +971,7 @@ partial interface SKEmitterNode { [iOS (9,0), Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif } [Watch (3,0)] @@ -1085,6 +1091,7 @@ partial interface SKShapeNode { [Export ("lineLength")] nfloat LineLength { get; } +#if XAMCORE_4_0 [iOS (9,0), Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] @@ -1093,6 +1100,7 @@ partial interface SKShapeNode { [iOS (9,0), Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif } [Watch (3,0)] @@ -3022,6 +3030,7 @@ interface SKTileMapNode : NSCopying, NSCoding SKTileMapNode[] FromTileSet (SKTileSet tileSet, nuint columns, nuint rows, CGSize tileSize, GKNoiseMap noiseMap, NSNumber[] thresholds); #endif +#if XAMCORE_4_0 [iOS (9,0), Mac(10,11)] [Export ("valueForAttributeNamed:")] [return: NullAllowed] @@ -3030,6 +3039,7 @@ interface SKTileMapNode : NSCopying, NSCoding [iOS (9,0), Mac(10,11)] [Export ("setValue:forAttributeNamed:")] void SetValue (SKAttributeValue value, string key); +#endif } [Watch (3,0)]