private DollColor(DollColorType type, string varName) { Type = type; Label = Enum.GetName(typeof(DollColorType), type); VarName = varName; Id = Shader.PropertyToID(varName); }
public static DollColor Get(DollColorType type) { switch (type) { case DollColorType.Primary: return(Primary); case DollColorType.Secondary: return(Secondary); case DollColorType.LeatherPrimary: return(LeatherPrimary); case DollColorType.LeatherSecondary: return(LeatherSecondary); case DollColorType.MetalPrimary: return(MetalPrimary); case DollColorType.MetalDark: return(MetalDark); case DollColorType.MetalSecondary: return(MetalSecondary); case DollColorType.Hair: return(Hair); case DollColorType.Skin: return(Skin); case DollColorType.Stubble: return(Stubble); case DollColorType.Scar: return(Scar); case DollColorType.BodyArt: return(BodyArt); case DollColorType.Eyes: return(Eyes); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public Color GetColor(DollPartType partType, DollColorType colorType) { var colorSetting = DollColor.Get(colorType); return(Materials[partType].GetColor(colorSetting.Id)); }
public void SetColor(DollPartType partType, DollColorType colorType, Color color) { var colorSetting = DollColor.Get(colorType); Materials[partType].SetColor(colorSetting.Id, color); }