Created
October 25, 2020 05:03
-
-
Save StephenHodgson/5af41e3f91ee8692d4ca20e9570c2c74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) XRTK. All rights reserved. | |
// Licensed under the MIT License. See LICENSE in the project root for license information. | |
using UnityEditor; | |
using XRTK.Editor.Profiles; | |
using XRTK.Examples.Demos.CustomExtensionServices; | |
namespace XRTK | |
{ | |
/// <summary> | |
/// This class demonstrates how to expose serialized fields into custom service profiles. | |
/// </summary> | |
[CustomEditor(typeof(DemoCustomExtensionServiceProfile))] | |
public class DemoCustomExtensionServiceProfileInspector : MixedRealityRegisteredServiceProvidersProfileInspector | |
{ | |
private SerializedProperty myCustomStringData; | |
protected override void OnEnable() | |
{ | |
// Initiaize the base class properites. | |
base.OnEnable(); | |
myCustomStringData = serializedObject.FindProperty(nameof(myCustomStringData)); | |
} | |
public override void OnInspectorGUI() | |
{ | |
// Call into the base class to render the data provider list | |
base.OnInspectorGUI(); | |
serializedObject.Update(); | |
EditorGUILayout.PropertyField(myCustomStringData); | |
serializedObject.ApplyModifiedProperties(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment