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

            if (view == null)
            {
                throw new Exception("乐高组件必须置于乐高视图下");
            }

            var meta = new LegoComponentRef
            {
                RefComponent  = GetComponentId(rect),
                MountPath     = path,
                LogicId       = rect.name,
                MountPosition = LegoRectTransformMeta.Create(rect),
            };

            return(meta);
        }
Ejemplo n.º 2
0
        private void AddComponentMeta(Transform transform)
        {
            var componentMeta = LegoComponentRef.Create(transform.RectTransform());

            ComponentRefs.Add(componentMeta);
        }