/// <summary> /// Register a new context for that will appear on the top level menu. /// </summary> /// <param name="context">Interface that will be used to build UI when this context is activated</param> /// <param name="subContextID">An ID that is passed back to the context. Useful if this interface supports more than one context</param> /// <param name="setCurrent">If true this context will be immediately activiated</param> public void RegisterContext(IOVRInspectorContext context, int subContextID, bool setCurrent = false) { OVRInspectorContextDetails contextDetails = new OVRInspectorContextDetails(context, subContextID); contextList.Add(contextDetails); if (currentContext == null || setCurrent) { ContextActivated(contextDetails); } UpdateTopMenu(); }
/// <summary> /// Construct from an existing UI panel /// </summary> public OVRInspectorContextDetails(GameObject panel) { context = null; this.panel = panel; }
public GameObject panel; // If present context should be null /// <summary> /// Construct from IOVRInspectorContext which can build the UI /// </summary> public OVRInspectorContextDetails(IOVRInspectorContext context, int subContext) { this.context = context; this.subContext = subContext; panel = null; }