예제 #1
0
        public override void execute(List <object> actuator, List <object> target)
        {
            controller.Possess(character);
            scene.Characters.Add(character);
            scene.GetActors().Add(character);
            scene.AddAiController(controller);

            Vector3 position = character.GetCenterPosition();
            Vector3 size     = character.GetSize();
            //Show grass particle effects when the character appears
            FoliageCutParticleEffectFactory foliageCutFactory =
                new FoliageCutParticleEffectFactory(new Vector2(position.X, position.Y + 20), (int)size.Length(), 600, new Vector2(0.8f, 1.3f), new Vector2(-0.5f, -1.5f) /*Vector2.Zero*/, 1f, 0f, Color.ForestGreen, Color.Brown, 400, rotVel: 0.75f);
            ParticleEffectManager foliageCutEffectManager = new ParticleEffectManager(ParticleConfig.FOLIAGE_CUT_TEXTURE, foliageCutFactory, 30, 200, false, BlendState.NonPremultiplied, effectDuration: 600);

            scene.ParticleEffects.Add(foliageCutEffectManager);
        }