Add assets

This commit is contained in:
2025-05-08 16:03:30 +09:00
parent cd4ebdb0a7
commit 57b037e0a9
977 changed files with 91747 additions and 28 deletions

View File

@@ -0,0 +1,13 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(AssetsOnlyAttribute))]
public class AssetsOnlyAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
property.allowSceneObject = false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fd9e1c6dc2e2a6f41993a36ad5dad550
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(BlockquoteAttribute))]
public class BlockquoteAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
BlockquoteAttribute blockquote = (BlockquoteAttribute)attribute;
GUIStyle style = EditorStyles.label;
style.wordWrap = true;
LucidEditorGUILayout.Blockquote(blockquote.text);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0ed2d80f5f80a459faf430e73df69e01
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomGroupProcessor(typeof(BoxGroupAttribute))]
public class BoxGroupAttributeProcessor : PropertyGroupProcessor
{
public override void BeginPropertyGroup()
{
LucidEditorGUILayout.BeginLayoutIndent(EditorGUI.indentLevel);
LucidEditorGUILayout.BeginBoxGroup(attribute.name, GUILayout.MinWidth(0));
}
public override void EndPropertyGroup()
{
LucidEditorGUILayout.EndBoxGroup();
LucidEditorGUILayout.EndLayoutIndent();
EditorGUILayout.Space(2);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa8e0443ca95e4acb8ff72f33ad827a7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(DisableIfAttribute))]
public class DisableIfAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
DisableIfAttribute disableIf = (DisableIfAttribute)attribute;
property.isEditable = !ReflectionUtil.GetValueBool(property.parentObject, disableIf.condition);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 46b525001269a42df899b926cd739bd5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEngine;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(DisableInEditModeAttribute))]
public class DisableInEditModeAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
DisableInEditModeAttribute disableInEditMode = (DisableInEditModeAttribute)attribute;
property.isEditable = Application.isPlaying;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa2ac94d8dc9d4c0fa7e5289272fd97b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEngine;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(DisableInPlayModeAttribute))]
public class DisableInPlayModeAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
DisableInPlayModeAttribute disableInPlayMode = (DisableInPlayModeAttribute)attribute;
property.isEditable = !Application.isPlaying;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a24d5c4bf91846fab0bb55cd9ccf693
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(EnableIfAttribute))]
public class EnableIfAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
EnableIfAttribute enableIf = (EnableIfAttribute)attribute;
property.isEditable = ReflectionUtil.GetValueBool(property.parentObject, enableIf.condition);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87c012206409c4a19846bf9f9785a777
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomGroupProcessor(typeof(FoldoutGroupAttribute))]
public class FoldoutGroupAttributeProcessor : PropertyGroupProcessor
{
private LocalPersistentData<bool> expanded;
public override void Initialize()
{
expanded = GetLocalPersistentData<bool>("exanded");
}
public override void BeginPropertyGroup()
{
LucidEditorGUILayout.BeginLayoutIndent(EditorGUI.indentLevel);
expanded.Value = LucidEditorGUILayout.BeginFoldoutGroup(expanded.Value, attribute.name, GUILayout.MinWidth(0));
group.isExpanded = expanded.Value;
}
public override void EndPropertyGroup()
{
LucidEditorGUILayout.EndFoldoutGroup();
LucidEditorGUILayout.EndLayoutIndent();
EditorGUILayout.Space(2);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 82b7d9f997ddd4538b703ba85fc2ad57
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(GUIColorAttribute))]
public class GUIColorAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
GUIColorAttribute guiColor = (GUIColorAttribute)attribute;
LucidEditorUtility.PushGUIColor(guiColor.useCustomColor ? guiColor.customColor : guiColor.color.ToColor());
}
public override void OnAfterDrawProperty()
{
LucidEditorUtility.PopGUIColor();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e0a6e890fd919487c9db767e6da2b42b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomGroupProcessor(typeof(GroupAttribute))]
public class GroupAttributeProcessor : PropertyGroupProcessor
{
public override void BeginPropertyGroup()
{
LucidEditorGUILayout.BeginLayoutIndent(EditorGUI.indentLevel);
EditorGUILayout.BeginVertical(GUI.skin.box, GUILayout.MinWidth(0));
}
public override void EndPropertyGroup()
{
EditorGUILayout.EndVertical();
LucidEditorGUILayout.EndLayoutIndent();
EditorGUILayout.Space(2);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 881f22c00ad84426d9c0ac07a3a097e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(HelpBoxAttribute))]
public class HelpBoxAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
HelpBoxAttribute helpBox = (HelpBoxAttribute)attribute;
EditorGUILayout.HelpBox(helpBox.message, (MessageType)helpBox.type);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd2f68c11fb2d4dfe9dcbbf14f1bcbcd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(HelpBoxIfAttribute))]
public class HelpBoxIfAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
HelpBoxIfAttribute helpBoxIf = (HelpBoxIfAttribute)attribute;
if (ReflectionUtil.GetValueBool(property.parentObject, helpBoxIf.condition))
{
EditorGUILayout.HelpBox(helpBoxIf.message, (MessageType)helpBoxIf.type);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7d6392ca7b5094ba0b13c8e20d83ccd4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(HideIfAttribute))]
public class HideIfAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
HideIfAttribute hideIf = (HideIfAttribute)attribute;
property.isHidden |= ReflectionUtil.GetValueBool(property.parentObject, hideIf.condition);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 869bf746267a8451984148ee2382bcee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(HideLabelAttribute))]
public class HideLabelAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
property.hideLabel = true;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a318ee3a513dc4de3aa50762a65136cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomGroupProcessor(typeof(HorizontalGroupAttribute))]
public class HorizontalGroupAttributeProcessor : PropertyGroupProcessor
{
public override void BeginPropertyGroup()
{
HorizontalGroupAttribute horizontalGroupAttribute = (HorizontalGroupAttribute)attribute;
LucidEditorGUILayout.BeginLayoutIndent(EditorGUI.indentLevel);
EditorGUILayout.BeginHorizontal();
LucidEditorUtility.horizontalGroupCount++;
}
public override void EndPropertyGroup()
{
LucidEditorUtility.horizontalGroupCount--;
EditorGUILayout.EndHorizontal();
LucidEditorGUILayout.EndLayoutIndent();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ba7ac005c37994f3080a24e976c6f223
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(HorizontalLineAttribute))]
public class HorizontalLineAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
HorizontalLineAttribute horizontalLine = (HorizontalLineAttribute)attribute;
EditorGUILayout.Space(EditorGUIUtility.standardVerticalSpacing);
if (horizontalLine.useCustomColor)
{
LucidEditorGUILayout.Line(horizontalLine.customColor);
}
else
{
LucidEditorGUILayout.Line(horizontalLine.color.ToColor());
}
EditorGUILayout.Space(EditorGUIUtility.standardVerticalSpacing);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ae9d18acdc457450ea42f886ab9a9158
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(IndentAttribute))]
public class IndentAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
IndentAttribute indent = (IndentAttribute)attribute;
property.indent = indent.indent;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c5248ff57c43c4e6fa6108ce82ad2181
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(LabelTextAttribute))]
public class LabelTextAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
property.displayName = ((LabelTextAttribute)attribute).label;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e1de31754c47e417482f0a6c1785ff2a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(LabelWidthAttribute))]
public class LabelWidthAttributeProcessor : PropertyProcessor
{
private float defaultWidth;
public override void OnBeforeDrawProperty()
{
defaultWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = ((LabelWidthAttribute)attribute).width;
}
public override void OnAfterDrawProperty()
{
EditorGUIUtility.labelWidth = defaultWidth;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa081df837cda49f39fffedcc6eb4eb8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(OnValueChangedAttribute))]
public class OnValueChangedAttributeProcessor : PropertyProcessor
{
public override void OnAfterDrawProperty()
{
if (property.changed)
{
OnValueChangedAttribute onValueChanged = (OnValueChangedAttribute)attribute;
ReflectionUtil.Invoke(property.parentObject, onValueChanged.methodName, property.serializedProperty.GetValue<object>());
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3d257440bc9b64dc9a8e3c0ec7ecab97
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(PropertyOrderAttribute))]
public class PropertyOrderAttributeProcessor : PropertyProcessor
{
public override void OnBeforeInspectorGUI()
{
PropertyOrderAttribute propertyOrder = (PropertyOrderAttribute)attribute;
property.order = propertyOrder.propertyOrder;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 66e1690dd88604788ba6880d96dedf78
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(ReadOnlyAttribute))]
public class ReadOnlyAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
property.isEditable = false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c93f8adb1ea444432a967b800380c5ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(RequiredAttribute))]
public class RequiredAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
RequiredAttribute required = (RequiredAttribute)attribute;
if (property.serializedProperty.propertyType == SerializedPropertyType.ObjectReference &&
property.serializedProperty.objectReferenceValue == null)
{
EditorGUILayout.HelpBox(required.message == null ? $"{property.displayName} is required." : required.message, MessageType.Error);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a9f019eeb7b7447c869ced7a62600ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(SectionHeaderAttribute))]
public class SectionHeaderAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
EditorGUILayout.Space(7);
LucidEditorGUILayout.SectionHeader(((SectionHeaderAttribute)attribute).title);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a5b42575366d54c149b27a0c47737719
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(ShowIfAttribute))]
public class ShowIfAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
ShowIfAttribute showIf = (ShowIfAttribute)attribute;
property.isHidden |= !ReflectionUtil.GetValueBool(property.parentObject, showIf.condition);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49b75efbae43a4c3abd9941511dd16f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomGroupProcessor(typeof(TabGroupAttribute))]
public class TabGroupAttributeProcessor : PropertyGroupProcessor
{
private LocalPersistentData<int> selected;
private string[] tabArray;
public override void Initialize()
{
selected = GetLocalPersistentData<int>("selected");
List<string> tabList = new List<string>();
foreach (InspectorProperty property in group.childProperties)
{
TabGroupAttribute att = property.GetAttribute<TabGroupAttribute>();
if (!tabList.Contains(att.tabName)) tabList.Add(att.tabName);
}
tabArray = tabList.ToArray();
}
public override void BeginPropertyGroup()
{
LucidEditorGUILayout.BeginLayoutIndent(EditorGUI.indentLevel);
selected.Value = LucidEditorGUILayout.BeginTabGroup(selected.Value, tabArray, GUILayout.MinWidth(0));
foreach (InspectorProperty property in group.childProperties)
{
TabGroupAttribute att = property.GetAttribute<TabGroupAttribute>();
if (att != null)
{
property.isHidden |= att.tabName != tabArray[selected.Value];
}
}
}
public override void EndPropertyGroup()
{
LucidEditorGUILayout.EndFoldoutGroup();
LucidEditorGUILayout.EndLayoutIndent();
EditorGUILayout.Space(2);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d45600b0c539d4c6fa756bdd48e5d574
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(TitleHeaderAttribute))]
public class TitleHeaderAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
EditorGUILayout.Space(7);
LucidEditorGUILayout.TitleHeader(((TitleHeaderAttribute)attribute).title);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4bf9692430a8b4778bf1d8710eed95f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
using UnityEditor;
using Cainos.LucidEditor;
namespace Cainos.LucidEditor
{
[CustomAttributeProcessor(typeof(ValidateInputAttribute))]
public class ValidateInputAttributeProcessor : PropertyProcessor
{
public override void OnBeforeDrawProperty()
{
ValidateInputAttribute validateInput = (ValidateInputAttribute)attribute;
if (!ReflectionUtil.InvokeBool(property.parentObject, validateInput.condition, property.serializedProperty.GetValue<object>()))
{
EditorGUILayout.HelpBox(validateInput.message == null ? $"{property.displayName} is not valid." : validateInput.message, (MessageType)validateInput.type);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ab179775f6cfb40d7bcc4874fffa5412
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: