示例#1
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModNPC> .Register(this);

            npc.type    = NPCLoader.ReserveNPCID();
            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.NPCName.{Name}");

            NPCLoader.npcs.Add(this);

            Type type         = GetType();
            var  autoloadHead = type.GetAttribute <AutoloadHead>();

            if (autoloadHead != null)
            {
                Mod.AddNPCHeadTexture(npc.type, HeadTexture);
            }
            var autoloadBossHead = type.GetAttribute <AutoloadBossHead>();

            if (autoloadBossHead != null)
            {
                Mod.AddBossHeadTexture(BossHeadTexture, npc.type);
            }
        }