添加了更多的反射检查逻辑。
修复布局组件的缓存引用关系
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XericUI.ReflectionUIGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// 字符串检查
|
||||
/// </summary>
|
||||
public class XuiavrgStringCheckAttribute : Attribute, IXuiavrgAttribute
|
||||
{
|
||||
public readonly int minLength;
|
||||
public readonly int maxLength;
|
||||
public readonly string regexPattern;
|
||||
public readonly bool onlyLetters;
|
||||
public readonly bool onlyNumber;
|
||||
public readonly bool onlyEmail;
|
||||
public readonly bool onlyPhone;
|
||||
public readonly bool onlyUrl;
|
||||
|
||||
public XuiavrgStringCheckAttribute(
|
||||
int minLength = 0, int maxLength = int.MaxValue,
|
||||
string regexPattern = "",
|
||||
bool onlyLetters = false, bool onlyNumber = false, bool onlyEmail = true, bool onlyPhone = true,
|
||||
bool onlyUrl = true)
|
||||
{
|
||||
this.minLength = minLength;
|
||||
this.maxLength = maxLength;
|
||||
this.regexPattern = regexPattern;
|
||||
this.onlyLetters = onlyLetters;
|
||||
this.onlyNumber = onlyNumber;
|
||||
this.onlyEmail = onlyEmail;
|
||||
this.onlyPhone = onlyPhone;
|
||||
this.onlyUrl = onlyUrl;
|
||||
}
|
||||
|
||||
public void BindProperty(XuiavrgInspectorProperty property)
|
||||
{
|
||||
property.stringMinLength = minLength;
|
||||
property.stringMaxLength = maxLength;
|
||||
property.stringRegexPattern = regexPattern;
|
||||
property.stringOnlyLetters = onlyLetters;
|
||||
property.stringOnlyNumber = onlyNumber;
|
||||
property.stringOnlyEmail = onlyEmail;
|
||||
property.stringOnlyPhone = onlyPhone;
|
||||
property.stringOnlyUrl = onlyUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user