public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); // fast attack animation skeleton.SetMixDuration(null, "Attack", 0.0333f, 0.15f); }
public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); if (skeleton.SceneObject.AttachedWorldObject is ICharacter characterPilot) { skeleton.SceneObject .AddComponent <ComponentSkeletonMechAimingSoundManager>() .Setup(skeleton, characterPilot); } skeleton.AnimationEvent += SkeletonOnAnimationEventFootstepMovement; // little offset to ensure mech can properly behind a grass // cannot make it further without making it to z-fight with a player character skeleton.DrawOrderOffsetY = -0.3; skeleton.SetDefaultMixDuration(0.3f); // disable mix for these animations DisableMix("RunUp"); DisableMix("RunDown"); DisableMix("RunSide"); DisableMix("RunSideBackward"); var verticalSpeedMultiplier = this.AnimationVerticalMovemementSpeedMultiplier; skeleton.SetAnimationDefaultSpeed("RunUp", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunUpStart", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDown", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDownStart", verticalSpeedMultiplier); void DisableMix(string primaryName) { var startName = primaryName + "Start"; var startAbortName = startName + "Abort"; var minMix = 0.05f; skeleton.SetMixDuration(startName, minMix); skeleton.SetMixDuration(startAbortName, minMix); skeleton.SetMixDuration("Idle", startName, minMix); skeleton.SetMixDuration(startName, primaryName, 0); skeleton.SetMixDuration(startName, startAbortName, minMix); skeleton.SetMixDuration(startAbortName, "Idle", minMix); skeleton.SetAnimationDefaultSpeed(startAbortName, 1.3f); } }
public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); skeleton.DrawOrderOffsetY = -0.2; skeleton.AnimationEvent += SkeletonOnAnimationEventFootstep; // setup attack animations { var mixIn = 0.033333f; var mixOut = 0.15f; var mixInStatic = 0.15f; // fast mix-in into attacks, slower mix-out skeleton.SetMixDuration(null, "AttackRangedHorizontal", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackRangedHorizontal_Static", mixInStatic, mixOut); skeleton.SetMixDuration(null, "AttackRangedVertical", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackRangedVertical_Static", mixInStatic, mixOut); // fast mix between attacks skeleton.SetMixDuration("AttackRangedHorizontal", "AttackRangedVertical", mixIn, mixIn); skeleton.SetMixDuration("AttackRangedHorizontal_Static", "AttackRangedVertical_Static", mixIn, mixIn); // fast attack animation skeleton.SetMixDuration(null, "AttackAOE", 0.0333f, 0.1f); } var sceneObject = skeleton.SceneObject; if (sceneObject.AttachedWorldObject is not null) { ClientLighting.CreateLightSourceSpot( sceneObject, color: LightColors.PragmiumLuminescenceSource, size: 25, spritePivotPoint: (0.5, 0.5), positionOffset: (0, 0)); } }
public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); skeleton.SetMixDuration("Torch", 0.3f); }
public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); skeleton.SetDefaultMixDuration(0.3f); // setup attack animations { var mixIn = 0.033333f; var mixInStatic = 0.15f; var mixOut = 0.15f; // fast mix-in into attacks, slower mix-out skeleton.SetMixDuration(null, "AttackMeleeHorizontal", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackMeleeHorizontal_Static", mixInStatic, mixOut); skeleton.SetMixDuration(null, "AttackMeleeVertical", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackMeleeVertical_Static", mixInStatic, mixOut); // fast mix between attacks skeleton.SetMixDuration("AttackMeleeHorizontal", "AttackMeleeVertical", mixIn, mixIn); skeleton.SetMixDuration("AttackMeleeHorizontal_Static", "AttackMeleeVertical_Static", mixIn, mixIn); } // disable mix for these movement animations DisableMoveMix("RunUp"); DisableMoveMix("RunDown"); DisableMoveMix("RunSide"); DisableMoveMix("RunSideBackward"); var verticalSpeedMultiplier = 1.1f; skeleton.SetAnimationDefaultSpeed("RunUp", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunUpStart", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDown", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDownStart", verticalSpeedMultiplier); void DisableMoveMix(string primaryName) { var startName = primaryName + "Start"; var startAbortName = startName + "Abort"; var minMix = 0.05f; skeleton.SetMixDuration(startName, minMix); skeleton.SetMixDuration(startAbortName, minMix); skeleton.SetMixDuration("Idle", startName, minMix); skeleton.SetMixDuration(startName, primaryName, minMix); skeleton.SetMixDuration(startName, startAbortName, minMix); skeleton.SetMixDuration(startAbortName, "Idle", minMix); skeleton.SetAnimationDefaultSpeed(startAbortName, 1.3f); } }
public override void OnSkeletonCreated(IComponentSkeleton skeleton) { base.OnSkeletonCreated(skeleton); skeleton.RemoveAttachmentAnimationsForSlot("Weapon"); skeleton.SetDefaultMixDuration(0.3f); skeleton.SetMixDuration("Torch", 0.25f); skeleton.SetMixDuration("Torch2", 0.15f); skeleton.SetMixDuration("Fishing_In", 0.1f); skeleton.SetMixDuration("Fishing_Out", 0.1f); // instant transition from death to idle animation skeleton.SetMixDuration("Idle", "Death", secondsMixAB: 0.2f, secondsMixBA: 0); // setup attack animations { var mixIn = 0.033333f; var mixInStatic = 0.15f; var mixOut = 0.15f; // fast mix-in into attacks, slower mix-out skeleton.SetMixDuration(null, "AttackMeleeHorizontal", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackMeleeHorizontal_Static", mixInStatic, mixOut); skeleton.SetMixDuration(null, "AttackMeleeVertical", mixIn, mixOut); skeleton.SetMixDuration(null, "AttackMeleeVertical_Static", mixInStatic, mixOut); // fast mix between attacks skeleton.SetMixDuration("AttackMeleeHorizontal", "AttackMeleeVertical", mixIn, mixIn); skeleton.SetMixDuration("AttackMeleeHorizontal_Static", "AttackMeleeVertical_Static", mixIn, mixIn); } // disable mix for these movement animations DisableMoveMix("RunUp"); DisableMoveMix("RunDown"); DisableMoveMix("RunSide"); DisableMoveMix("RunSideBackward"); var verticalSpeedMultiplier = 1.1f; skeleton.SetAnimationDefaultSpeed("RunUp", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunUpStart", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDown", verticalSpeedMultiplier); skeleton.SetAnimationDefaultSpeed("RunDownStart", verticalSpeedMultiplier); void DisableMoveMix(string primaryName) { var startName = primaryName + "Start"; var startAbortName = startName + "Abort"; var minMix = 0.05f; skeleton.SetMixDuration(startName, minMix); skeleton.SetMixDuration(startAbortName, minMix); skeleton.SetMixDuration("Idle", startName, minMix); // in theory there should be no mixing but we have to apply some // as end state of the movement start animation is not always perfectly matching // the start state of the movement animation skeleton.SetMixDuration(startName, primaryName, minMix); skeleton.SetMixDuration(startName, startAbortName, minMix); skeleton.SetMixDuration(startAbortName, "Idle", minMix); skeleton.SetAnimationDefaultSpeed(startAbortName, 1.3f); } }