コード例 #1
0
        //Some things have not been implimented fully!
        #region Add HierarchyObjects Methods
        public HierarchyObjectElementV2 AddHierarchyObjectWithoutUpdate(HierarchyObjectV2 hierarchyObject)
        {
            var hierarchyObjectElement = CreateHierarchy(hierarchyObject);

            _parentElements.Add(hierarchyObjectElement);
            return(hierarchyObjectElement);
        }
コード例 #2
0
        private HierarchyObjectElementV2 CreateHierarchy(HierarchyObjectV2 hierarchyObject, int depthOffset)
        {
            var bufferedHierarchyObject = hierarchyElementArchetypeBuffer[hierarchyObject.bufferedHierarchyType].bufferedHierarchyObjectElements.GetUnusedPooledObjects(1)[0];

            var hierarchyObjectElement = bufferedHierarchyObject.hierarchyObjectElement;

            hierarchyObjectElement.elementName = hierarchyObject.elementName;
            hierarchyObjectElement.bufferedHierarchyObjectElement = bufferedHierarchyObject;
            hierarchyObjectElement.bufferedHierarchyType          = hierarchyObject.bufferedHierarchyType;

            if (hierarchyObject.childrenObjects.Count > 0)
            {
                //identifity the corresponding strucutre, initalise from that strucutre,
                for (int i = 0; i < hierarchyObject.childrenObjects.Count; i++)
                {
                    var childHierarchyObject = CreateHierarchy(hierarchyObject.childrenObjects[i], depthOffset + 1);
                    hierarchyObjectElement.AddHeirarchyElement(childHierarchyObject);
                }

                hierarchyObjectElement.enableArrowElement = true;
            }
            else
            {
                hierarchyObjectElement.enableArrowElement = false;
            }

            hierarchyObjectElement.elementHeight = hierarchyAnimationValues.hierarchyElementsHeight;
            hierarchyObjectElement.AddTabElements(bufferedHierarchyTabElements.GetUnusedPooledObjects(depthOffset));
            //bufferedHierarchyObject.hierarchyObjectElement.ResetHierarchyElement();

            return(hierarchyObjectElement);
        }
コード例 #3
0
        public HierarchyObjectElementV2 AddHierarchyObject(HierarchyObjectV2 hierarchyObject, int siblingIndex)
        {
            var hierarchyObjectElement = AddHierarchyObjectWithoutUpdate(hierarchyObject, siblingIndex);

            hierarchyContentElement.UpdateRootElements();
            hierarchyContentElement.UpdateChildrenElements(hierarchyObjectElement);
            return(hierarchyObjectElement);
        }
コード例 #4
0
        public HierarchyObjectElementV2 AddHierarchyObjectWithoutUpdate(HierarchyObjectV2 hierarchyObject, int siblingIndex)
        {
            var hierarchyObjectElement = CreateHierarchy(hierarchyObject);

            _parentElements.Insert(Mathf.Clamp(siblingIndex, 0, _parentElements.Count), hierarchyObjectElement);
            hierarchyObjectElement.rectTransform.SetSiblingIndex(siblingIndex);
            return(hierarchyObjectElement);
        }
コード例 #5
0
        public HierarchyObjectElementV2 AddHierarchyObjectWithoutUpdate(HierarchyObjectV2 hierarchyObject, HierarchyObjectElementV2 parent)
        {
            var hierarchyObjectElement = CreateHierarchy(hierarchyObject, parent.depthIndex + 1);

            if (parent.hierarchyObjectElements.Count == 0)
            {
                parent.enableArrowElement = true;
            }
            parent.AddHeirarchyElement(hierarchyObjectElement);

            return(hierarchyObjectElement);
        }
コード例 #6
0
        public HierarchyObjectElementV2 AddHierarchyObject(HierarchyObjectV2 hierarchyObject, HierarchyObjectElementV2 parent, int siblingIndex)
        {
            var hierarchyObjectElement = AddHierarchyObjectWithoutUpdate(hierarchyObject, parent, siblingIndex);

            //Cannot use this function as even though this places the Object correctly while being more optmised than updating all children elements
            //If the update is being is being optimised by calling AddHierarchyObjectWithoutUpdate, when finally calling AddHierarchyObject, the objects called WithoutUpdate would be missplaced
            //hierarchyBaseElement.hierarchyContentElement.UpdateElementPosition(hierarchyObjectElement);

            hierarchyContentElement.UpdateChildrenElements(parent);
            hierarchyContentElement.UpdateHierarchyBranch(parent);
            if (parent.isExpanded)
            {
                hierarchyContentElement.UpdateRootElements();
            }
            return(hierarchyObjectElement);
        }
コード例 #7
0
 private HierarchyObjectElementV2 CreateHierarchy(HierarchyObjectV2 hierarchyObject)
 {
     return(CreateHierarchy(hierarchyObject, 0));
 }