- Home /
Question by
susmithacanny · Jun 09, 2020 at 03:49 PM ·
execsvexcelreport
Problem collect data to .csv in .exe unity extension
Why I can't get the report in csv when I build my unity to .exe ? When it's still in unity I can get the report in csv but when it is in .exe type I can't get the report. I use this code:
using UnityEngine;
using UnityEditor;
public static class MyTools
{
[MenuItem("My Tools/Add to Report %F1")]
static void DEV_AppendToReport()
{
CSVManager.AppendToReport(
new string[4]
{
"lalala",
Input.mousePosition.x.ToString(),
Input.mousePosition.y.ToString(),
Input.mousePosition.z.ToString()
}
);
EditorApplication.Beep();
}
[MenuItem("My Tools/Reset to Report %F12")]
static void DEV_ResetReport()
{
CSVManager.CreateReport();
EditorApplication.Beep();
}
}
Comment
I don't really understand your question.
Do you expect the CTRL + F1 & CTRL + F12 to work in your Windows build?
First of all, I suppose the script is in an Editor
folder, otherwise, you would not be able to compile. Every script in this folder won't be part of the build.
Then, every class defined in the UnityEditor
namespace can't work in a build, thus, you can't use $$anonymous$$enuItem
nor EditorApplication
attribute & classe.