Ejemplo n.º 1
0
        public static LegoContainerRef Create(RectTransform rect)
        {
            string path = null;
            var    view = rect.FindParent <YuLegoViewHelper>(out path);

            if (view == null)
            {
                var component = rect.FindParent <YuLegoComponentHelper>(out path);
                throw new Exception("乐高容器必须置于乐高视图或者乐高组件下");
            }

            var meta = new LegoContainerRef
            {
                ContainerName = rect.name,
                MountPath     = path,
                MountPosition = LegoRectTransformMeta.Create(rect)
            };

            return(meta);
        }
Ejemplo n.º 2
0
        private void AddContainerMeta(Transform transform)
        {
            var containerMeta = LegoContainerRef.Create(transform.RectTransform());

            ContainerRefs.Add(containerMeta);
        }