Items with no label
3335 Discussions

SDK 2.0 unity build crash in Window

JChoi21
Beginner
2,879 Views

As you know, to get the proper scene for using Realsense, I clicked the file(:RealSenseTextures.unity) and opened it.@

It works very well, in latest unity (x64)

there are some warning message, but it works well.

However, I tried to build,

it does not work. (Fail to build)

How am i supposed to do?

Thank you in advance. @

0 Kudos
6 Replies
MartyG
Honored Contributor III
963 Views

Does it make a difference if you use the 'Add open scene' button to add your project's scene file to the build settings? On my own Unity project I always have my scene in this list.

0 Kudos
JChoi21
Beginner
963 Views

it does not work

0 Kudos
MartyG
Honored Contributor III
963 Views

I looked carefully at your case but I do not have SDK 2.0's version of Unity support set up on my own PC so I am unable to run tests. I apologize and hope a member of Intel's support team can help you with this later. Good luck!

0 Kudos
JChoi21
Beginner
963 Views

it seems that it is not a fault of Unity's

in my terms of view,

the given scene (by Realsense sdk 2.0) is "using UnityEditior"

so it work well in the test , however, it cannot be built.

Actually, i removed the code related with unityeditor, it can be built.

However, it crash down in a minute.

Thank you for your advice, I will try it later on.

0 Kudos
idata
Employee
963 Views

Hello qwerty.2944,

 

 

Building a game app cannot use the UnityEditor namespace. This namespace comes with the UnityEditor.dll assembly that is not shipped (and not compatible) with any build made by Unity. Scripts that use this namespace are only meant to be executed inside Unity Editor.

 

Therefore, need to create a new script in Assets/Editor folder and move below code to that script. Then, the Windows app can be built successfully.

 

-------

 

public class RealSenseDeviceInspectorEditor : Editor

 

{

 

public static void DrawHorizontal(string field, string value)

 

{

 

EditorGUILayout.BeginHorizontal();

 

{

 

EditorGUILayout.LabelField(field, GUILayout.Width(EditorGUIUtility.labelWidth - 4));

 

EditorGUILayout.SelectableLabel(value, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));

 

}

 

EditorGUILayout.EndHorizontal();

 

}

 

public override void OnInspectorGUI()

 

{

 

RealSenseDeviceInspector deviceInspector = (RealSenseDeviceInspector)target;

 

if (!deviceInspector.streaming)

 

return;

 

 

EditorGUILayout.Space();

 

var devName = deviceInspector.device.Info[CameraInfo.Name];

 

var devSerial = deviceInspector.device.Info[CameraInfo.SerialNumber];

 

DrawHorizontal("Device", devName);

 

DrawHorizontal("Device S/N", devSerial);

 

EditorGUILayout.Space();

 

foreach (var kvp in deviceInspector.sensors)

 

{

 

string sensorName = kvp.Key;

 

var sensor = kvp.Value;

 

EditorGUILayout.Space();

 

EditorGUILayout.LabelField(sensorName);

 

 

foreach (var opt in sensor.Options)

 

{

 

if(opt.IsCheckbox())

 

...
0 Kudos
Reply