コード例 #1
0
        protected override void Init(MyObjectBuilder_DefinitionBase objectBuilder)
        {
            base.Init(objectBuilder);

            var builder = (MyObjectBuilder_CharacterDefinition)objectBuilder;
            Name = builder.Name;
            Model = builder.Model;
            ReflectorTexture = builder.ReflectorTexture;
            LeftGlare = builder.LeftGlare;
            RightGlare = builder.RightGlare;
            LeftLightBone = builder.LeftLightBone;
            RightLightBone = builder.RightLightBone;
            LightOffset = builder.LightOffset;
            LightGlareSize = builder.LightGlareSize;
            HeadBone = builder.HeadBone;
            Camera3rdBone = builder.Camera3rdBone;
            LeftHandIKStartBone = builder.LeftHandIKStartBone;
            LeftHandIKEndBone= builder.LeftHandIKEndBone;
            RightHandIKStartBone= builder.RightHandIKStartBone;
            RightHandIKEndBone= builder.RightHandIKEndBone;
            WeaponBone = builder.WeaponBone;
            LeftHandItemBone = builder.LeftHandItemBone;
            RighHandItemBone = builder.RightHandItemBone;
            Skeleton = builder.Skeleton;
            LeftForearmBone = builder.LeftForearmBone;
            LeftUpperarmBone = builder.LeftUpperarmBone;
            RightForearmBone = builder.RightForearmBone;
            RightUpperarmBone = builder.RightUpperarmBone;
            SpineBone = builder.SpineBone;
            BendMultiplier1st = builder.BendMultiplier1st;
            BendMultiplier3rd = builder.BendMultiplier3rd;
            MaterialsDisabledIn1st = builder.MaterialsDisabledIn1st;
            FeetIKEnabled = builder.FeetIKEnabled;
            ModelRootBoneName = builder.ModelRootBoneName;
            LeftHipBoneName = builder.LeftHipBoneName;
            LeftKneeBoneName = builder.LeftKneeBoneName;
            LeftAnkleBoneName = builder.LeftAnkleBoneName;
            RightHipBoneName = builder.RightHipBoneName;
            RightKneeBoneName = builder.RightKneeBoneName;
            RightAnkleBoneName = builder.RightAnkleBoneName;
            UsesAtmosphereDetector = builder.UsesAtmosphereDetector;
            NeedsOxygen = builder.NeedsOxygen;
            OxygenConsumptionMultiplier = builder.OxygenConsumptionMultiplier;
            OxygenConsumption = builder.OxygenConsumption;
            PressureLevelForLowDamage = builder.PressureLevelForLowDamage;
            DamageAmountAtZeroPressure = builder.DamageAmountAtZeroPressure;
            RagdollDataFile = builder.RagdollDataFile;
            //HelmetVariation = builder.HelmetVariation;
            JumpSoundName = builder.JumpSoundName;
            JetpackIdleSoundName = builder.JetpackIdleSoundName;
            JetpackRunSoundName = builder.JetpackRunSoundName;
            CrouchDownSoundName = builder.CrouchDownSoundName;
            CrouchUpSoundName = builder.CrouchUpSoundName;
            PainSoundName = builder.PainSoundName;
            SuffocateSoundName = builder.SuffocateSoundName;
            DeathSoundName = builder.DeathSoundName;
            DeathBySuffocationSoundName = builder.DeathBySuffocationSoundName;
            IronsightActSoundName = builder.IronsightActSoundName;
            IronsightDeactSoundName = builder.IronsightDeactSoundName;
            FastFlySoundName = builder.FastFlySoundName;
            HelmetOxygenNormalSoundName = builder.HelmetOxygenNormalSoundName;
            HelmetOxygenLowSoundName = builder.HelmetOxygenLowSoundName;
            HelmetOxygenCriticalSoundName = builder.HelmetOxygenCriticalSoundName;
            HelmetOxygenNoneSoundName = builder.HelmetOxygenNoneSoundName;
            LoopingFootsteps = builder.LoopingFootsteps;
            VisibleOnHud = builder.VisibleOnHud;
            UsableByPlayer = builder.UsableByPlayer;
            RagdollRootBody = builder.RagdollRootBody;
            InitialAnimation = builder.InitialAnimation;
            PhysicalMaterial = builder.PhysicalMaterial;
            JumpForce = builder.JumpForce;

            FeetIKSettings = new Dictionary<MyCharacterMovementEnum,MyFeetIKSettings>();
            if (builder.IKSettings != null)
            {
                foreach (var feetSettings in builder.IKSettings)
                {
                    
                    string[] states = feetSettings.MovementState.Split(',');
                    
                    foreach (string stateSet in states) 
                    {
                        string stateDef = stateSet.Trim();
                        if (stateDef != "")
                        {
                            Debug.Assert(Enum.GetNames(typeof(MyCharacterMovementEnum)).Contains(stateDef), "State " + stateDef + " is not defined in Character Movement States");
                            MyCharacterMovementEnum state;
                            if (Enum.TryParse(stateDef, true, out state))
                            {
                                MyFeetIKSettings fSettings = new MyFeetIKSettings();
                                fSettings.Enabled = feetSettings.Enabled;
                                fSettings.AboveReachableDistance = feetSettings.AboveReachableDistance;
                                fSettings.BelowReachableDistance = feetSettings.BelowReachableDistance;
                                fSettings.VerticalShiftDownGain = feetSettings.VerticalShiftDownGain;
                                fSettings.VerticalShiftUpGain = feetSettings.VerticalShiftUpGain;
                                fSettings.FootSize = new Vector3(feetSettings.FootWidth, feetSettings.AnkleHeight, feetSettings.FootLenght);
                                FeetIKSettings.Add(state, fSettings);
                            }
                        }
                    }
                }
            }

	        SuitResourceStorage = builder.SuitResourceStorage;
            Jetpack = builder.Jetpack;

            if (builder.BoneSets != null)
            {
                BoneSets = builder.BoneSets.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
            }

            if (builder.BoneLODs != null)
            {
                BoneLODs = builder.BoneLODs.ToDictionary(x => Convert.ToSingle(x.Name), x => x.Bones.Split(' '));
            }

            if (builder.AnimationMappings != null)
            {
                AnimationNameToSubtypeName = builder.AnimationMappings.ToDictionary(mapping => mapping.Name, mapping => mapping.AnimationSubtypeName);
            }

            if (builder.RagdollBonesMappings != null)
            {
                RagdollBonesMappings = builder.RagdollBonesMappings.ToDictionary(x => x.Name, x => new RagdollBoneSet(x.Bones, x.CollisionRadius));
            }

            if (builder.RagdollPartialSimulations != null)
            {
                RagdollPartialSimulations = builder.RagdollPartialSimulations.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
            }

            Mass = builder.Mass;
            ImpulseLimit = builder.ImpulseLimit;

            VerticalPositionFlyingOnly = builder.VerticalPositionFlyingOnly;
            UseOnlyWalking = builder.UseOnlyWalking;
                
            MaxSlope = builder.MaxSlope;
            MaxSprintSpeed = builder.MaxSprintSpeed;
            
            MaxRunSpeed = builder.MaxRunSpeed;
            MaxBackrunSpeed = builder.MaxBackrunSpeed;
            MaxRunStrafingSpeed = builder.MaxRunStrafingSpeed;
            
            MaxWalkSpeed = builder.MaxWalkSpeed;
            MaxBackwalkSpeed = builder.MaxBackwalkSpeed;
            MaxWalkStrafingSpeed = builder.MaxWalkStrafingSpeed;
            
            MaxCrouchWalkSpeed = builder.MaxCrouchWalkSpeed;
            MaxCrouchBackwalkSpeed = builder.MaxCrouchBackwalkSpeed;
            MaxCrouchStrafingSpeed = builder.MaxCrouchStrafingSpeed;
            
            CharacterHeadSize = builder.CharacterHeadSize;
            CharacterHeadHeight = builder.CharacterHeadHeight;
            CharacterCollisionScale = builder.CharacterCollisionScale;
            CharacterCollisionWidth = builder.CharacterCollisionWidth;
            CharacterCollisionHeight = builder.CharacterCollisionHeight;
            CharacterCollisionCrouchHeight = builder.CharacterCollisionCrouchHeight;

            if (builder.Inventory == null)
            {
                InventoryDefinition = new MyObjectBuilder_InventoryDefinition();
            }           
            else
            {
                InventoryDefinition = builder.Inventory;
            }

            if (builder.EnabledComponents != null)
                EnabledComponents = builder.EnabledComponents.Split(' ').ToList();

            EnableSpawnInventoryAsContainer = builder.EnableSpawnInventoryAsContainer;        
            if (EnableSpawnInventoryAsContainer)
            {
                Debug.Assert(builder.InventorySpawnContainerId.HasValue, "Enabled spawning inventory as container, but type id is null");
                if (builder.InventorySpawnContainerId.HasValue)
                {
                    InventorySpawnContainerId = builder.InventorySpawnContainerId.Value;
                }
                SpawnInventoryOnBodyRemoval = builder.SpawnInventoryOnBodyRemoval;
            }

            LootingTime = builder.LootingTime;
            DeadBodyShape = builder.DeadBodyShape;
            AnimationController = builder.AnimationController;
            MaxForce = builder.MaxForce;
        }
コード例 #2
0
        protected override void Init(MyObjectBuilder_DefinitionBase objectBuilder)
        {
            base.Init(objectBuilder);

            var builder = (MyObjectBuilder_CharacterDefinition)objectBuilder;

            Name                        = builder.Name;
            Model                       = builder.Model;
            ReflectorTexture            = builder.ReflectorTexture;
            LeftGlare                   = builder.LeftGlare;
            RightGlare                  = builder.RightGlare;
            LeftLightBone               = builder.LeftLightBone;
            RightLightBone              = builder.RightLightBone;
            LightOffset                 = builder.LightOffset;
            LightGlareSize              = builder.LightGlareSize;
            HeadBone                    = builder.HeadBone;
            Camera3rdBone               = builder.Camera3rdBone;
            LeftHandIKStartBone         = builder.LeftHandIKStartBone;
            LeftHandIKEndBone           = builder.LeftHandIKEndBone;
            RightHandIKStartBone        = builder.RightHandIKStartBone;
            RightHandIKEndBone          = builder.RightHandIKEndBone;
            WeaponBone                  = builder.WeaponBone;
            LeftHandItemBone            = builder.LeftHandItemBone;
            RighHandItemBone            = builder.RightHandItemBone;
            Skeleton                    = builder.Skeleton;
            LeftForearmBone             = builder.LeftForearmBone;
            LeftUpperarmBone            = builder.LeftUpperarmBone;
            RightForearmBone            = builder.RightForearmBone;
            RightUpperarmBone           = builder.RightUpperarmBone;
            SpineBone                   = builder.SpineBone;
            BendMultiplier1st           = builder.BendMultiplier1st;
            BendMultiplier3rd           = builder.BendMultiplier3rd;
            MaterialsDisabledIn1st      = builder.MaterialsDisabledIn1st;
            FeetIKEnabled               = builder.FeetIKEnabled;
            ModelRootBoneName           = builder.ModelRootBoneName;
            LeftHipBoneName             = builder.LeftHipBoneName;
            LeftKneeBoneName            = builder.LeftKneeBoneName;
            LeftAnkleBoneName           = builder.LeftAnkleBoneName;
            RightHipBoneName            = builder.RightHipBoneName;
            RightKneeBoneName           = builder.RightKneeBoneName;
            RightAnkleBoneName          = builder.RightAnkleBoneName;
            UsesAtmosphereDetector      = builder.UsesAtmosphereDetector;
            UsesReverbDetector          = builder.UsesReverbDetector;
            NeedsOxygen                 = builder.NeedsOxygen;
            OxygenConsumptionMultiplier = builder.OxygenConsumptionMultiplier;
            OxygenConsumption           = builder.OxygenConsumption;
            PressureLevelForLowDamage   = builder.PressureLevelForLowDamage;
            DamageAmountAtZeroPressure  = builder.DamageAmountAtZeroPressure;
            RagdollDataFile             = builder.RagdollDataFile;
            //HelmetVariation = builder.HelmetVariation;
            JumpSoundName                 = builder.JumpSoundName;
            JetpackIdleSoundName          = builder.JetpackIdleSoundName;
            JetpackRunSoundName           = builder.JetpackRunSoundName;
            CrouchDownSoundName           = builder.CrouchDownSoundName;
            CrouchUpSoundName             = builder.CrouchUpSoundName;
            PainSoundName                 = builder.PainSoundName;
            SuffocateSoundName            = builder.SuffocateSoundName;
            DeathSoundName                = builder.DeathSoundName;
            DeathBySuffocationSoundName   = builder.DeathBySuffocationSoundName;
            IronsightActSoundName         = builder.IronsightActSoundName;
            IronsightDeactSoundName       = builder.IronsightDeactSoundName;
            FastFlySoundName              = builder.FastFlySoundName;
            HelmetOxygenNormalSoundName   = builder.HelmetOxygenNormalSoundName;
            HelmetOxygenLowSoundName      = builder.HelmetOxygenLowSoundName;
            HelmetOxygenCriticalSoundName = builder.HelmetOxygenCriticalSoundName;
            HelmetOxygenNoneSoundName     = builder.HelmetOxygenNoneSoundName;
            MovementSoundName             = builder.MovementSoundName;
            LoopingFootsteps              = builder.LoopingFootsteps;
            VisibleOnHud      = builder.VisibleOnHud;
            UsableByPlayer    = builder.UsableByPlayer;
            RagdollRootBody   = builder.RagdollRootBody;
            InitialAnimation  = builder.InitialAnimation;
            PhysicalMaterial  = builder.PhysicalMaterial;
            JumpForce         = builder.JumpForce;
            RotationToSupport = builder.RotationToSupport;

            FeetIKSettings = new Dictionary <MyCharacterMovementEnum, MyFeetIKSettings>();
            if (builder.IKSettings != null)
            {
                foreach (var feetSettings in builder.IKSettings)
                {
                    string[] states = feetSettings.MovementState.Split(',');

                    foreach (string stateSet in states)
                    {
                        string stateDef = stateSet.Trim();
                        if (stateDef != "")
                        {
                            Debug.Assert(Enum.GetNames(typeof(MyCharacterMovementEnum)).Contains(stateDef), "State " + stateDef + " is not defined in Character Movement States");
                            MyCharacterMovementEnum state;
                            if (Enum.TryParse(stateDef, true, out state))
                            {
                                MyFeetIKSettings fSettings = new MyFeetIKSettings();
                                fSettings.Enabled = feetSettings.Enabled;
                                fSettings.AboveReachableDistance = feetSettings.AboveReachableDistance;
                                fSettings.BelowReachableDistance = feetSettings.BelowReachableDistance;
                                fSettings.VerticalShiftDownGain  = feetSettings.VerticalShiftDownGain;
                                fSettings.VerticalShiftUpGain    = feetSettings.VerticalShiftUpGain;
                                fSettings.FootSize = new Vector3(feetSettings.FootWidth, feetSettings.AnkleHeight, feetSettings.FootLenght);
                                FeetIKSettings.Add(state, fSettings);
                            }
                        }
                    }
                }
            }

            SuitResourceStorage = builder.SuitResourceStorage;
            Jetpack             = builder.Jetpack;

            if (builder.BoneSets != null)
            {
                BoneSets = builder.BoneSets.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
            }

            if (builder.BoneLODs != null)
            {
                BoneLODs = builder.BoneLODs.ToDictionary(x => Convert.ToSingle(x.Name), x => x.Bones.Split(' '));
            }

            if (builder.AnimationMappings != null)
            {
                AnimationNameToSubtypeName = builder.AnimationMappings.ToDictionary(mapping => mapping.Name, mapping => mapping.AnimationSubtypeName);
            }

            if (builder.RagdollBonesMappings != null)
            {
                RagdollBonesMappings = builder.RagdollBonesMappings.ToDictionary(x => x.Name, x => new RagdollBoneSet(x.Bones, x.CollisionRadius));
            }

            if (builder.RagdollPartialSimulations != null)
            {
                RagdollPartialSimulations = builder.RagdollPartialSimulations.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
            }

            Mass         = builder.Mass;
            ImpulseLimit = builder.ImpulseLimit;

            VerticalPositionFlyingOnly = builder.VerticalPositionFlyingOnly;
            UseOnlyWalking             = builder.UseOnlyWalking;

            MaxSlope       = builder.MaxSlope;
            MaxSprintSpeed = builder.MaxSprintSpeed;

            MaxRunSpeed         = builder.MaxRunSpeed;
            MaxBackrunSpeed     = builder.MaxBackrunSpeed;
            MaxRunStrafingSpeed = builder.MaxRunStrafingSpeed;

            MaxWalkSpeed         = builder.MaxWalkSpeed;
            MaxBackwalkSpeed     = builder.MaxBackwalkSpeed;
            MaxWalkStrafingSpeed = builder.MaxWalkStrafingSpeed;

            MaxCrouchWalkSpeed     = builder.MaxCrouchWalkSpeed;
            MaxCrouchBackwalkSpeed = builder.MaxCrouchBackwalkSpeed;
            MaxCrouchStrafingSpeed = builder.MaxCrouchStrafingSpeed;

            CharacterHeadSize              = builder.CharacterHeadSize;
            CharacterHeadHeight            = builder.CharacterHeadHeight;
            CharacterCollisionScale        = builder.CharacterCollisionScale;
            CharacterCollisionWidth        = builder.CharacterCollisionWidth;
            CharacterCollisionHeight       = builder.CharacterCollisionHeight;
            CharacterCollisionCrouchHeight = builder.CharacterCollisionCrouchHeight;

            if (builder.Inventory == null)
            {
                InventoryDefinition = new MyObjectBuilder_InventoryDefinition();
            }
            else
            {
                InventoryDefinition = builder.Inventory;
            }

            if (builder.EnabledComponents != null)
            {
                EnabledComponents = builder.EnabledComponents.Split(' ').ToList();
            }

            EnableSpawnInventoryAsContainer = builder.EnableSpawnInventoryAsContainer;
            if (EnableSpawnInventoryAsContainer)
            {
                Debug.Assert(builder.InventorySpawnContainerId.HasValue, "Enabled spawning inventory as container, but type id is null");
                if (builder.InventorySpawnContainerId.HasValue)
                {
                    InventorySpawnContainerId = builder.InventorySpawnContainerId.Value;
                }
                SpawnInventoryOnBodyRemoval = builder.SpawnInventoryOnBodyRemoval;
            }

            LootingTime         = builder.LootingTime;
            DeadBodyShape       = builder.DeadBodyShape;
            AnimationController = builder.AnimationController;
            MaxForce            = builder.MaxForce;
        }
