public override void ClientSetupItemInHand( IComponentSkeleton skeletonRenderer, string attachmentName, TextureResource textureResource) { skeletonRenderer.SetAttachmentSprite(this.SlotNameItemInHand, attachmentName, textureResource); skeletonRenderer.SetAttachment(this.SlotNameItemInHand, attachmentName); // set left hand to use special sprite (representing holding of the item in hand) skeletonRenderer.SetAttachment("HandLeft", "HandLeft2"); skeletonRenderer.SetAttachment("HandLeftEquipment", "HandLeft2Equipment"); }
public static void Setup( IComponentSkeleton skeletonRenderer, string attachmentName, TextureResource textureResource) { skeletonRenderer.SetAttachmentSprite(SlotNameWeapon, attachmentName, textureResource); skeletonRenderer.SetAttachment(SlotNameWeapon, attachmentName); // set left hand to use special sprite (representing holding of the item in hand) skeletonRenderer.SetAttachment(SlotNameHandLeft, "HandLeft2"); skeletonRenderer.SetAttachment(SlotNameHandLeft + "Equipment", "HandLeft2Equipment"); }
public virtual void ClientSetupItemInHand( IComponentSkeleton skeletonRenderer, string attachmentName, TextureResource textureResource) { skeletonRenderer.SetAttachmentSprite(this.SlotNameItemInHand, attachmentName, textureResource); skeletonRenderer.SetAttachment(this.SlotNameItemInHand, attachmentName); }
public override void ClientResetItemInHand(IComponentSkeleton skeletonRenderer) { skeletonRenderer.SetAttachmentSprite(this.SlotNameItemInHand, attachmentName: "WeaponMelee", textureResource: null); skeletonRenderer.SetAttachmentSprite(this.SlotNameItemInHand, attachmentName: "WeaponRifle", textureResource: null); skeletonRenderer.SetAttachment(this.SlotNameItemInHand, attachmentName: null); }
protected override void ClientSetupSkeletonAnimation( bool isActive, IItem item, ICharacter character, IComponentSkeleton skeletonRenderer, List <IClientComponent> skeletonComponents) { base.ClientSetupSkeletonAnimation(isActive, item, character, skeletonRenderer, skeletonComponents); if (!isActive) { return; } // create fire sprite renderer var sceneObject = skeletonRenderer.SceneObject; var fireRenderer = Client.Rendering.CreateSpriteRenderer( sceneObject, TextureResource.NoTexture, // draw origin is calculated so that the center // of the flame sprite will always stay on the end of the torch item spritePivotPoint: (0.5, 0.277), // please note: the torch X axis ("Weapon" slot) is oriented up because torch is held this way! positionOffset: (0.35, 0), scale: 0.9); var fireAnimator = sceneObject.AddComponent <ClientComponentSpriteSheetAnimator>(); fireAnimator.Setup( fireRenderer, ClientComponentSpriteSheetAnimator.CreateAnimationFrames(TextureAtlasFire), isLooped: true, frameDurationSeconds: 1 / 15.0, randomizeInitialFrame: true); var slotNameClone = "Weapon_Torch"; skeletonRenderer.CloneSlot("Weapon", slotNameClone); skeletonRenderer.SetAttachmentRenderer(slotNameClone, "WeaponMelee", fireRenderer, applyBoneRotation: false); skeletonRenderer.SetAttachment(slotNameClone, "WeaponMelee"); skeletonComponents.Add(fireRenderer); skeletonComponents.Add(fireAnimator); }
public virtual void ClientResetItemInHand(IComponentSkeleton skeletonRenderer) { skeletonRenderer.SetAttachment(this.SlotNameItemInHand, attachmentName: null); }
public static void Reset(IComponentSkeleton skeletonRenderer) { skeletonRenderer.SetAttachmentSprite(SlotNameWeapon, attachmentName: "WeaponMelee", textureResource: null); skeletonRenderer.SetAttachmentSprite(SlotNameWeapon, attachmentName: "WeaponRifle", textureResource: null); skeletonRenderer.SetAttachment(SlotNameWeapon, attachmentName: null); }