Share via


SCNConstraint.AddAnimation Method

Definition

Overloads

Name Description
AddAnimation(ISCNAnimationProtocol, String)

Adds scnAnimation, identified with the specified key.

AddAnimation(SCNAnimationPlayer, NSString)

AddAnimation(ISCNAnimationProtocol, String)

Adds scnAnimation, identified with the specified key.

[Foundation.Export("addAnimation:forKey:")]
[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
public virtual void AddAnimation(SceneKit.ISCNAnimationProtocol scnAnimation, string? key);
[<Foundation.Export("addAnimation:forKey:")>]
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
abstract member AddAnimation : SceneKit.ISCNAnimationProtocol * string -> unit
override this.AddAnimation : SceneKit.ISCNAnimationProtocol * string -> unit

Parameters

scnAnimation
ISCNAnimationProtocol

The animation to add.

key
String

The animation key.

Implements

Attributes

Remarks

The following example shows how a rotation animation can be added to a SCNGeometry object:

var animation = new CABasicAnimation ();
animation.KeyPath = "rotation";
var v = new SCNVector4 (1.0f, 1.0f, 0.0f, (float) (Math.PI * 2.0));
animation.To = NSValue.FromVector (v);
animation.Duration = 5.0f;
animation.RepeatCount = float.MaxValue; //repeat forever
animatableObject.AddAnimation (animation, (NSString) "rotation");

Applies to

AddAnimation(SCNAnimationPlayer, NSString)

[Foundation.Export("addAnimationPlayer:forKey:")]
[ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)]
public virtual void AddAnimation(SceneKit.SCNAnimationPlayer player, Foundation.NSString? key);
[<Foundation.Export("addAnimationPlayer:forKey:")>]
[<ObjCRuntime.BindingImpl(ObjCRuntime.BindingImplOptions.GeneratedCode | ObjCRuntime.BindingImplOptions.Optimizable)>]
abstract member AddAnimation : SceneKit.SCNAnimationPlayer * Foundation.NSString -> unit
override this.AddAnimation : SceneKit.SCNAnimationPlayer * Foundation.NSString -> unit

Parameters

key
NSString

Implements

Attributes

Applies to