BaseWebViewPrefabInspector.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using UnityEditor;
  17. namespace Vuplex.WebView {
  18. public abstract class BaseWebViewPrefabInspector : Editor {
  19. public override void OnInspectorGUI() {
  20. DocumentationLinkDrawer.DrawDocumentationLink(_getDocumentationLink());
  21. serializedObject.Update();
  22. EditorGUILayout.PropertyField(_initialUrl);
  23. EditorGUILayout.PropertyField(_initialResolution);
  24. EditorGUILayout.PropertyField(_scrollingSensitivity);
  25. serializedObject.ApplyModifiedProperties();
  26. DrawDefaultInspector();
  27. TroubleshootingLinkDrawer.DrawTroubleshootingLink();
  28. }
  29. protected abstract string _getDocumentationLink();
  30. SerializedProperty _initialResolution;
  31. SerializedProperty _initialUrl;
  32. SerializedProperty _scrollingSensitivity;
  33. void OnEnable() {
  34. _initialResolution = serializedObject.FindProperty("InitialResolution");
  35. _initialUrl = serializedObject.FindProperty("InitialUrl");
  36. _scrollingSensitivity = serializedObject.FindProperty("ScrollingSensitivity");
  37. }
  38. }
  39. }