添加了多种对程序流程控制与保全的脚本,而且现在可以更快速的构建一个具有线性关系的协程了。 添加了一个支持多种模式的单维梯度控制器,类似unity的颜色梯度类型。 添加了一个用于看向某个物体的旋转控制器。 添加了一个加载宏。 完善了批处理脚本流程。
55 lines
1.1 KiB
C#
55 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
|
|
using UnityEditor;
|
|
|
|
using UnityEngine;
|
|
|
|
using static UnityEngine.GraphicsBuffer;
|
|
|
|
namespace XericLibrary.Runtime.CustomDrawer
|
|
{
|
|
public class GroupAttribute : PropertyAttribute
|
|
{
|
|
public string group;
|
|
|
|
public GroupAttribute(string groupName)
|
|
{
|
|
group = groupName;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// ʹÓ÷Ö×鹦ÄܵÄʾÀý
|
|
/// </summary>
|
|
//[CustomEditor(typeof(GroupAttribute))]
|
|
public class GroupExampleEditor : Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
|
|
//ShowGroupInspector(target);
|
|
}
|
|
|
|
public static void ShowGroupInspector(Editor editor, object target)
|
|
{
|
|
// Iterate through the fields
|
|
foreach(var field in target.GetType().GetFields())
|
|
{
|
|
var groupAttribute = field.GetCustomAttribute<GroupAttribute>();
|
|
if(groupAttribute != null)
|
|
{
|
|
EditorGUILayout.Space();
|
|
EditorGUILayout.LabelField(groupAttribute.group, EditorStyles.boldLabel);
|
|
}
|
|
|
|
EditorGUILayout.PropertyField(editor.serializedObject.FindProperty(field.Name), true);
|
|
}
|
|
|
|
editor.serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|
|
} |