public void ConfigureForMaterial(Material inMaterial) { if (inMaterial.HasProperty("_BaseColor")) { MainProperty = PropertyConfig.Create(Channel.Main, "_BaseColor"); } else if (inMaterial.HasProperty("_Color")) { MainProperty = PropertyConfig.Create(Channel.Main, "_Color"); } List <PropertyConfig> newProperties = new List <PropertyConfig>(); if (AdditionalProperties != null) { newProperties.AddRange(AdditionalProperties); } if (inMaterial.HasProperty("_EmissionColor")) { if ((inMaterial.globalIlluminationFlags & MaterialGlobalIlluminationFlags.AnyEmissive) != 0) { GenerateProperty(newProperties, Channel.Emissive, "_EmissionColor"); } } AdditionalProperties = newProperties.ToArray(); }
public static IPropertyConfig Create([NotNull] this IConfigBehavior behavior) { if (behavior is null) { throw new ArgumentNullException(nameof(behavior)); } return(PropertyConfig.Create(behavior)); }
static private void GenerateProperty(List <PropertyConfig> ioPropertyList, Channel inChannel, string inName) { foreach (var prop in ioPropertyList) { if (prop.Name == inName) { return; } } PropertyConfig config = PropertyConfig.Create(inChannel, inName); ioPropertyList.Add(config); }
public static IPropertyConfig Create(this ConfigType type, ConfigOptions options, String path) { return(PropertyConfig.Create(path, type, options)); }
public static IPropertyConfig Create(this ConfigType type, String path) { return(PropertyConfig.Create(path, type)); }
public static IPropertyConfig Create(this ConfigType type, ConfigOptions options) { return(PropertyConfig.Create(null, type, options)); }