Exemplo n.º 1
0
        public override void DrawInspectorGUI(object target)
        {
            IMixedRealityTeleportSystem teleport = (IMixedRealityTeleportSystem)target;

            EditorGUILayout.LabelField("Event Listeners", EditorStyles.boldLabel);

            if (!Application.isPlaying)
            {
                EditorGUILayout.HelpBox("Event listeners will be populated once you enter play mode.", MessageType.Info);
                return;
            }

            if (teleport.EventListeners.Count == 0)
            {
                EditorGUILayout.LabelField("(None found)", EditorStyles.miniLabel);
            }
            else
            {
                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                foreach (GameObject listener in teleport.EventListeners)
                {
                    EditorGUILayout.ObjectField(listener.name, listener, typeof(GameObject), true);
                }
                EditorGUILayout.EndVertical();
            }
        }
 /// <summary>
 /// Resets all cached system references to null
 /// </summary>
 public static void ResetCacheReferences()
 {
     serviceCache.Clear();
     boundarySystem         = null;
     cameraSystem           = null;
     diagnosticsSystem      = null;
     focusProvider          = null;
     inputSystem            = null;
     raycastProvider        = null;
     sceneSystem            = null;
     spatialAwarenessSystem = null;
     teleportSystem         = null;
 }
 private static void ResetCacheReferenceFromType(Type serviceType)
 {
     if (typeof(IMixedRealityBoundarySystem).IsAssignableFrom(serviceType))
     {
         boundarySystem = null;
     }
     else if (typeof(IMixedRealityCameraSystem).IsAssignableFrom(serviceType))
     {
         cameraSystem = null;
     }
     else if (typeof(IMixedRealityDiagnosticsSystem).IsAssignableFrom(serviceType))
     {
         diagnosticsSystem = null;
     }
     else if (typeof(IMixedRealityFocusProvider).IsAssignableFrom(serviceType))
     {
         focusProvider = null;
     }
     else if (typeof(IMixedRealityInputSystem).IsAssignableFrom(serviceType))
     {
         inputSystem = null;
     }
     else if (typeof(IMixedRealityRaycastProvider).IsAssignableFrom(serviceType))
     {
         raycastProvider = null;
     }
     else if (typeof(IMixedRealitySceneSystem).IsAssignableFrom(serviceType))
     {
         sceneSystem = null;
     }
     else if (typeof(IMixedRealitySpatialAwarenessSystem).IsAssignableFrom(serviceType))
     {
         sceneSystem = null;
     }
     else if (typeof(IMixedRealityTeleportSystem).IsAssignableFrom(serviceType))
     {
         teleportSystem = null;
     }
 }