Пример #1
0
 protected void ClearValidateProperty()
 {
     if (ValidateProperty?.GetInvocationList() != null)
     {
         foreach (Delegate del in ValidateProperty.GetInvocationList())
         {
             ValidateProperty -= (PropertyValidationEventHandler)del;
         }
     }
 }
Пример #2
0
        public PatternCondition(int patternID, ValidateProperty validate = null)
        {
            if (patternID == 0)
            {
                throw new ArgumentException(nameof(patternID));
            }

            this.PatternID = patternID;
            this.Validate  = validate;
        }
Пример #3
0
        public VRM10MetaEditor(SerializedObject serializedObject, SerializedProperty property) : base(serializedObject, property)
        {
            m_exporterVersion = m_rootProperty.FindPropertyRelative(nameof(VRM10ObjectMeta.ExporterVersion));
            m_thumbnail       = m_rootProperty.FindPropertyRelative(nameof(VRM10ObjectMeta.Thumbnail));

            m_title = new ValidateProperty(m_rootProperty.FindPropertyRelative(nameof(VRM10ObjectMeta.Name)), prop =>
            {
                if (string.IsNullOrEmpty(prop.stringValue))
                {
                    return(RequiredMessage(prop.name), MessageType.Error);
                }
Пример #4
0
        private void OnEnable()
        {
            m_target = (VRMMetaObject)target;

            m_Script          = serializedObject.FindProperty("m_Script");
            m_exporterVersion = serializedObject.FindProperty(nameof(m_target.ExporterVersion));
            m_thumbnail       = serializedObject.FindProperty(nameof(m_target.Thumbnail));
            m_title           = new ValidateProperty(serializedObject.FindProperty(nameof(m_target.Title)), prop =>
            {
                if (string.IsNullOrEmpty(prop.stringValue))
                {
                    return(RequiredMessage(prop.name), MessageType.Error);
                }