public static BallisticProjectile CreateNew(EntityInstancePlugin plugin, ILevelManager level) { var newInstance = new BallisticProjectile(level); plugin.Entity.AddComponent(newInstance); return(newInstance); }
public static StDefaultComponent SaveState(BallisticProjectile ballisticProjectile) { var storedProjectile = new StBallisticProjectile { Enabled = ballisticProjectile.Enabled, Movement = ballisticProjectile.Movement.ToStVector3() }; return(new StDefaultComponent { BallisticProjectile = storedProjectile }); }
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); }