private void DoInstantiateAt(ComponentAdapter childAdapter, int index, bool useAsInstance) { if (!childAdapter.Instantiated) { childAdapter.DoInstantiate(useAsInstance); } var container = (IContentChildList)Component; if (null != container) { container.AddContentChildAt(childAdapter.Component, index); } }
/// <summary> /// Instantiates /// </summary> /// <param name="childAdapter"></param> /// <param name="register"></param> public virtual void DoInstantiate(ComponentAdapter childAdapter, bool register) { if (!childAdapter.Instantiated) { childAdapter.DoInstantiate(register); } var container = Component as IContentChildList; if (null == container) { Debug.LogError(Component.GetType().Name + " cannot host children"); return; } container.AddContentChild(childAdapter.Component); }
/// <summary> /// Instantiates /// </summary> /// <param name="childAdapter"></param> /// <param name="register"></param> override public void DoInstantiate(ComponentAdapter childAdapter, bool register) { if (!childAdapter.Instantiated) { childAdapter.DoInstantiate(register); } var scroller = (Scroller)Component; if (null != scroller) { var group = childAdapter.Component as GroupBase; if (null == group) { throw new Exception(string.Format(@"Scroller can have only a single child, extending the GroupBase ({0} supplied)", childAdapter.Component)); } scroller.Viewport = group; } }