コード例 #1
0
        /// <summary> Registers a new gore with the provided texture. </summary>
        public static void AddGoreFromTexture <TGore>(Mod mod, string texture) where TGore : ModGore, new()
        {
            if (mod == null)
            {
                throw new ArgumentNullException(nameof(mod));
            }

            if (texture == null)
            {
                throw new ArgumentNullException(nameof(texture));
            }

            if (!mod.loading)
            {
                throw new Exception(Language.GetTextValue("tModLoader.LoadErrorNotLoading"));
            }

            mod.AddContent(new TGore {
                nameOverride    = Path.GetFileNameWithoutExtension(texture),
                textureOverride = texture
            });
        }