ReserveBackgroundSlot() static private method

static private ReserveBackgroundSlot ( ) : int
return int
コード例 #1
0
        /// <summary>
        /// Adds a texture to the list of background textures and assigns it a background texture slot.
        /// </summary>
        /// <param name="texture">The texture.</param>
        public void AddBackgroundTexture(string texture)
        {
            if (!loading)
            {
                throw new Exception("AddBackgroundTexture can only be called from Mod.Load or Mod.Autoload");
            }

            BackgroundTextureLoader.backgrounds[texture] = BackgroundTextureLoader.ReserveBackgroundSlot();
            ModContent.GetTexture(texture);
        }