public Viridion (GameState state, AIManager aiManager, RendererContext rendererContext, CompositorColorCorrectionNode colorCorrectionNode) { viridionEmitter = new ViridionParticleEmitter (); ViridionGameState = state; particleViridion = new ParticleSceneObject (viridionEmitter.ParticleCount); particleViridion.Priority = 7002; state.Scene.AddObject (particleViridion); viridionEmitter.Init (particleViridion, rendererContext); ViridionEntity = EntityFactory.Instance.CreateWith ("Viridion." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem), typeof(LightSystem) }); ViridionEntity.GetComponent<ParticleComponent> ().Emitter = viridionEmitter; ViridionEntity.GetComponent<ParticleComponent> ().Particle = particleViridion; var light = ViridionEntity.GetComponent<LightComponent> ().Light; light = new FreezingArcher.Renderer.Scene.Light (FreezingArcher.Renderer.Scene.LightType.PointLight); light.On = true; light.Color = new FreezingArcher.Math.Color4 (0.6f, 0.6f, 0.6f, 1.0f); light.PointLightLinearAttenuation = 0.4f; light.PointLightConstantAttenuation = 0.7f; light.PointLightExponentialAttenuation = 0.008f; ViridionEntity.GetComponent<LightComponent> ().Light = light; state.Scene.AddLight (light); RigidBody ghostBody = new RigidBody (new SphereShape (1.2f)); ghostBody.AffectedByGravity = false; ghostBody.AllowDeactivation = false; ghostBody.Mass = 20; ViridionEntity.GetComponent<PhysicsComponent> ().RigidBody = ghostBody; ViridionEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; ViridionEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (ghostBody); ViridionEntity.GetComponent<ArtificialIntelligenceComponent>().AIManager = aiManager; ViridionEntity.GetComponent<ArtificialIntelligenceComponent>().ArtificialIntelligence = new ViridionAI (ViridionEntity, state, colorCorrectionNode); aiManager.RegisterEntity (ViridionEntity); }
public FenFire (GameState state, AIManager aiManager, RendererContext rendererContext) { ghostEmitter = new FenFireParticleEmitter (); particleGhost = new ParticleSceneObject (ghostEmitter.ParticleCount); particleGhost.Priority = 7092; state.Scene.AddObject (particleGhost); ghostEmitter.Init (particleGhost, rendererContext); GhostGameState = state; GhostEntity = EntityFactory.Instance.CreateWith ("FenFire." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem), typeof(LightSystem) }); GhostEntity.GetComponent<ParticleComponent> ().Emitter = ghostEmitter; GhostEntity.GetComponent<ParticleComponent> ().Particle = particleGhost; var light = GhostEntity.GetComponent<LightComponent> ().Light; light = new FreezingArcher.Renderer.Scene.Light (FreezingArcher.Renderer.Scene.LightType.PointLight); light.On = true; light.Color = new FreezingArcher.Math.Color4 (0.0f, 0.0f, 0.6f, 1.0f); light.PointLightLinearAttenuation = 0.4f; light.PointLightConstantAttenuation = 0.7f; light.PointLightExponentialAttenuation = 0.008f; GhostEntity.GetComponent<LightComponent> ().Light = light; state.Scene.AddLight (light); RigidBody ghostBody = new RigidBody (new SphereShape (0.4f)); ghostBody.AffectedByGravity = false; ghostBody.AllowDeactivation = false; ghostBody.Mass = 20; GhostEntity.GetComponent<PhysicsComponent> ().RigidBody = ghostBody; GhostEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; GhostEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (ghostBody); GhostEntity.GetComponent<ArtificialIntelligenceComponent>().AIManager = aiManager; GhostEntity.GetComponent<ArtificialIntelligenceComponent>().ArtificialIntelligence = new FenFireAI (GhostEntity, state); aiManager.RegisterEntity (GhostEntity); }