internal void InitializeStructInfo()
        {
            var type = Value?.GetType() ?? FallbackType;

            if (StructInfo != null && type == m_lastStructType)
            {
                return;
            }

            if (StructInfo != null)
            {
                DestroySubContent();
                //// changing types, destroy subcontent
                //for (int i = 0; i < m_subContentParent.transform.childCount; i++)
                //{
                //    var child = m_subContentParent.transform.GetChild(i);
                //    GameObject.Destroy(child.gameObject);
                //}

                //m_UIConstructed = false;
            }

            m_lastStructType = type;

            StructInfo = StructInfoFactory.Create(type);

            if (m_subContentParent.activeSelf)
            {
                ConstructSubcontent();
            }
        }
예제 #2
0
        internal void InitializeStructInfo()
        {
            var type = Value?.GetType() ?? FallbackType;

            if (StructInfo != null && type == m_lastStructType)
            {
                return;
            }

            if (StructInfo != null)
            {
                DestroySubContent();
            }

            m_lastStructType = type;

            StructInfo = StructInfoFactory.Create(type);

            if (m_subContentParent.activeSelf)
            {
                ConstructSubcontent();
            }
        }