コード例 #3
0
        protected override void Init(MyObjectBuilder_DefinitionBase objectBuilder)
        {
            base.Init(objectBuilder);
            MyObjectBuilder_CharacterDefinition definition = (MyObjectBuilder_CharacterDefinition)objectBuilder;

            this.Name                          = definition.Name;
            this.Model                         = definition.Model;
            this.ReflectorTexture              = definition.ReflectorTexture;
            this.LeftGlare                     = definition.LeftGlare;
            this.RightGlare                    = definition.RightGlare;
            this.LeftLightBone                 = definition.LeftLightBone;
            this.RightLightBone                = definition.RightLightBone;
            this.LightOffset                   = definition.LightOffset;
            this.LightGlareSize                = definition.LightGlareSize;
            this.HeadBone                      = definition.HeadBone;
            this.Camera3rdBone                 = definition.Camera3rdBone;
            this.LeftHandIKStartBone           = definition.LeftHandIKStartBone;
            this.LeftHandIKEndBone             = definition.LeftHandIKEndBone;
            this.RightHandIKStartBone          = definition.RightHandIKStartBone;
            this.RightHandIKEndBone            = definition.RightHandIKEndBone;
            this.WeaponBone                    = definition.WeaponBone;
            this.LeftHandItemBone              = definition.LeftHandItemBone;
            this.RighHandItemBone              = definition.RightHandItemBone;
            this.Skeleton                      = definition.Skeleton;
            this.LeftForearmBone               = definition.LeftForearmBone;
            this.LeftUpperarmBone              = definition.LeftUpperarmBone;
            this.RightForearmBone              = definition.RightForearmBone;
            this.RightUpperarmBone             = definition.RightUpperarmBone;
            this.SpineBone                     = definition.SpineBone;
            this.BendMultiplier1st             = definition.BendMultiplier1st;
            this.BendMultiplier3rd             = definition.BendMultiplier3rd;
            this.MaterialsDisabledIn1st        = definition.MaterialsDisabledIn1st;
            this.FeetIKEnabled                 = definition.FeetIKEnabled;
            this.ModelRootBoneName             = definition.ModelRootBoneName;
            this.LeftHipBoneName               = definition.LeftHipBoneName;
            this.LeftKneeBoneName              = definition.LeftKneeBoneName;
            this.LeftAnkleBoneName             = definition.LeftAnkleBoneName;
            this.RightHipBoneName              = definition.RightHipBoneName;
            this.RightKneeBoneName             = definition.RightKneeBoneName;
            this.RightAnkleBoneName            = definition.RightAnkleBoneName;
            this.UsesAtmosphereDetector        = definition.UsesAtmosphereDetector;
            this.UsesReverbDetector            = definition.UsesReverbDetector;
            this.NeedsOxygen                   = definition.NeedsOxygen;
            this.OxygenConsumptionMultiplier   = definition.OxygenConsumptionMultiplier;
            this.OxygenConsumption             = definition.OxygenConsumption;
            this.OxygenSuitRefillTime          = definition.OxygenSuitRefillTime;
            this.MinOxygenLevelForSuitRefill   = definition.MinOxygenLevelForSuitRefill;
            this.PressureLevelForLowDamage     = definition.PressureLevelForLowDamage;
            this.DamageAmountAtZeroPressure    = definition.DamageAmountAtZeroPressure;
            this.RagdollDataFile               = definition.RagdollDataFile;
            this.JumpSoundName                 = definition.JumpSoundName;
            this.JetpackIdleSoundName          = definition.JetpackIdleSoundName;
            this.JetpackRunSoundName           = definition.JetpackRunSoundName;
            this.CrouchDownSoundName           = definition.CrouchDownSoundName;
            this.CrouchUpSoundName             = definition.CrouchUpSoundName;
            this.PainSoundName                 = definition.PainSoundName;
            this.SuffocateSoundName            = definition.SuffocateSoundName;
            this.DeathSoundName                = definition.DeathSoundName;
            this.DeathBySuffocationSoundName   = definition.DeathBySuffocationSoundName;
            this.IronsightActSoundName         = definition.IronsightActSoundName;
            this.IronsightDeactSoundName       = definition.IronsightDeactSoundName;
            this.FastFlySoundName              = definition.FastFlySoundName;
            this.HelmetOxygenNormalSoundName   = definition.HelmetOxygenNormalSoundName;
            this.HelmetOxygenLowSoundName      = definition.HelmetOxygenLowSoundName;
            this.HelmetOxygenCriticalSoundName = definition.HelmetOxygenCriticalSoundName;
            this.HelmetOxygenNoneSoundName     = definition.HelmetOxygenNoneSoundName;
            this.MovementSoundName             = definition.MovementSoundName;
            this.MagnetBootsStartSoundName     = definition.MagnetBootsStartSoundName;
            this.MagnetBootsStepsSoundName     = definition.MagnetBootsStepsSoundName;
            this.MagnetBootsEndSoundName       = definition.MagnetBootsEndSoundName;
            this.MagnetBootsProximitySoundName = definition.MagnetBootsProximitySoundName;
            this.LoopingFootsteps              = definition.LoopingFootsteps;
            this.VisibleOnHud                  = definition.VisibleOnHud;
            this.UsableByPlayer                = definition.UsableByPlayer;
            this.RagdollRootBody               = definition.RagdollRootBody;
            this.InitialAnimation              = definition.InitialAnimation;
            this.PhysicalMaterial              = definition.PhysicalMaterial;
            this.JumpForce                     = definition.JumpForce;
            this.RotationToSupport             = definition.RotationToSupport;
            this.HUD = definition.HUD;
            this.EnableFirstPersonView        = definition.EnableFirstPersonView;
            this.BreathCalmSoundName          = definition.BreathCalmSoundName;
            this.BreathHeavySoundName         = definition.BreathHeavySoundName;
            this.OxygenChokeNormalSoundName   = definition.OxygenChokeNormalSoundName;
            this.OxygenChokeLowSoundName      = definition.OxygenChokeLowSoundName;
            this.OxygenChokeCriticalSoundName = definition.OxygenChokeCriticalSoundName;
            this.FeetIKSettings = new Dictionary <MyCharacterMovementEnum, MyFeetIKSettings>();
            if (definition.IKSettings != null)
            {
                MyObjectBuilder_MyFeetIKSettings[] iKSettings = definition.IKSettings;
                int index = 0;
                while (index < iKSettings.Length)
                {
                    MyObjectBuilder_MyFeetIKSettings settings = iKSettings[index];
                    char[]   separator = new char[] { ',' };
                    string[] strArray  = settings.MovementState.Split(separator);
                    int      num2      = 0;
                    while (true)
                    {
                        MyCharacterMovementEnum enum2;
                        if (num2 >= strArray.Length)
                        {
                            index++;
                            break;
                        }
                        string str = strArray[num2].Trim();
                        if ((str != "") && Enum.TryParse <MyCharacterMovementEnum>(str, true, out enum2))
                        {
                            MyFeetIKSettings settings2 = new MyFeetIKSettings {
                                Enabled = settings.Enabled,
                                AboveReachableDistance = settings.AboveReachableDistance,
                                BelowReachableDistance = settings.BelowReachableDistance,
                                VerticalShiftDownGain  = settings.VerticalShiftDownGain,
                                VerticalShiftUpGain    = settings.VerticalShiftUpGain,
                                FootSize = new Vector3(settings.FootWidth, settings.AnkleHeight, settings.FootLenght)
                            };
                            this.FeetIKSettings.Add(enum2, settings2);
                        }
                        num2++;
                    }
                }
            }
            this.SuitResourceStorage = definition.SuitResourceStorage;
            this.Jetpack             = definition.Jetpack;
            if (definition.BoneSets != null)
            {
                this.BoneSets = definition.BoneSets.ToDictionary <MyBoneSetDefinition, string, string[]>(x => x.Name, x => x.Bones.Split(new char[] { ' ' }));
            }
            if (definition.BoneLODs != null)
            {
                this.BoneLODs = definition.BoneLODs.ToDictionary <MyBoneSetDefinition, float, string[]>(x => Convert.ToSingle(x.Name), x => x.Bones.Split(new char[] { ' ' }));
            }
            if (definition.AnimationMappings != null)
            {
                this.AnimationNameToSubtypeName = definition.AnimationMappings.ToDictionary <MyMovementAnimationMapping, string, string>(mapping => mapping.Name, mapping => mapping.AnimationSubtypeName);
            }
            if (definition.RagdollBonesMappings != null)
            {
                this.RagdollBonesMappings = definition.RagdollBonesMappings.ToDictionary <MyRagdollBoneSetDefinition, string, RagdollBoneSet>(x => x.Name, x => new RagdollBoneSet(x.Bones, x.CollisionRadius));
            }
            if (definition.RagdollPartialSimulations != null)
            {
                this.RagdollPartialSimulations = definition.RagdollPartialSimulations.ToDictionary <MyBoneSetDefinition, string, string[]>(x => x.Name, x => x.Bones.Split(new char[] { ' ' }));
            }
            this.Mass         = definition.Mass;
            this.ImpulseLimit = definition.ImpulseLimit;
            this.VerticalPositionFlyingOnly = definition.VerticalPositionFlyingOnly;
            this.UseOnlyWalking             = definition.UseOnlyWalking;
            this.MaxSlope                       = definition.MaxSlope;
            this.MaxSprintSpeed                 = definition.MaxSprintSpeed;
            this.MaxRunSpeed                    = definition.MaxRunSpeed;
            this.MaxBackrunSpeed                = definition.MaxBackrunSpeed;
            this.MaxRunStrafingSpeed            = definition.MaxRunStrafingSpeed;
            this.MaxWalkSpeed                   = definition.MaxWalkSpeed;
            this.MaxBackwalkSpeed               = definition.MaxBackwalkSpeed;
            this.MaxWalkStrafingSpeed           = definition.MaxWalkStrafingSpeed;
            this.MaxCrouchWalkSpeed             = definition.MaxCrouchWalkSpeed;
            this.MaxCrouchBackwalkSpeed         = definition.MaxCrouchBackwalkSpeed;
            this.MaxCrouchStrafingSpeed         = definition.MaxCrouchStrafingSpeed;
            this.CharacterHeadSize              = definition.CharacterHeadSize;
            this.CharacterHeadHeight            = definition.CharacterHeadHeight;
            this.CharacterCollisionScale        = definition.CharacterCollisionScale;
            this.CharacterCollisionWidth        = definition.CharacterCollisionWidth;
            this.CharacterCollisionHeight       = definition.CharacterCollisionHeight;
            this.CharacterCollisionCrouchHeight = definition.CharacterCollisionCrouchHeight;
            this.CanCrouch                      = definition.CanCrouch;
            this.CanIronsight                   = definition.CanIronsight;
            this.InventoryDefinition            = (definition.Inventory != null) ? definition.Inventory : new MyObjectBuilder_InventoryDefinition();
            if (definition.EnabledComponents != null)
            {
                char[] separator = new char[] { ' ' };
                this.EnabledComponents = definition.EnabledComponents.Split(separator).ToList <string>();
            }
            this.EnableSpawnInventoryAsContainer = definition.EnableSpawnInventoryAsContainer;
            if (this.EnableSpawnInventoryAsContainer)
            {
                if (definition.InventorySpawnContainerId != null)
                {
                    this.InventorySpawnContainerId = new MyDefinitionId?(definition.InventorySpawnContainerId.Value);
                }
                this.SpawnInventoryOnBodyRemoval = definition.SpawnInventoryOnBodyRemoval;
            }
            this.LootingTime         = definition.LootingTime;
            this.DeadBodyShape       = definition.DeadBodyShape;
            this.AnimationController = definition.AnimationController;
            this.MaxForce            = definition.MaxForce;
            this.SuitConsumptionInTemperatureExtreme = definition.SuitConsumptionInTemperatureExtreme;
        }