예제 #1
0
 public override void DrawInspectorGUI()
 {
     EditorGUILayout.PropertyField(this.mTurnOffWebCam, new GUIContent("Disable Vuforia Play Mode"), new GUILayoutOption[0]);
     if (!this.mTurnOffWebCam.boolValue)
     {
         if (!VuforiaRuntimeUtilities.CheckNativePluginSupport())
         {
             EditorGUILayout.HelpBox("An error occurred while trying to enable Vuforia play mode", MessageType.Error);
         }
         int      num         = 0;
         string[] deviceNames = this.GetDeviceNames();
         for (int i = 0; i < deviceNames.Length; i++)
         {
             if (deviceNames[i] != null && deviceNames[i].Equals(this.mDeviceNameSetInEditor.stringValue))
             {
                 num = i;
             }
         }
         if (WebCamEditor.sWebCamProfiles == null)
         {
             WebCamEditor.sWebCamProfiles = new WebCamProfile();
         }
         if (deviceNames[num].Equals("NO CAMERAS FOUND"))
         {
             EditorGUILayout.HelpBox("No camera connected!\nTo run your application using Play Mode, please connect a webcam to your computer.", MessageType.Warning);
         }
         else if (!WebCamEditor.sWebCamProfiles.ProfileAvailable(deviceNames[num]))
         {
             EditorGUILayout.HelpBox(string.Concat(new string[]
             {
                 "No webcam profile has been found for your webcam model: '",
                 deviceNames[num],
                 "'.\nA default profile will be used. \n\nWebcam profiles ensure that Play Mode performs well with your webcam. \nYou can create a custom profile for your camera by editing  '",
                 Path.Combine(Application.dataPath, "Editor/QCAR/WebcamProfiles/profiles.xml"),
                 "'."
             }), MessageType.Warning);
         }
         EditorGUILayout.Space();
         EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
         EditorGUILayout.PrefixLabel("Camera Device");
         int num2 = EditorGUILayout.Popup(num, deviceNames, new GUILayoutOption[0]);
         if (num2 != num && !deviceNames[num2].Equals("NO CAMERAS FOUND"))
         {
             this.mDeviceNameSetInEditor.stringValue = deviceNames[num2];
         }
         EditorGUILayout.EndHorizontal();
         EditorGUILayout.PropertyField(this.mFlipHorizontally, new GUIContent("Flip Horizontally"), new GUILayoutOption[0]);
         EditorGUILayout.Space();
         EditorGUILayout.HelpBox("Here you can enter the index of the layer that will be used internally for our render to texture functionality. the ARCamera will be configured to not draw this layer.", MessageType.None);
         EditorGUILayout.PropertyField(this.mRenderTextureLayer, new GUIContent("Render Texture Layer"), new GUILayoutOption[0]);
     }
 }