public SupportPowerManager(ActorInitializer init) { Self = init.Self; TechTree = Self.Trait <TechTree>(); RadarPings = Exts.Lazy(() => init.World.WorldActor.TraitOrDefault <RadarPings>()); init.World.ActorAdded += ActorAdded; init.World.ActorRemoved += ActorRemoved; }
protected override void Created(Actor self) { var playerActor = self.Info.Name == "player" ? self : self.Owner.PlayerActor; techTree = playerActor.Trait <TechTree>(); base.Created(self); }
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { techTree = newOwner.PlayerActor.Trait <TechTree>(); if (Info.ResetOnOwnerChange) { faction = newOwner.Faction.InternalName; } Update(); }
public GrantConditionOnPrerequisiteManager(ActorInitializer init) { self = init.Self; techTree = self.Trait <TechTree>(); }