SEToolbox.Models.Import3DAsteroidModel.Load C# (CSharp) Method

Load() public method

public Load ( VRage.MyPositionAndOrientation characterPosition ) : void
characterPosition VRage.MyPositionAndOrientation
return void
        public void Load(MyPositionAndOrientation characterPosition)
        {
            CharacterPosition = characterPosition;
        }

Usage Example

コード例 #1
0
        public void ImportAsteroidModelExecuted()
        {
            var model = new Import3DAsteroidModel();
            var position = ThePlayerCharacter != null ? ThePlayerCharacter.PositionAndOrientation.Value : new MyPositionAndOrientation(Vector3D.Zero, Vector3.Forward, Vector3.Up);
            model.Load(position);
            var loadVm = new Import3DAsteroidViewModel(this, model);

            var result = _dialogService.ShowDialog<WindowImportAsteroidModel>(this, loadVm);
            if (result == true && loadVm.IsValidEntity)
            {
                IsBusy = true;
                _dataModel.CollisionCorrectEntity(loadVm.NewEntity);
                var structure = _dataModel.AddEntity(loadVm.NewEntity);
                ((StructureVoxelModel)structure).SourceVoxelFilepath = loadVm.SourceFile; // Set the temporary file location of the Source Voxel, as it hasn't been written yet.
                if (_preSelectedStructure != null)
                    SelectedStructure = _preSelectedStructure;

                if (loadVm.SaveWhenFinsihed)
                {
                    _dataModel.SaveCheckPointAndSandBox();
                }

                IsBusy = false;
            }
        }
Import3DAsteroidModel