当前位置: 首页>>代码示例>>C#>>正文


C# NSMutableArray.AddObjects方法代码示例

本文整理汇总了C#中NSMutableArray.AddObjects方法的典型用法代码示例。如果您正苦于以下问题:C# NSMutableArray.AddObjects方法的具体用法?C# NSMutableArray.AddObjects怎么用?C# NSMutableArray.AddObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NSMutableArray的用法示例。


在下文中一共展示了NSMutableArray.AddObjects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PresentStep

		public override void PresentStep (int index, PresentationViewController presentationViewController)
		{
			switch (index) {
			case 0:
				break;
			case 1:
				TextManager.FlipOutText (SlideTextManager.TextType.Bullet);
				TextManager.FlipOutText (SlideTextManager.TextType.Code);

				TextManager.AddBulletAtLevel ("Image", 0);
				TextManager.AddBulletAtLevel ("Name / Path / URL", 1);
				TextManager.AddBulletAtLevel ("NSImage / UIImage / NSData", 1);
				TextManager.AddBulletAtLevel ("SKTexture", 1);

				TextManager.FlipInText (SlideTextManager.TextType.Bullet);


				var code = TextManager.AddCode ("#material.diffuse.contents = #@\"slate.jpg\"#;#");
				code.Position = new SCNVector3 (code.Position.X + 6, code.Position.Y - 6.5f, code.Position.Z);

				Material.Diffuse.Contents = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/slate", "jpg"));
				Material.Normal.Contents = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/slate-bump", "png"));
				Material.Normal.Intensity = 0;
				break;
			case 2:
				SCNTransaction.Begin ();
				SCNTransaction.AnimationDuration = 1.0f;
				Material.Normal.Intensity = 5.0f;
				Material.Specular.Contents = NSColor.Gray;
				SCNTransaction.Commit ();

				code = TextManager.AddCode ("#material.normal.contents = #[SKTexture textureByGeneratingNormalMap]#;#");
				code.Position = new SCNVector3 (code.Position.X + 2, code.Position.Y - 6.5f, code.Position.Z);
				break;
			case 3:
				TextManager.FadeOutText (SlideTextManager.TextType.Code);
				TextManager.FlipOutText (SlideTextManager.TextType.Bullet);
				TextManager.AddBulletAtLevel ("Live contents", 0);
				TextManager.AddBulletAtLevel ("CALayer tree", 1);
				TextManager.AddBulletAtLevel ("SKScene (new)", 1);
				TextManager.FlipInText (SlideTextManager.TextType.Bullet);

				SCNTransaction.Begin ();
				SCNTransaction.AnimationDuration = 1.0f;
				Material.Normal.Intensity = 2.0f;
				SCNTransaction.Commit ();

				PlayerLayer1 = ConfigurePlayer (NSBundle.MainBundle.PathForResource ("Movies/movie1", "mov"), "material-cube");
				break;
			case 4:
				TextManager.FlipOutText (SlideTextManager.TextType.Bullet);
				TextManager.AddEmptyLine ();

				TextManager.AddBulletAtLevel ("Cube map", 0);
				TextManager.AddBulletAtLevel ("NSArray of 6 items", 1);
				TextManager.FlipInText (SlideTextManager.TextType.Bullet);

				code = TextManager.AddCode ("#material.reflective.contents = #@[aright.png, left.png ... front.png]#;#");
				code.Position = new SCNVector3 (code.Position.X, code.Position.Y - 9.5f, code.Position.Z);

				var image = Utils.SCPlaneNode (NSBundle.MainBundle.PathForResource ("Images/cubemap", "png"), 12, false);
				image.Position = new SCNVector3 (-10, 9, 0);
				image.Opacity = 0;
				ContentNode.AddChildNode (image);

				Object.Geometry = SCNTorus.Create (W * 0.5f, W * 0.2f);
				Material = Object.Geometry.FirstMaterial;
				Object.Rotation = new SCNVector4 (1, 0, 0, NMath.PI / 2);

				SCNTransaction.Begin ();
				SCNTransaction.AnimationDuration = 1;
				var right = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/right", "tga"));
				var left = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/left", "tga"));
				var top = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/top", "tga"));
				var bottom = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/bottom", "tga"));
				var back = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/back", "tga"));
				var front = new NSImage (NSBundle.MainBundle.PathForResource ("SharedTextures/front", "tga"));
				var materialContents = new NSMutableArray ();
				materialContents.AddObjects (new NSObject[] { right, left, top, bottom, back, front });
				Material.Reflective.Contents = materialContents;
				Material.Diffuse.Contents = NSColor.Red;
				image.Opacity = 1.0f;
				SCNTransaction.Commit ();
				break;
			}
		}
