/// <summary> /// Called when the default entities of a faction are initialized. /// </summary> /// <param name="factionSlot">FactionSlot instance of the faction whose default entities are initialized.</param> private void OnFactionDefaultEntitiesInit(FactionSlot factionSlot) { if (factionSlot.FactionMgr == FactionMgr) //if the faction slot is handled by this component { foreach (NPCComponent comp in GetComponentsInChildren <NPCComponent>()) //go through the NPC components and init them { npcCompDic.Add(comp.GetType(), comp); comp.Init(this.gameMgr, this, this.FactionMgr); } CustomEvents.OnNPCFactionInit(FactionMgr.Slot); } }