void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError("owner is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar>(owner); if (!(vals.Value is OpenCVForUnityPlayMakerActions.DoubleArray)) { LogError("vals is not initialized. Add Action \"newDoubleArray\"."); return; } System.Double[] wrapped_vals = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.DoubleArray, System.Double[]>(vals); wrapped_owner.set(wrapped_vals); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError("owner is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar>(owner); float[] float_vals = vals.floatValues; double[] casted_vals = new double[float_vals.Length]; float_vals.CopyTo(casted_vals, 0); wrapped_owner.set(casted_vals); for (int i = 0; i < casted_vals.Length; i++) { vals.Set(i, (float)casted_vals[i]); } vals.SaveChanges(); }