Chman / Moments

A quick GIF replay recorder for Unity
zlib License
856 stars 118 forks source link

Error doing Setup() #4

Closed ritamaia closed 7 years ago

ritamaia commented 7 years ago

Hi! I want to change the Record Time at runtime so i use Setup to set the buffersize, but it always gives me this error:

ArgumentException: Object type System.Single cannot be converted to target type: System.Int32
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:148)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
Moments.ReflectionUtils`1[Moments.Recorder].ConstrainRange[Int32] (System.Linq.Expressions.Expression`1 fieldAccess, Single value) (at Assets/Moments Recorder/Scripts/ReflectionUtils.cs:78)
Moments.Recorder.Setup (Boolean autoAspect, Int32 width, Int32 height, Single fps, Single bufferSize, Int32 repeat, Int32 quality) (at Assets/Moments Recorder/Scripts/Recorder.cs:174)
RecordChromaController.SetRecorder () (at Assets/01_Scripts/App/RecordChromaController.cs:75)
RecordChromaController.Start () (at Assets/01_Scripts/App/RecordChromaController.cs:37)

This is what im doing:

m_Recorder.Setup(true, 720, 405, 15f, 4f, -1, 15);

Thanks!

Chman commented 7 years ago

Good catch, that should be fixed now 👍