Exemplo n.º 1
0
        public void AddBossHeadTexture(string texture)
        {
            int slot = NPCHeadLoader.ReserveBossHeadSlot(texture);

            NPCHeadLoader.bossHeads[texture] = slot;
            ModLoader.GetTexture(texture);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Assigns a head texture that can be used by NPCs on the map.
        /// </summary>
        /// <param name="texture">The texture.</param>
        /// <param name="npcType">An optional npc id for NPCID.Sets.BossHeadTextures</param>
        public void AddBossHeadTexture(string texture, int npcType = -1)
        {
            if (!loading)
            {
                throw new Exception("AddBossHeadTexture can only be called from Mod.Load or Mod.Autoload");
            }

            int slot = NPCHeadLoader.ReserveBossHeadSlot(texture);

            NPCHeadLoader.bossHeads[texture] = slot;
            ModContent.GetTexture(texture);
            if (npcType >= 0)
            {
                NPCHeadLoader.npcToBossHead[npcType] = slot;
            }
        }