Files
WulaFallenEmpireRW/Source/WulaFallenEmpire/BuildingComp/WULA_SkyfallerCaller/WULA_SkyfallerFactioncs/CompSkyfallerFaction.cs
2025-11-28 23:53:52 +08:00

31 lines
861 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using RimWorld;
using Verse;
namespace WulaFallenEmpire
{
public class CompSkyfallerFaction : ThingComp
{
public CompProperties_SkyfallerFaction Props => (CompProperties_SkyfallerFaction)props;
public Faction GetFactionForPrefab()
{
// 如果指定了派系定义,使用该派系
if (Props.factionDef != null)
{
Faction faction = Find.FactionManager.FirstFactionOfDef(Props.factionDef);
if (faction != null)
return faction;
}
// 如果没有指定派系定义,根据设置决定
if (Props.usePlayerFactionIfNull)
{
return Faction.OfPlayer;
}
// 如果都不满足,返回 null使用默认行为
return null;
}
}
}