SCNConstraint.AddAnimation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddAnimation(ISCNAnimationProtocol, String) |
Adds |
| 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
- player
- SCNAnimationPlayer
- key
- NSString
Implements
- Attributes