first commit
This commit is contained in:
40
Packages/com.arongranberg.aline/Editor/DrawingEditor.asmdef
Normal file
40
Packages/com.arongranberg.aline/Editor/DrawingEditor.asmdef
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "ALINEEditor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:de4e6084e6d474788bb8c799d6b461ec",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc297fb7ca30549a8b58bbc1a40d808b
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 162772
|
||||
packageName: ALINE
|
||||
packageVersion: 1.7.6
|
||||
assetPath: Packages/com.arongranberg.aline/Editor/DrawingEditor.asmdef
|
||||
uploadId: 700292
|
||||
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Drawing {
|
||||
[CustomEditor(typeof(DrawingManager))]
|
||||
public class DrawingManagerEditor : Editor {
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
}
|
||||
|
||||
void OnSceneGUI () {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 981b658cf08ad4167af47647e3861f3d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 162772
|
||||
packageName: ALINE
|
||||
packageVersion: 1.7.6
|
||||
assetPath: Packages/com.arongranberg.aline/Editor/DrawingManagerEditor.cs
|
||||
uploadId: 700292
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Drawing {
|
||||
/// <summary>Helper for adding project settings</summary>
|
||||
static class ALINESettingsRegister {
|
||||
const string PROVIDER_PATH = "Project/ALINE";
|
||||
const string SETTINGS_LABEL = "ALINE";
|
||||
|
||||
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82a30ddb6b38ed2f68348d601bc43a2b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 162772
|
||||
packageName: ALINE
|
||||
packageVersion: 1.7.6
|
||||
assetPath: Packages/com.arongranberg.aline/Editor/DrawingSettingsEditor.cs
|
||||
uploadId: 700292
|
||||
Reference in New Issue
Block a user