public void AddSwatch(Color color, SwatchType type) { // Check for Bad Data if (color == null) { return; } // No Player Duplicates if (Swatches.FindIndex(i => i.color == color) >= 0) { return; } Swatch swatch = MakeSwatch(color); if (swatch == null) { return; } if (type == SwatchType.Player) { District.PlayerAddedColors.Add(ColorConversions.ConvertColorToVector3(color)); } else { District.DefaultAddedColors.Add(ColorConversions.ConvertColorToVector3(color)); } }
public void AssignColor(Color color) { if (District.DistrictBuildingData.ContainsKey(this.currentBuilding.guid)) { currentColors = District.DistrictBuildingData[this.currentBuilding.guid]; } else { currentColors = new Vector3[this.currentBuilding.fullMaterial.Count]; } currentColors[this.dropdown.value] = ColorConversions.ConvertColorToVector3(color); this.ApplyShader(this.currentBuilding.fullMaterial[this.dropdown.value]); this.currentBuilding.fullMaterial[this.dropdown.value].color = color; this.currentBuilding.useSharedMaterialIfPossible = false; AssignColorEvent(color); District.DistrictBuildingData[this.currentBuilding.guid] = this.currentColors; this.currentBuilding.UpdateMaterialSelection(); }