예제 #1
0
        private LuaBindingDataBase CheckBinding(LuaClassField field, Type dataBindType)
        {
            LuaBindingDataBase matched = null;

            foreach (var bind in binding.LuaData)
            {
                if (bind.FieldName != field.FieldName)
                {
                    continue;
                }
                if (bind.GetType() != dataBindType)
                {
                    continue;
                }
                matched = bind;
                break;
            }

            if (matched == null)
            {
                matched           = Activator.CreateInstance(dataBindType) as LuaBindingDataBase;
                matched.FieldName = field.FieldName;
                ArrayUtility.Add(ref binding.LuaData, matched);
            }

            isUsedBinding.Add(matched);
            matched.FieldType = field.FieldType;
            return(matched);
        }
예제 #2
0
 private T CheckBinding <T>(LuaClassField field) where T : LuaBindingDataBase
 {
     return(CheckBinding(field, typeof(T)) as T);
 }