Exemple #1
0
        private void OnEnable()
        {
            value = target as ConfigFieldPdr;
            ConfigTypeLoader.Load();
            var type = value.GetComponentInParent <ConfigTypePdr>();

            if (type && !string.IsNullOrEmpty(type.typeName))
            {
                if (ConfigTypeLoader.name2Fields.TryGetValue(type.typeName, out var fields))
                {
                    var list = new List <string>();
                    foreach (var item in fields)
                    {
                        list.Add(item.Name);
                    }
                    fieldNames = list.ToArray();
                }
                value.typeName = type.typeName;
            }
            if (fieldNames != null)
            {
                for (int i = 0; i < fieldNames.Length; i++)
                {
                    if (fieldNames[i] == value.fieldName)
                    {
                        typeIdx = i;
                        break;
                    }
                }
            }
        }
Exemple #2
0
 public override IComponent GetValue()
 {
     ConfigTypeLoader.Load();
     if (ConfigTypeLoader.name2Type.TryGetValue(typeName, out var type))
     {
         value.type = type;
     }
     return(base.GetValue());
 }
Exemple #3
0
 private void OnEnable()
 {
     value = target as ConfigTypePdr;
     ConfigTypeLoader.Load();
     typeNames = ConfigTypeLoader.name2Type.Keys.ToArray();
     for (int i = 0; i < typeNames.Length; i++)
     {
         if (typeNames[i] == value.typeName)
         {
             typeIdx = i;
             break;
         }
     }
 }
Exemple #4
0
 public override IComponent GetValue()
 {
     ConfigTypeLoader.Load();
     if (ConfigTypeLoader.name2Fields.TryGetValue(typeName, out var fields))
     {
         var list = new List <string>();
         foreach (var item in fields)
         {
             if (item.Name == fieldName)
             {
                 value.info = item;
                 break;
             }
         }
     }
     return(base.GetValue());
 }