private DollRange(DollRangeType type, string varName) { Type = type; Label = Enum.GetName(typeof(DollColorType), type); VarName = varName; Id = Shader.PropertyToID(varName); }
public static readonly DollRange Emission = new DollRange(DollRangeType.Emission, "_Emmision"); // sic "Emmision" public static DollRange Get(DollRangeType type) { switch (type) { case DollRangeType.Metallic: return(Metallic); case DollRangeType.Smoothness: return(Smoothness); case DollRangeType.BodyArtAmount: return(BodyArtAmount); case DollRangeType.Emission: return(Emission); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public float GetRangeFloat(DollPartType partType, DollRangeType rangeType) { var setting = DollRange.Get(rangeType); return(Materials[partType].GetFloat(setting.Id)); }
public void SetRangeFloat(DollPartType partType, DollRangeType rangeType, float value) { var setting = DollRange.Get(rangeType); Materials[partType].SetFloat(setting.Id, value); }