Exemplo n.º 1
0
        public void Evaluate(UIFix parent, IBehaviourComponent component)
        {
            var texts = parent.GetComponents <Text>(component);

            foreach (var text in texts)
            {
                Fix(text);
            }
        }
Exemplo n.º 2
0
        public void Evaluate(UIFix parent, IBehaviourComponent component)
        {
            var rectTransforms = parent.GetComponents <RectTransform>(component);

            foreach (var transform in rectTransforms)
            {
                Fix(transform);
            }
        }
Exemplo n.º 3
0
        public List <UIFix> GetByType(IBehaviourComponent component)
        {
            if (_typeFixMap == null)
            {
                Initialize(_serializedFixMap);
            }

            var name = component.GetComponentType();

            return(_typeFixMap.ContainsKey(name) ? _typeFixMap[name] : new List <UIFix>());
        }
Exemplo n.º 4
0
 public List <T> GetComponents <T>(IBehaviourComponent component)
     where T : Component
 {
     if (!String.IsNullOrEmpty(Path))
     {
         return(component.GetComponentsByPath <T>(Path, ExceptPath, !String.IsNullOrEmpty(MatchChildrenRange) ? RangeValue.Parse(MatchChildrenRange) : null));
     }
     else if (!String.IsNullOrEmpty(Field))
     {
         return(component.GetComponentsByField <T>(Field));
     }
     else
     {
         return(component.GetComponentsByType <T>(!String.IsNullOrEmpty(MatchChildrenRange) ? RangeValue.Parse(MatchChildrenRange) : null));
     }
 }
        /// <summary>
        ///     Get fixes for requested component
        /// </summary>
        /// <param name="actionName"></param>
        /// <param name="component"></param>
        /// <returns></returns>
        public List <UIFix> GetFixes(string actionName, IBehaviourComponent component)
        {
            var fixes  = new List <UIFix>();
            var action = UIFixes.Get(actionName);

            if (action == null)
            {
                return(null);
            }

            fixes.AddRange(action.GetByType(component));
            fixes.AddRange(action.GetByPath(component));
            if (fixes.Count != 0)
            {
                ConsoleLogger.LogDebug($"Match! {fixes.Count} {component.GetComponentPath()}");
            }
            return(fixes.Count != 0 ? fixes : null);
        }
Exemplo n.º 6
0
        public List <UIFix> GetByPath(IBehaviourComponent component)
        {
            if (_pathFixMap == null)
            {
                Initialize(_serializedFixMap);
            }

            var name  = component.GetComponentPath();
            var fixes = new List <UIFix>();

            for (int i = 0; i < _pathFixMap.Count; i++)
            {
                if (name.EqualsWildcard(_pathFixMap[i].Path))
                {
                    fixes.AddRange(_pathFixMap[i].Fixes);
                }
            }
            return(fixes);
        }