public void SetColor(int hash, Color value) { SerializedPassProperty result = null; if (!propertiesById.TryGetValue(hash, out result)) { Debug.LogError("The property " + hash + " doesn't exist. Use string overload to create one."); return; } if (result.PropertyType != PropertyType.Color) { Debug.LogError("The property " + hash + " is not a color property"); return; } result.ColorValue = value; }
public Color GetColor(int hash) { SerializedPassProperty result = null; if (!propertiesById.TryGetValue(hash, out result)) { Debug.LogError("The property " + hash + " doesn't exist"); return(Color.black); } if (result.PropertyType == PropertyType.Color) { return(result.ColorValue); } else { return(Color.black); } }
public void SetFloat(int hash, float value) { propertiesIsDirty = true; SerializedPassProperty result = null; if (!propertiesById.TryGetValue(hash, out result)) { Debug.LogError("The property " + hash + " doesn't exist. Use string overload to create one."); return; } if (result.PropertyType != PropertyType.Float) { Debug.LogError("The property " + hash + " is not a float property"); return; } result.FloatValue = value; }
public void SetColor(string name, Color value) { SerializedPassProperty result = null; if (!propertiesByName.TryGetValue(name, out result)) { result = new SerializedPassProperty(); result.PropertyType = PropertyType.Color; propertiesByName.Add(name, result); propertiesById.Add(Shader.PropertyToID(name), result); } if (result.PropertyType != PropertyType.Color) { Debug.LogError("The property " + name + " is not a color property."); return; } result.ColorValue = value; }
public Color GetColor(string name) { SerializedPassProperty result = null; if (!propertiesByName.TryGetValue(name, out result)) { Debug.LogError("The property " + name + " doesn't exist"); return(Color.black); } if (result.PropertyType == PropertyType.Color) { return(result.ColorValue); } else { Debug.LogError("The property " + name + " is not a color property"); return(Color.black); } }
public void SetFloat(string name, float value) { SerializedPassProperty result = null; if (!propertiesByName.TryGetValue(name, out result)) { result = new SerializedPassProperty(); result.PropertyType = PropertyType.Float; propertiesByName.Add(name, result); propertiesById.Add(Shader.PropertyToID(name), result); } if (result.PropertyType != PropertyType.Float) { Debug.LogError("The property " + name + " is not a float property"); return; } result.FloatValue = value; }
public float GetFloat(int hash) { SerializedPassProperty result = null; if (!propertiesById.TryGetValue(hash, out result)) { Debug.LogError("The property " + hash + " is doesn't exist"); return(0.0f); } if (result.PropertyType == PropertyType.Float || result.PropertyType == PropertyType.Range) { return(result.FloatValue); } else { Debug.LogError("The property " + hash + " is not a float property"); return(0.0f); } }
public float GetFloat(string name) { SerializedPassProperty result = null; if (!propertiesByName.TryGetValue(name, out result)) { Debug.LogError("The property " + name + " doesn't exist"); return(0.0f); } if (result.PropertyType == PropertyType.Float || result.PropertyType == PropertyType.Range) { return(result.FloatValue); } else { Debug.LogError("The property " + name + " is not a float property"); return(0.0f); } }
public Vector4 GetVector(int hash) { SerializedPassProperty result = null; if (!propertiesById.TryGetValue(hash, out result)) { Debug.LogError("The property " + hash + " doesn't exist"); return(Vector4.zero); } if (result.PropertyType == PropertyType.Vector) { return(result.VectorValue); } else { Debug.LogError("The property " + hash + " is not a vector property"); return(Vector4.zero); } }
public Vector4 GetVector(string name) { SerializedPassProperty result = null; if (!propertiesByName.TryGetValue(name, out result)) { Debug.LogError("The property " + name + " doesn't exist"); return(Vector4.zero); } if (result.PropertyType == PropertyType.Vector) { return(result.VectorValue); } else { Debug.LogError("The property " + name + " is not a vector property"); return(Vector4.zero); } }