當前位置: 首頁>>代碼示例>>C#>>正文


C# PresentationViewController.NarrowSpotlight方法代碼示例

本文整理匯總了C#中SceneKitSessionWWDC2013.PresentationViewController.NarrowSpotlight方法的典型用法代碼示例。如果您正苦於以下問題:C# PresentationViewController.NarrowSpotlight方法的具體用法?C# PresentationViewController.NarrowSpotlight怎麽用?C# PresentationViewController.NarrowSpotlight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SceneKitSessionWWDC2013.PresentationViewController的用法示例。


在下文中一共展示了PresentationViewController.NarrowSpotlight方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PresentStep

		public override void PresentStep (int index, PresentationViewController presentationViewController)
		{
			switch (index) {
			case 0:
				// Set the slide's title and subtitle and add some text
				TextManager.SetTitle ("Materials");
				TextManager.SetSubtitle ("CALayer as texture");

				TextManager.AddCode ("#// Map a layer tree on a 3D object. \n"
				+ "aNode.Geometry.FirstMaterial.Diffuse.#Contents# = #aLayerTree#;#");

				// Add the model
				var intermediateNode = SCNNode.Create ();
				intermediateNode.Position = new SCNVector3 (0, 3.9f, 8);
				intermediateNode.Rotation = new SCNVector4 (1, 0, 0, -(float)(Math.PI / 2));
				GroundNode.AddChildNode (intermediateNode);
				Utils.SCAddChildNode (intermediateNode, "frames", "Scenes/frames/frames", 8);

				presentationViewController.NarrowSpotlight (true);
				break;
			case 1:
				SCNTransaction.Begin ();
				SCNTransaction.AnimationDuration = 1;
						
				// Change the point of view to "frameCamera" (a camera defined in the "frames" scene)
				var frameCamera = ContentNode.FindChildNode ("frameCamera", true);
				((SCNView)presentationViewController.View).PointOfView = frameCamera;

				// The "frames" scene contains animations, update the end time of our main scene and start to play the animations
				((SCNView)presentationViewController.View).Scene.SetAttribute (new NSNumber (7.33f), SCNScene.EndTimeAttributeKey);
				((SCNView)presentationViewController.View).CurrentTime = 0;
				((SCNView)presentationViewController.View).Playing = true;
				((SCNView)presentationViewController.View).Loops = true;

				PlayerLayer1 = ConfigurePlayer (NSBundle.MainBundle.PathForResource ("Movies/movie1", "mov"), "PhotoFrame-Vertical");
				PlayerLayer2 = ConfigurePlayer (NSBundle.MainBundle.PathForResource ("Movies/movie2", "mov"), "PhotoFrame-Horizontal");

				SCNTransaction.Commit ();
				break;
			}
		}
開發者ID:hitchingsh,項目名稱:mac-samples,代碼行數:41,代碼來源:SlideMaterialLayer.cs

示例2: WillOrderOut

		public override void WillOrderOut (PresentationViewController presentationViewController)
		{
			NSNotificationCenter.DefaultCenter.RemoveObserver (this, AVPlayerItem.DidPlayToEndTimeNotification, PlayerLayer1.Player.CurrentItem);
			NSNotificationCenter.DefaultCenter.RemoveObserver (this, AVPlayerItem.DidPlayToEndTimeNotification, PlayerLayer2.Player.CurrentItem);

			PlayerLayer1.Player.Pause ();
			PlayerLayer2.Player.Pause ();

			//playerLayer1.Player = null;
			//playerLayer2.Player = null;

			// Stop playing scene animations, restore the original point of view and restore the default spot light mode
			((SCNView)presentationViewController.View).Playing = false;
			((SCNView)presentationViewController.View).PointOfView = presentationViewController.CameraNode;
			presentationViewController.NarrowSpotlight (false);
		}
開發者ID:hitchingsh,項目名稱:mac-samples,代碼行數:16,代碼來源:SlideMaterialLayer.cs


注:本文中的SceneKitSessionWWDC2013.PresentationViewController.NarrowSpotlight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。