Пример #1
0
        private void ItemBuilder_TestEffect(object sender, RoutedEffectEventArgs ea)
        {
            if (ea.TimeLineData == null)
            {
                return;
            }

            EffectGroup effectGroup = new EffectGroup();

            foreach (TimeLineEffect timeLineEffects in ea.TimeLineData.Entries)
            {
                Effect effect = null;

                if (timeLineEffects.Effect != null)
                {
                    effect = timeLineEffects.Effect.GetPrimaryEffect();
                }

                if (effect != null)
                {
                    effect.timeOffsetMs = (int)Math.Round(timeLineEffects.Start.TotalMilliseconds);
                    effectGroup.Add(effect);
                }
            }

            string serializedObject = JsonConvert.SerializeObject(effectGroup);

            HubtasticBaseStation.TriggerEffect(serializedObject);
        }
Пример #2
0
        private void BtnTestEffect_Click(object sender, RoutedEventArgs e)
        {
            Effect activeEffect = effectBuilder.GetEffect();

            if (activeEffect == null)
            {
                return;
            }
            string serializedObject = JsonConvert.SerializeObject(activeEffect);

            HubtasticBaseStation.TriggerEffect(serializedObject);
        }
Пример #3
0
        private void BtnTestGroupEffect_Click(object sender, RoutedEventArgs e)
        {
            EffectGroup effectGroup = new EffectGroup();

            effectGroup.Add(effectBuilder.GetEffect());

            effectGroup.Add(new SoundEffect("Blood Squirting Weapon Impact.mp3"));

            string serializedObject = JsonConvert.SerializeObject(effectGroup);

            HubtasticBaseStation.TriggerEffect(serializedObject);
        }
Пример #4
0
        private void BtnTestGroupEffect_Click(object sender, RoutedEventArgs e)
        {
            EffectGroup effectGroup = new EffectGroup();

            foreach (TimeLineEffect timeLineEffect in groupEffectBuilder.Entries)
            {
                Effect effect = null;

                if (timeLineEffect.Effect != null)
                {
                    effect = timeLineEffect.Effect.GetPrimaryEffect();
                }

                if (effect != null)
                {
                    effect.timeOffsetMs = (int)Math.Round(timeLineEffect.Start.TotalMilliseconds);
                    effectGroup.Add(effect);
                }
            }

            string serializedObject = JsonConvert.SerializeObject(effectGroup);

            HubtasticBaseStation.TriggerEffect(serializedObject);
        }