Archived
添加编辑器阶段快捷生成、移除脚本
添加基本几何体拼接算法 添加线性变换目标类型,类似多种颜色设置功能 添加一些基本的shader函数,用于计算二维圆形,二维旋转等。
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7edfa5265ca98ac48a1250a252e34609
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user