Items with no label
3341 토론

SDK 2.0 unity build crash in Window

JChoi21
초급자
6,761 조회수

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 포인트
6 응답
MartyG
명예로운 기여자 III
4,845 조회수

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 포인트
JChoi21
초급자
4,845 조회수

it does not work

0 포인트
MartyG
명예로운 기여자 III
4,845 조회수

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 포인트
AVolo2
초보자
4,845 조회수
0 포인트
JChoi21
초급자
4,845 조회수

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 포인트
idata
직원
4,845 조회수

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 포인트
응답