Skip to content

Instantly share code, notes, and snippets.

@cabbibo
Created February 25, 2016 03:35
Show Gist options
  • Save cabbibo/0c988d4e6eb93a66e92a to your computer and use it in GitHub Desktop.
Save cabbibo/0c988d4e6eb93a66e92a to your computer and use it in GitHub Desktop.
foreach (var field in typeof(ComputeUniforms).GetFields()){
if(Sliders[field.Name] != null ){
FloatUniform u = (FloatUniform)field.GetValue( computeUniforms );
GameObject slider = (GameObject)Sliders[field.Name];
float v = slider.GetComponent<Slider>().Value;
float final = v * (u.high - u.low) + u.low;
u.value = final;
//var f = typeof(FloatUniform).value;
//f.SetValue( u , final );
field.SetValue( computeUniforms , u );
}else{
print( "NO SLIDERSSS");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment