protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_AnimationDefinition; MyDebug.AssertDebug(ob != null); this.AnimationModel = ob.AnimationModel; this.ClipIndex = ob.ClipIndex; this.InfluenceArea = ob.InfluenceArea; this.AllowInCockpit = ob.AllowInCockpit; this.AllowWithWeapon = ob.AllowWithWeapon; if (!string.IsNullOrEmpty(ob.SupportedSkeletons)) SupportedSkeletons = ob.SupportedSkeletons.Split(' '); this.Loop = ob.Loop; if (!ob.LeftHandItem.TypeId.IsNull) { this.LeftHandItem = ob.LeftHandItem; } }
protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_AnimationDefinition; MyDebug.AssertDebug(ob != null); this.AnimationModel = ob.AnimationModel; this.ClipIndex = ob.ClipIndex; this.InfluenceArea = ob.InfluenceArea; this.AllowInCockpit = ob.AllowInCockpit; this.AllowWithWeapon = ob.AllowWithWeapon; if (!string.IsNullOrEmpty(ob.SupportedSkeletons)) { SupportedSkeletons = ob.SupportedSkeletons.Split(' '); } this.Loop = ob.Loop; if (!ob.LeftHandItem.TypeId.IsNull) { this.LeftHandItem = ob.LeftHandItem; } }
void OnPlayButtonClick(MyGuiControlButton sender) { MyBonesArea bonesArea = 0; foreach (var control in Controls) { if (control is MyGuiControlCheckbox) { MyGuiControlCheckbox chb = control as MyGuiControlCheckbox; if (chb.IsChecked && chb.UserData != null) { bonesArea |= (MyBonesArea)chb.UserData; } } } MySession.LocalCharacter.PlayCharacterAnimation( m_animationCombo.GetSelectedValue().ToString(), m_loopCheckbox.IsChecked, MyPlayAnimationMode.Play, m_blendSlider.Value ); }