Exemple #1
0
        public static BallisticProjectile CreateNew(EntityInstancePlugin plugin, ILevelManager level)
        {
            var newInstance = new BallisticProjectile(level);

            plugin.Entity.AddComponent(newInstance);
            return(newInstance);
        }
Exemple #2
0
            public static StDefaultComponent SaveState(BallisticProjectile ballisticProjectile)
            {
                var storedProjectile = new StBallisticProjectile
                {
                    Enabled  = ballisticProjectile.Enabled,
                    Movement = ballisticProjectile.Movement.ToStVector3()
                };

                return(new StDefaultComponent {
                    BallisticProjectile = storedProjectile
                });
            }
Exemple #3
0
            public override void StartLoading()
            {
                if (storedData.ComponentCase != StDefaultComponent.ComponentOneofCase.BallisticProjectile)
                {
                    throw new ArgumentException("Invalid component type data passed to loader", nameof(storedData));
                }

                var storedBallisticProjectile = storedData.BallisticProjectile;


                BallisticProjectile = new BallisticProjectile(level,
                                                              storedBallisticProjectile.Movement.ToVector3(),
                                                              storedBallisticProjectile.Enabled);
            }