void Spawn(SpawnedEffect effect)
        {
            var fx = Parent.World.Renderer.Game.GetService <GameDataManager>().GetEffect(effect.Effect);

            if (fx == null)
            {
                return;
            }
            var pfx = fx.GetEffect(Parent.World.Renderer.ResourceManager);

            if (pfx == null)
            {
                return;
            }
            foreach (var fxhp in effect.Hardpoints)
            {
                var hp    = Parent.GetHardpoint(fxhp);
                var fxobj = new AttachedEffect(hp,
                                               new ParticleEffectRenderer(pfx)
                {
                    Index = renIndex++
                });
                Parent.ExtraRenderers.Add(fxobj.Effect);
                spawned.Add(fxobj);
            }
        }
예제 #2
0
        public static SpawnedEffect Read(NetPacketReader message)
        {
            var x = new SpawnedEffect()
            {
                ID     = message.GetVariableUInt32(),
                Effect = message.GetStringPacked()
            };

            x.Hardpoints = new string[message.GetVariableUInt32()];
            for (int i = 0; i < x.Hardpoints.Length; i++)
            {
                x.Hardpoints[i] = message.GetStringPacked();
            }
            return(x);
        }