예제 #1
0
        /// <summary>Refreshes the texture of the creature's sprite if the texture it has is different from the one in the skin mapping</summary>
        internal static void UpdateSkin(Character creature)
        {
            if (!ModApi.IsInDatabase(creature) && !ModApi.IsStray(creature) && !ModApi.IsWildHorse(creature))
            {
                return;
            }

            AnimalSkin skin = GetSkin(creature);

            if (skin != null && creature.Sprite.textureName.Value != skin.AssetKey)
            {
                int[] spriteInfo = ModApi.GetSpriteInfo(creature);
                creature.Sprite = new AnimatedSprite(skin.AssetKey, spriteInfo[0], spriteInfo[1], spriteInfo[2]);
            }
        }