Beispiel #1
0
        public override bool TriggerEvent(EventType Event, string[] args)
        {
            if (MyEffect.get() == null)
            {
                return(false);
            }
            else
            {
                if (SpecularParameter == null)
                {
                    SpecularParameter = MyEffect.findEffectParameter("Specular");
                    OldSpecular       = SpecularParameter.GetValueSingle();
                }
                if (ColorParameter == null)
                {
                    ColorParameter = MyEffect.findEffectParameter("Color");
                    OldColor       = ColorParameter.GetValueVector4();
                }
            }

            switch (Event)
            {
            case EventType.Kill:
                Dead.set(true);
                if (args.Count() > 0)
                {
                    float f = Logic.ParseF(args[0]);
                    if (f != 0)
                    {
                        ChangeSpeed.set(f);
                    }
                }
                return(true);

            case EventType.Revive:
                Dead.set(false);
                if (args.Count() > 0)
                {
                    float f = Logic.ParseF(args[0]);
                    if (f != 0)
                    {
                        ChangeSpeed.set(f);
                    }
                }
                return(true);
            }

            return(base.TriggerEvent(Event, args));
        }
 private void EffectChange()
 {
     DurationParameter = MyEffect.findEffectParameter("Duration");
     NeedDurationChange = true;
 }