Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Build in Unity 2017.1.1f1 #75

Open
reillydonovan opened this issue Jan 31, 2018 · 2 comments
Open

Cannot Build in Unity 2017.1.1f1 #75

reillydonovan opened this issue Jan 31, 2018 · 2 comments

Comments

@reillydonovan
Copy link

Hi, when trying to build in Unity 2017.1.1f1 I am returned the following, Assets/RoomAliveToolkit/Scripts/RATSceneSetup.cs(3,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?

Any suggestions on how to properly build to a .exe for a room alive scene in Unity 2017?

Thanks!

-Reilly

@thundercarrot
Copy link
Collaborator

I'm not sure why we're seeing this issue only now, but it does make sense that you wouldn't have access to the UnityEditor namespace in a build. See
https://answers.unity.com/questions/316805/unityeditor-namespace-not-found.html
for example.

Can you try putting that file in the Editor folder and see if that fixes it?

I may not have time soon to take a look myself.

@jjhartmann
Copy link

jjhartmann commented Feb 1, 2018

I came across this same issue, and the fix was to wrap the UnityEditor code in a macro.

In RATSceneSetup.cs

Line: 3

#if UNITY_EDITOR
using UnityEditor;
#endif

and lines: 37-41

#if UNITY_EDITOR
        public void LoadDefault3DModels()
        {
            kinectModel = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/RoomAliveToolkit/Models/Kinect.obj");
            projectorModel = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/RoomAliveToolkit/Models/Projector.obj");
        }
#endif

In UnityUtilities.cs

Move line 81:

[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]

between the line "#if UNITY_EDITOR" and before the class:

public class ReadOnlyDrawer : PropertyDrawer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants