TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Register()

override void Terraria.ModLoader.ModNPC.Register ( )
inlinesealedprotected

Definition at line 94 of file ModNPC.cs.

95 {
96 ModTypeLookup<ModNPC>.Register(this);
97 NPC.type = NPCLoader.Register(this);
98 Type type = GetType();
99 if (type.GetAttribute<AutoloadHead>() != null)
100 {
101 base.Mod.AddNPCHeadTexture(NPC.type, HeadTexture);
102 }
103 if (type.GetAttribute<AutoloadBossHead>() != null)
104 {
105 base.Mod.AddBossHeadTexture(BossHeadTexture, NPC.type);
106 }
107 }
virtual string HeadTexture
The file name of this NPC's head texture file, to be used in autoloading.
Definition ModNPC.cs:39
virtual string BossHeadTexture
This file name of this NPC's boss head texture file, to be used in autoloading.
Definition ModNPC.cs:42
NPC NPC
The NPC object that this ModNPC controls.
Definition ModNPC.cs:23
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990

References Terraria.ModLoader.ModNPC.BossHeadTexture, Terraria.ModLoader.ModNPC.HeadTexture, Terraria.ModLoader.NPCLoader.Register(), and Terraria.NPC.type.

+ Here is the call graph for this function: