public ExposableValueTuple <Color, Color> GetChannel(string channel) { if (this.ColorChannels.ContainsKey(channel)) { return(this.ColorChannels[channel]); } ThingDef_AlienRace alienProps = ((ThingDef_AlienRace)this.parent.def); AlienPartGenerator apg = alienProps.alienRace.generalSettings.alienPartGenerator; foreach (ColorChannelGenerator apgChannel in apg.colorChannels) { if (apgChannel.name == channel) { this.ColorChannels.Add(channel, new ExposableValueTuple <Color, Color>()); if (apgChannel.first != null) { this.ColorChannels[channel].first = this.GenerateColor(apgChannel.first); } if (apgChannel.second != null) { this.ColorChannels[channel].second = this.GenerateColor(apgChannel.second); } return(this.ColorChannels[channel]); } } return(new ExposableValueTuple <Color, Color>(Color.white, Color.white)); }
public override void PostSpawnSetup(bool respawningAfterLoad) { base.PostSpawnSetup(respawningAfterLoad: respawningAfterLoad); AlienPartGenerator apg = ((ThingDef_AlienRace)this.parent.def).alienRace.generalSettings.alienPartGenerator; this.customDrawSize = apg.customDrawSize; this.customPortraitDrawSize = apg.customPortraitDrawSize; }