diff options
author | chai <215380520@qq.com> | 2024-05-23 10:08:29 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-05-23 10:08:29 +0800 |
commit | 8722a9920c1f6119bf6e769cba270e63097f8e25 (patch) | |
tree | 2eaf9865de7fb1404546de4a4296553d8f68cc3b /Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor | |
parent | 3ba4020b69e5971bb0df7ee08b31d10ea4d01937 (diff) |
+ astar project
Diffstat (limited to 'Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor')
6 files changed, 148 insertions, 0 deletions
diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef new file mode 100644 index 0000000..01266a4 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef @@ -0,0 +1,40 @@ +{ + "name": "DrawingEditor", + "rootNamespace": "", + "references": [ + "GUID:de4e6084e6d474788bb8c799d6b461eb", + "GUID:774e21169c4ac4ec8a01db9cdb98d33b", + "GUID:f4059aaf6c60a4a58a177a2609feb769" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "MODULE_BURST", + "MODULE_MATHEMATICS", + "MODULE_COLLECTIONS" + ], + "versionDefines": [ + { + "name": "com.unity.burst", + "expression": "1.2.1-preview", + "define": "MODULE_BURST" + }, + { + "name": "com.unity.mathematics", + "expression": "1.1.0", + "define": "MODULE_MATHEMATICS" + }, + { + "name": "com.unity.collections", + "expression": "0.4.0-preview", + "define": "MODULE_COLLECTIONS" + } + ], + "noEngineReferences": false +}
\ No newline at end of file diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef.meta new file mode 100644 index 0000000..374821b --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc297fb7ca30549a8b58bbc1a40d808a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs new file mode 100644 index 0000000..1814e58 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs @@ -0,0 +1,19 @@ +using UnityEngine; +using System.Collections; +using UnityEditor; + +namespace Pathfinding.Drawing { + [CustomEditor(typeof(DrawingManager))] + public class DrawingManagerEditor : Editor { + // Use this for initialization + void Start () { + } + + // Update is called once per frame + void Update () { + } + + void OnSceneGUI () { + } + } +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs.meta new file mode 100644 index 0000000..1826527 --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingManagerEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 981b658cf08ad4167af47647e3861f3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs new file mode 100644 index 0000000..56acb6d --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace Pathfinding.Drawing { + /// <summary>Helper for adding project settings</summary> + static class ALINESettingsRegister { + const string PROVIDER_PATH = "Project/AstarGizmos"; + const string SETTINGS_LABEL = "A* Gizmos"; + + + [SettingsProvider] + public static SettingsProvider CreateMyCustomSettingsProvider () { + // First parameter is the path in the Settings window. + // Second parameter is the scope of this setting: it only appears in the Project Settings window. + var provider = new SettingsProvider(PROVIDER_PATH, SettingsScope.Project) { + // By default the last token of the path is used as display name if no label is provided. + label = SETTINGS_LABEL, + guiHandler = (searchContext) => + { + var settings = new SerializedObject(DrawingSettings.GetSettingsAsset()); + EditorGUILayout.HelpBox("Opacity of lines, solid objects and text drawn using ALINE. When drawing behind other objects, an additional opacity multiplier is applied.", MessageType.None); + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Lines", EditorStyles.boldLabel); + EditorGUILayout.Slider(settings.FindProperty("settings.lineOpacity"), 0, 1, new GUIContent("Opacity", "Opacity of lines when in front of objects")); + EditorGUILayout.Slider(settings.FindProperty("settings.lineOpacityBehindObjects"), 0, 1, new GUIContent("Opacity (occluded)", "Additional opacity multiplier of lines when behind or inside objects")); + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Solids", EditorStyles.boldLabel); + EditorGUILayout.Slider(settings.FindProperty("settings.solidOpacity"), 0, 1, new GUIContent("Opacity", "Opacity of solid objects when in front of other objects")); + EditorGUILayout.Slider(settings.FindProperty("settings.solidOpacityBehindObjects"), 0, 1, new GUIContent("Opacity (occluded)", "Additional opacity multiplier of solid objects when behind or inside other objects")); + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Text", EditorStyles.boldLabel); + EditorGUILayout.Slider(settings.FindProperty("settings.textOpacity"), 0, 1, new GUIContent("Opacity", "Opacity of text when in front of other objects")); + EditorGUILayout.Slider(settings.FindProperty("settings.textOpacityBehindObjects"), 0, 1, new GUIContent("Opacity (occluded)", "Additional opacity multiplier of text when behind or inside other objects")); + EditorGUILayout.Separator(); + EditorGUILayout.Slider(settings.FindProperty("settings.curveResolution"), 0.1f, 3f, new GUIContent("Curve resolution", "Higher values will make curves smoother, but also a bit slower to draw.")); + + settings.ApplyModifiedProperties(); + if (GUILayout.Button("Reset to default")) { + var def = DrawingSettings.DefaultSettings; + var current = DrawingSettings.GetSettingsAsset(); + current.settings.lineOpacity = def.lineOpacity; + current.settings.lineOpacityBehindObjects = def.lineOpacityBehindObjects; + current.settings.solidOpacity = def.solidOpacity; + current.settings.solidOpacityBehindObjects = def.solidOpacityBehindObjects; + current.settings.textOpacity = def.textOpacity; + current.settings.textOpacityBehindObjects = def.textOpacityBehindObjects; + current.settings.curveResolution = def.curveResolution; + EditorUtility.SetDirty(current); + } + }, + + // Populate the search keywords to enable smart search filtering and label highlighting: + keywords = new HashSet<string>(new[] { "Drawing", "Wire", "aline", "opacity" }) + }; + + return provider; + } + } +} diff --git a/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs.meta b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs.meta new file mode 100644 index 0000000..5afbd0e --- /dev/null +++ b/Other/AstarPathfindingDemo/Packages/com.arongranberg.astar/Drawing/Editor/DrawingSettingsEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82a30ddb6b38ed2f68348d601bc43a2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |