Exemplo n.º 1
0
        protected override void UnloadData()
        {
            IsInit = false;
            RealisticThrustersInstalled = false;
            ThrustLogicDraw?.Clear();

            Log.Close();
            Instance = null;
        }
Exemplo n.º 2
0
        public override void LoadData()
        {
            Instance      = this;
            Log.ModName   = MOD_NAME;
            Log.AutoClose = false;

            IsPlayer = !(MyAPIGateway.Session.IsServer && MyAPIGateway.Utilities.IsDedicated);

            try
            {
                // add mount points to vanilla thruster's ends for the reverser blocks to be placeable

                SetThrustMountPoints("LargeBlockLargeAtmosphericThrust",
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0f, 1f), End = new Vector2(0.1f, 2f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(2.9f, 1f), End = new Vector2(3f, 2f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(1, 2.9f), End = new Vector2(2f, 3f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(1f, 0.1f), End = new Vector2(2f, 0f),
                });

                SetThrustMountPoints("SmallBlockLargeAtmosphericThrust",
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0f, 1f), End = new Vector2(0.1f, 2f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(2.9f, 1f), End = new Vector2(3f, 2f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(1, 2.9f), End = new Vector2(2f, 3f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(1f, 0.1f), End = new Vector2(2f, 0f),
                });

                SetThrustMountPoints("LargeBlockSmallAtmosphericThrust",
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0f, 0.4f), End = new Vector2(0.05f, 0.6f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.4f, 0.95f), End = new Vector2(0.6f, 1f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.95f, 0.4f), End = new Vector2(1f, 0.6f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.4f, 0f), End = new Vector2(0.6f, 0.05f),
                });

                SetThrustMountPoints("SmallBlockSmallAtmosphericThrust",
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0f, 0.4f), End = new Vector2(0.05f, 0.6f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.4f, 0.95f), End = new Vector2(0.6f, 1f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.95f, 0.4f), End = new Vector2(1f, 0.6f),
                },
                                     new MyObjectBuilder_CubeBlockDefinition.MountPoint()
                {
                    Side = BlockSideEnum.Front, Start = new Vector2(0.4f, 0f), End = new Vector2(0.6f, 0.05f),
                });
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }