Esempio n. 1
0
        void MakeExhaustNode()
        {
            var emitter = (ExhaustNode)NSKeyedUnarchiver.UnarchiveFile(NSBundle.MainBundle.PathForResource("exhaust", "sks"));

            // Hard coded position at the back of the ship.
            emitter.Position = new CGPoint(0, -40);
            emitter.Name     = "exhaust";

            // Make the scene the target node because the ship is moving around in the scene. Exhaust particles
            // should be spawned based on the ship, but should otherwise exist independently of the ship.

            emitter.TargetNode = Scene;

            // The exhaust node is always emitting particles, but the alpha of the particles is adjusted depending on whether
            // the engines are engaged or not. This adds a subtle effect when the ship is idling.

            engineEngagedAlpha    = emitter.ParticleAlpha;
            emitter.ParticleAlpha = engineIdleAlpha;

            AddChild(emitter);
            exhaustNode = emitter;
        }
Esempio n. 2
0
		void MakeExhaustNode()
		{
			var emitter = (ExhaustNode)NSKeyedUnarchiver.UnarchiveFile (NSBundle.MainBundle.PathForResource ("exhaust", "sks"));

			// Hard coded position at the back of the ship.
			emitter.Position = new CGPoint(0, -40);
			emitter.Name = "exhaust";

			// Make the scene the target node because the ship is moving around in the scene. Exhaust particles
			// should be spawned based on the ship, but should otherwise exist independently of the ship.

			emitter.TargetNode = Scene;

			// The exhaust node is always emitting particles, but the alpha of the particles is adjusted depending on whether
			// the engines are engaged or not. This adds a subtle effect when the ship is idling.

			engineEngagedAlpha = emitter.ParticleAlpha;
			emitter.ParticleAlpha = engineIdleAlpha;

			AddChild (emitter);
			exhaustNode = emitter;
		}