public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            this.objectBuilder = objectBuilder;
            generator = Entity as Sandbox.ModAPI.Ingame.IMyGravityGeneratorSphere;
            added = false;
            generator.NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;

            /*
            if(generator != null && generator.BlockDefinition.SubtypeId == "NaturalGravityGenerator")
            {
                generator.NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;
            }
            else
            {
                generator = null;
            }
             */
        }
Пример #2
0
        private void CreateFromGG(Sandbox.ModAPI.Ingame.IMyGravityGeneratorSphere generator)
        {
            if (generator == null)
                throw new Exception("generator can not be null!");

            this.generator = generator;
            center = (generator.CubeGrid as IMyCubeGrid).GridIntegerToWorld(generator.Position);
        }