/// <summary> /// Adds "content" to the menu in a certain layout. <br/> /// If <c>CreateContentPane</c> has not been called yet, this method will immeddiately return. /// </summary> /// <param name="layout">The layout of the added content</param> /// <param name="navgraph">The navigation graph to place the selectables in.</param> /// <param name="action">The action that will get called to add the content</param> /// <returns></returns> public MenuBuilder AddContent(IContentLayout layout, INavigationGraph navgraph, Action <ContentArea> action) { if (this.Screen.content == null) { return(this); } action(new ContentArea(this.Screen.content.gameObject, layout, navgraph)); return(this); }
/// <summary> /// Creates a new <c>ContentArea</c>. /// </summary> /// <param name="obj">The object to place the added content in.</param> /// <param name="layout">The layout to apply to the content being added.</param> /// <param name="navGraph">The navigation graph to place the selectables in.</param> public ContentArea(GameObject obj, IContentLayout layout, INavigationGraph navGraph) { this.ContentObject = obj; this.Layout = layout; this.NavGraph = navGraph; }
/// <summary> /// Sets the default navigation graph to use for <c>AddContent</c> and <c>AddControls</c> calls. /// </summary> /// <param name="navGraph">The default navigation graph to set.</param> /// <returns></returns> public MenuBuilder SetDefaultNavGraph(INavigationGraph navGraph) { this.DefaultNavGraph = navGraph ?? new NullNavigationGraph(); return(this); }