public override void ReceiveCompSignal(string signal) { base.ReceiveCompSignal(signal); if (signal == "PowerTurnedOff") { if (JukeBoxCore.orignalSongList.Count <= 0) { JukeBoxCore.orignalSongList.AddRange(DefDatabase <SongDef> .AllDefs); } JukeBoxCore.RemoveJukeBox(this); } if (signal == "PowerTurnedOn") { JukeBoxCore.AddJukeBox(this); } }
public override void PostExposeData() { //이미 존재하는 개체 base.PostExposeData(); if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs) { if (JukeBoxCore.orignalSongList.Count > 0) { DefDatabase <SongDef> .Clear(); DefDatabase <SongDef> .Add(JukeBoxCore.orignalSongList); } JukeBoxCore.jukeBoxList.Clear(); } if (Scribe.mode == LoadSaveMode.PostLoadInit) { compPowerTrader = parent.GetComp <CompPowerTrader>(); if (compPowerTrader.PowerOn) { JukeBoxCore.AddJukeBox(this); } currentState = false; } }
public override void PostSpawnSetup(bool respawningAfterLoad) { base.PostSpawnSetup(respawningAfterLoad); JukeBoxCore.AddJukeBox(this); compPowerTrader = parent.GetComp <CompPowerTrader>(); }