开发者ID:RangoLee,项目名称:mac-samples,代码行数:86,代码来源:SlideMaterialLayer.cs

示例2: Initialize

        // Shared initialization code
        void Initialize()
        {
            viewControllers = new NSMutableArray();

            var dvc = new DepartmentViewController();
            var evc = new EmployeeViewController();
            viewControllers.AddObjects(new NSObject[]{dvc, evc});

            DataStore.LoadItemsFromDatabase();
        }
开发者ID:yingfangdu,项目名称:BNR,代码行数:11,代码来源:MyDocument.cs

示例3: ShowPhysicsFields

		//present physics field slide
		void ShowPhysicsFields ()
		{
			var dz = 50f;

			SCNTransaction.Begin ();
			SCNTransaction.AnimationDuration = 0.75f;
			SpotLightNode.Light.Color = SKColorHelper.FromCommonWhiteAlpha (0.5f, 1.0f);
			AmbientLightNode.Light.Color = SKColor.Black;
			SCNTransaction.Commit ();

			//remove gravity for this slide
			Scene.PhysicsWorld.Gravity = SCNVector3.Zero;

			//move camera
			var tr = SCNAction.MoveBy (new SCNVector3 (0, 0, dz), 1);
			tr.TimingMode = SCNActionTimingMode.EaseInEaseOut;
			CameraHandle.RunAction (tr);

			//add particles
			FieldEmitter = SCNNode.Create ();
			FieldEmitter.Position = new SCNVector3 (CameraHandle.Position.X, 5, dz);

			var ps = SCNParticleSystem.Create ("bubbles.scnp", "assets.scnassets/particles/");

			ps.ParticleColor = SKColorHelper.FromCommonRGBA (0.8f, 0, 0, 1.0f);
			ps.ParticleColorVariation = new SCNVector4 (0.3f, 0.2f, 0.3f, 0.0f);
			ps.SortingMode = SCNParticleSortingMode.Distance;
			ps.BlendMode = SCNParticleBlendMode.Alpha;
			#if __IOS__
			var right = new UIImage ("images/cubemap/right.jpg");
			var left = new UIImage ("images/cubemap/left.jpg");
			var top = new UIImage ("images/cubemap/top.jpg");
			var bottom = new UIImage ("images/cubemap/bottom.jpg");
			var front = new UIImage ("images/cubemap/front.jpg");
			var back = new UIImage ("images/cubemap/back.jpg");
			#else
			var right = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/right", "jpg"));
			var left = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/left", "jpg"));
			var top = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/top", "jpg"));
			var bottom = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/bottom", "jpg"));
			var front = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/front", "jpg"));
			var back = new NSImage (NSBundle.MainBundle.PathForResource ("images/cubemap/back", "jpg"));
			#endif
			var cubMap = new NSMutableArray ();
			cubMap.AddObjects (new NSObject[] { right, left, top, bottom, front, back });
			ps.ParticleImage = cubMap;
			ps.FresnelExponent = 2;
			ps.ColliderNodes = new [] { FloorNode, MainWall };

			ps.EmitterShape = SCNBox.Create (200, 0, 100, 0);

			FieldEmitter.AddParticleSystem (ps);
			Scene.RootNode.AddChildNode (FieldEmitter);

			//field
			FieldOwner = SCNNode.Create ();
			FieldOwner.Position = new SCNVector3 (CameraHandle.Position.X, 50, dz + 5);

			var field = SCNPhysicsField.CreateRadialGravityField ();
			field.HalfExtent = new SCNVector3 (100, 100, 100);
			field.MinimumDistance = 20.0f;
			field.FalloffExponent = 0;
			FieldOwner.PhysicsField = field;
			FieldOwner.PhysicsField.Strength = 0.0f;
			Scene.RootNode.AddChildNode (FieldOwner);
		}
开发者ID:W3SS,项目名称:mac-ios-samples,代码行数:67,代码来源:GameViewController.cs


注:本文中的NSMutableArray.AddObjects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。