Exemplo n.º 1
0
        private void AddToSerializedAnchoredPanelProperties(AnchoredPanelProperties props)
        {
            SerializableAnchoredPanelProperties serializedProps = new SerializableAnchoredPanelProperties()
            {
                panel             = props.panel,
                anchorDirection   = props.anchorDirection,
                childCount        = props.subPanels.Count,
                indexOfFirstChild = initialPanelsAnchoredSerialized.Count + 1
            };

            initialPanelsAnchoredSerialized.Add(serializedProps);
            for (int i = 0; i < props.subPanels.Count; i++)
            {
                AddToSerializedAnchoredPanelProperties(props.subPanels[i]);
            }
        }
Exemplo n.º 2
0
        private int ReadFromSerializedAnchoredPanelProperties(int index, out AnchoredPanelProperties props)
        {
            SerializableAnchoredPanelProperties serializedProps = initialPanelsAnchoredSerialized[index];
            AnchoredPanelProperties             newProps        = new AnchoredPanelProperties()
            {
                panel           = serializedProps.panel,
                anchorDirection = serializedProps.anchorDirection,
                subPanels       = new List <AnchoredPanelProperties>()
            };

            for (int i = 0; i != serializedProps.childCount; i++)
            {
                AnchoredPanelProperties childProps;
                index = ReadFromSerializedAnchoredPanelProperties(++index, out childProps);
                newProps.subPanels.Add(childProps);
            }

            props = newProps;
            return(index);
        }