本文整理汇总了C#中SceneKitSessionWWDC2013.PresentationViewController.ShowsNewInSceneKitBadge方法的典型用法代码示例。如果您正苦于以下问题:C# PresentationViewController.ShowsNewInSceneKitBadge方法的具体用法?C# PresentationViewController.ShowsNewInSceneKitBadge怎么用?C# PresentationViewController.ShowsNewInSceneKitBadge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneKitSessionWWDC2013.PresentationViewController
的用法示例。
在下文中一共展示了PresentationViewController.ShowsNewInSceneKitBadge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PresentStep
public override void PresentStep (int index, PresentationViewController presentationViewController)
{
switch (index) {
case 0:
// Hide everything (in case the user went backward)
for (var i = 1; i < 4; i++) {
var teapot = GroundNode.FindChildNode ("Teapot" + i, true);
teapot.Opacity = 0.0f;
}
break;
case 1:
// Move the camera and adjust the clipping plane
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 3;
presentationViewController.CameraNode.Position = new SCNVector3 (0, 0, 200);
presentationViewController.CameraNode.Camera.ZFar = 500.0f;
SCNTransaction.Commit ();
break;
case 2:
// Revert to original position
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
presentationViewController.CameraNode.Position = new SCNVector3 (0, 0, 0);
presentationViewController.CameraNode.Camera.ZFar = 100.0f;
SCNTransaction.Commit ();
break;
case 3:
var numberNodes = new SCNNode[] { AddNumberNode ("64k", -17),
AddNumberNode ("6k", -9),
AddNumberNode ("3k", -1),
AddNumberNode ("1k", 6.5f),
AddNumberNode ("256", 14)
};
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
// Move the camera and the text
presentationViewController.CameraHandle.Position = new SCNVector3 (presentationViewController.CameraHandle.Position.X, presentationViewController.CameraHandle.Position.Y + 6, presentationViewController.CameraHandle.Position.Z);
TextManager.TextNode.Position = new SCNVector3 (TextManager.TextNode.Position.X, TextManager.TextNode.Position.Y + 6, TextManager.TextNode.Position.Z);
// Show the remaining resolutions
for (var i = 0; i < 5; i++) {
var numberNode = numberNodes [i];
numberNode.Position = new SCNVector3 (numberNode.Position.X, 7, -5);
var teapot = GroundNode.FindChildNode ("Teapot" + i, true);
teapot.Opacity = 1.0f;
teapot.Rotation = new SCNVector4 (0, 0, 1, (float)(Math.PI / 4));
teapot.Position = new SCNVector3 ((i - 2) * 8, 5, teapot.Position.Z);
}
SCNTransaction.Commit ();
break;
case 4:
presentationViewController.ShowsNewInSceneKitBadge (true);
// Remove the numbers
RemoveNumberNodes ();
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
// Add some text and code
TextManager.SetSubtitle ("SCNLevelOfDetail");
TextManager.AddCode ("#var lod1 = SCNLevelOfDetail.#CreateWithWorldSpaceDistance# (aGeometry, aDistance); \n"
+ "geometry.#LevelsOfDetail# = new SCNLevelOfDetail { lod1, lod2, ..., lodn };#");
// Animation the merge
for (int i = 0; i < 5; i++) {
var teapot = GroundNode.FindChildNode ("Teapot" + i, true);
teapot.Opacity = i == 0 ? 1.0f : 0.0f;
teapot.Rotation = new SCNVector4 (0, 0, 1, 0);
teapot.Position = new SCNVector3 (0, -5, teapot.Position.Z);
}
// Move the camera and the text
presentationViewController.CameraHandle.Position = new SCNVector3 (presentationViewController.CameraHandle.Position.X, presentationViewController.CameraHandle.Position.Y - 3, presentationViewController.CameraHandle.Position.Z);
TextManager.TextNode.Position = new SCNVector3 (TextManager.TextNode.Position.X, TextManager.TextNode.Position.Y - 3, TextManager.TextNode.Position.Z);
SCNTransaction.Commit ();
break;
case 5:
presentationViewController.ShowsNewInSceneKitBadge (false);
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 3;
// Change the lighting to remove the front light and rise the main light
presentationViewController.UpdateLightingWithIntensities (new float[] { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.3f });
presentationViewController.RiseMainLight (true);
// Remove some text
TextManager.FadeOutText (SlideTextManager.TextType.Title);
TextManager.FadeOutText (SlideTextManager.TextType.Subtitle);
TextManager.FadeOutText (SlideTextManager.TextType.Code);
SCNTransaction.Commit ();
// Retrieve the main teapot
var maintTeapot = GroundNode.FindChildNode ("Teapot0", true);
//.........这里部分代码省略.........
示例2: PresentStep
public override void PresentStep (int index, PresentationViewController presentationViewController)
{
switch (index) {
case 0:
break;
case 1:
// Set the slide's subtitle and display the primitves
TextManager.SetSubtitle ("Built-in parametric primitives");
PresentPrimitives ();
break;
case 2:
// Hide the carousel and illustrate SCNText
TextManager.FlipOutText (SlideTextManager.TextType.Subtitle);
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 0.5f;
SCNTransaction.SetCompletionBlock (() => {
CarouselNode.RemoveFromParentNode ();
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
PresentTextNode ();
TextNode.Opacity = 1.0f;
SCNTransaction.Commit ();
});
CarouselNode.Opacity = 0.0f;
SCNTransaction.Commit ();
TextManager.SetSubtitle ("Built-in 3D text");
TextManager.AddBulletAtLevel ("SCNText", 0);
TextManager.FlipInText (SlideTextManager.TextType.Subtitle);
TextManager.FlipInText (SlideTextManager.TextType.Bullet);
break;
case 3:
// Hide the 3D text and introduce SCNShape
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 0.5f;
SCNTransaction.SetCompletionBlock (() => {
if (TextNode != null)
TextNode.RemoveFromParentNode ();
presentationViewController.ShowsNewInSceneKitBadge (true);
TextManager.FlipOutText (SlideTextManager.TextType.Subtitle);
TextManager.FlipOutText (SlideTextManager.TextType.Bullet);
TextManager.SetSubtitle ("3D Shapes");
TextManager.AddBulletAtLevel ("SCNShape", 0);
TextManager.AddBulletAtLevel ("Initializes with a NSBezierPath", 0);
TextManager.AddBulletAtLevel ("Extrusion and chamfer", 0);
TextManager.AddCode ("#aNode.Geometry = SCNShape.#Create# (aBezierPath, 10);#");
TextManager.FlipInText (SlideTextManager.TextType.Subtitle);
TextManager.FlipInText (SlideTextManager.TextType.Bullet);
TextManager.FlipInText (SlideTextManager.TextType.Code);
});
if (TextNode != null)
TextNode.Opacity = 0.0f;
SCNTransaction.Commit ();
break;
case 4:
TextManager.FadeOutText (SlideTextManager.TextType.Bullet);
TextManager.FadeOutText (SlideTextManager.TextType.Code);
// Illustrate SCNShape, show the floor ouline
Level2Node = Level2 ();
Level2OutlineNode = Level2Outline ();
Level2Node.Position = Level2OutlineNode.Position = new SCNVector3 (-11, 0, -5);
Level2Node.Rotation = Level2OutlineNode.Rotation = new SCNVector4 (1, 0, 0, -(float)(Math.PI / 2));
Level2Node.Opacity = Level2OutlineNode.Opacity = 0.0f;
Level2Node.Scale = new SCNVector3 (0.03f, 0.03f, 0);
Level2OutlineNode.Scale = new SCNVector3 (0.03f, 0.03f, 0.05f);
GroundNode.AddChildNode (Level2OutlineNode);
GroundNode.AddChildNode (Level2Node);
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
Level2OutlineNode.Opacity = 1.0f;
SCNTransaction.Commit ();
break;
case 5:
presentationViewController.ShowsNewInSceneKitBadge (false);
// Show the extruded floor
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1;
Level2Node.Opacity = 1.0f;
Level2Node.Scale = new SCNVector3 (0.03f, 0.03f, 0.05f);
SCNTransaction.SetCompletionBlock (() => {
SCNTransaction.Begin ();
SCNTransaction.AnimationDuration = 1.5f;
// move the camera a little higher
presentationViewController.CameraNode.Position = new SCNVector3 (0, 7, -3);
presentationViewController.CameraPitch.Rotation = new SCNVector4 (1, 0, 0, -(float)(Math.PI / 4) * 0.7f);
SCNTransaction.Commit ();
//.........这里部分代码省略.........