diff options
author | chai <chaifix@163.com> | 2021-05-19 23:36:28 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-05-19 23:36:28 +0800 |
commit | d7c13789d3d39c90bcfad545cb438a574652d4a8 (patch) | |
tree | 00578504f4550d986524265f8d843e20e2f49fad | |
parent | 047efd15559d7c62666f00392a987dccdc36d500 (diff) |
+misc
4 files changed, 142 insertions, 1 deletions
diff --git a/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs b/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs new file mode 100644 index 0000000..beba382 --- /dev/null +++ b/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs @@ -0,0 +1,14 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+
+// Gizmos չ
+public static class EditorGizmosHelper
+{
+ public static void DrawCube()
+ {
+
+ }
+
+}
\ No newline at end of file diff --git a/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs.meta b/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs.meta new file mode 100644 index 0000000..f7411dd --- /dev/null +++ b/UnityCollection/Assets/Tools/EditorGUIHelper/Editor/EditorGizmosHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8d8c8aa0672d844e9051ebc8c776b5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/CustomHandles.unity b/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/CustomHandles.unity index b010857..9abe0be 100644 --- a/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/CustomHandles.unity +++ b/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/CustomHandles.unity @@ -213,6 +213,118 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1033041003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1033041008} + - component: {fileID: 1033041007} + - component: {fileID: 1033041006} + - component: {fileID: 1033041005} + - component: {fileID: 1033041004} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1033041004 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1033041003} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9417b901511a3344c9aa9c0a832d54e0, type: 3} + m_Name: + m_EditorClassIdentifier: + limitAngle: + - {x: 0, y: 0} + - {x: 0, y: 0} + - {x: 0, y: 0} + min: 332.17105 + axis: {x: 0, y: 0, z: 1} +--- !u!65 &1033041005 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1033041003} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1033041006 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1033041003} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1033041007 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1033041003} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1033041008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1033041003} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 8.826, y: -0.181, z: 30.174} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1760453184 GameObject: m_ObjectHideFlags: 0 diff --git a/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/Editor/RotationLimitAngleInspector.cs b/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/Editor/RotationLimitAngleInspector.cs index 1fb5613..344f1de 100644 --- a/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/Editor/RotationLimitAngleInspector.cs +++ b/UnityCollection/Assets/Tools/EditorGUIHelper/Examples/Editor/RotationLimitAngleInspector.cs @@ -17,7 +17,11 @@ public class RotationLimitAngleInspector : Editor Vector3 cross = Vector3.Cross(axis, v).normalized;
Quaternion minRotation = Quaternion.AngleAxis(script.min, axis); float min = script.min;
- min = EditorHandlesHelper.ScaleValueHandle(min, script.transform.position + minRotation * cross, Quaternion.identity, 0.5f, Handles.SphereHandleCap, -10); + min = EditorHandlesHelper.ScaleValueHandle(min + , script.transform.position + minRotation * cross + , Quaternion.AngleAxis(script.min, axis) * Quaternion.LookRotation(Vector3.up) + , 0.5f + , Handles.CylinderHandleCap, -10); script.min = Mathf.Clamp(min, 0, 360);
}
}
\ No newline at end of file |