private void SetFactionColor(ref Color color, CompFactionColor compF) { if (this.wearer != null) { FactionDefUniform udef = this.wearer.Faction.def as FactionDefUniform; if (udef != null) { if ((compF != null && compF.CProps.UseCamouflageColor)) { color = CamouflageColorsUtility.CamouflageColors[1]; } else { color = udef.FactionColor2; } } } else { CompColorable comp = this.GetComp <CompColorable>(); if (comp != null && comp.Active) { color = comp.Color; } } }
public void AddColorEntry(Faction faction) { FactionDefUniform udef = faction.def as FactionDefUniform; if (udef != null && !this.FactionColorList.Any(x => x.Faction == faction)) { this.FactionColorList.Add(new FactionColorEntry(faction, udef.FactionColor1, udef.FactionColor2)); } }
public void GetFactionColors() { if (FirstSpawned) { if (this.GetComp <CompEquippable>().PrimaryVerb.CasterPawn != null) { Pawn holder = this.GetComp <CompEquippable>().PrimaryVerb.CasterPawn; if (holder != null && holder.Faction.def.GetType() == typeof(FactionDefUniform)) { FactionDefUniform facdef = holder.Faction.def as FactionDefUniform; col1 = facdef.FactionColor1; col2 = facdef.FactionColor2; } else { col1 = this.DrawColor; col2 = this.DrawColorTwo; } } FirstSpawned = false; } drawSize.x = meshSize.y; drawSize.y = meshSize.z; }