maint: added livewatch asset
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch.Editor
|
||||
{
|
||||
public class EventModifiersEditorProperty : EditorProperty<EventModifiers>
|
||||
{
|
||||
public EventModifiersEditorProperty(string key, EventModifiers defaultValue) : base(key, defaultValue)
|
||||
{
|
||||
|
||||
}
|
||||
protected override bool IsEqual(EventModifiers left, EventModifiers right)
|
||||
{
|
||||
return left == right;
|
||||
}
|
||||
|
||||
protected override EventModifiers Load()
|
||||
{
|
||||
return (EventModifiers)EditorPrefs.GetInt(Key);
|
||||
}
|
||||
|
||||
protected override void Save(EventModifiers value)
|
||||
{
|
||||
EditorPrefs.SetInt(Key, (int)value);
|
||||
}
|
||||
|
||||
protected override EditorPropertyDrawer<EventModifiers> GetDrawer()
|
||||
{
|
||||
return new EventModifiersEditorPropertyDrawer(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class EventModifiersEditorPropertyDrawer : EditorPropertyDrawer<EventModifiers>
|
||||
{
|
||||
public EventModifiersEditorPropertyDrawer(EditorProperty<EventModifiers> property) : base(property)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Draw(params GUILayoutOption[] options)
|
||||
{
|
||||
Property.Value = (EventModifiers)EditorGUILayout.EnumFlagsField(Property, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1faf266ff65478a987b67c7b2f064c5
|
||||
timeCreated: 1724871754
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/Editor/UserSettings/EventModifiersEditorProperty.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,46 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch.Editor
|
||||
{
|
||||
public class KeyCodeEditorProperty : EditorProperty<KeyCode>
|
||||
{
|
||||
public KeyCodeEditorProperty(string key, KeyCode defaultValue) : base(key, defaultValue)
|
||||
{
|
||||
|
||||
}
|
||||
protected override bool IsEqual(KeyCode left, KeyCode right)
|
||||
{
|
||||
return left == right;
|
||||
}
|
||||
|
||||
protected override KeyCode Load()
|
||||
{
|
||||
return (KeyCode)EditorPrefs.GetInt(Key);
|
||||
}
|
||||
|
||||
protected override void Save(KeyCode value)
|
||||
{
|
||||
EditorPrefs.SetInt(Key, (int)value);
|
||||
}
|
||||
|
||||
protected override EditorPropertyDrawer<KeyCode> GetDrawer()
|
||||
{
|
||||
return new KeyEditorPropertyDrawer(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class KeyEditorPropertyDrawer : EditorPropertyDrawer<KeyCode>
|
||||
{
|
||||
public KeyEditorPropertyDrawer(EditorProperty<KeyCode> property) : base(property)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Draw(params GUILayoutOption[] options)
|
||||
{
|
||||
Property.Value = (KeyCode)EditorGUILayout.EnumPopup(Property, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b3601a302864c8ca35cb90ea4ec060a
|
||||
timeCreated: 1724923745
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/Editor/UserSettings/KeyCodeEditorProperty.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,35 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch.Editor
|
||||
{
|
||||
public static class UserSettings
|
||||
{
|
||||
private const string PREFIX = "LivwWatch.";
|
||||
|
||||
public static EditorProperty<EventModifiers> WidthZoomKeys = new EventModifiersEditorProperty($"{PREFIX}WidthZoomKeys", EventModifiers.Control);
|
||||
public static EditorProperty<EventModifiers> HeightZoomKeys = new EventModifiersEditorProperty($"{PREFIX}HeightZoomKeys", EventModifiers.Shift);
|
||||
public static EditorProperty<EventModifiers> ScrollValuesKeys = new EventModifiersEditorProperty($"{PREFIX}ScrollValuesKeys", EventModifiers.Alt);
|
||||
|
||||
public static EditorProperty<KeyCode> FlipSelectionKey = new KeyCodeEditorProperty($"{PREFIX}FlipSelectionKey", KeyCode.F);
|
||||
public static EditorProperty<KeyCode> ExpandVariableKey = new KeyCodeEditorProperty($"{PREFIX}ExpandVariableKey", KeyCode.Space);
|
||||
public static EditorProperty<KeyCode> PreviousValueKey = new KeyCodeEditorProperty($"{PREFIX}PreviousValueKey", KeyCode.LeftArrow);
|
||||
public static EditorProperty<KeyCode> NextValueKey = new KeyCodeEditorProperty($"{PREFIX}NextValueKey", KeyCode.RightArrow);
|
||||
public static EditorProperty<KeyCode> PreviousVariableKey = new KeyCodeEditorProperty($"{PREFIX}PreviousVariableKey", KeyCode.UpArrow);
|
||||
public static EditorProperty<KeyCode> NextVariableKey = new KeyCodeEditorProperty($"{PREFIX}NextVariableKey", KeyCode.DownArrow);
|
||||
|
||||
public static void RestoreDefaultValues()
|
||||
{
|
||||
WidthZoomKeys.SetToDefault();
|
||||
HeightZoomKeys.SetToDefault();
|
||||
ScrollValuesKeys.SetToDefault();
|
||||
|
||||
FlipSelectionKey.SetToDefault();
|
||||
ExpandVariableKey.SetToDefault();
|
||||
PreviousValueKey.SetToDefault();
|
||||
NextValueKey.SetToDefault();
|
||||
PreviousVariableKey.SetToDefault();
|
||||
NextVariableKey.SetToDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31eee50e570748d5bd8cdd7b0816ac9e
|
||||
timeCreated: 1724579283
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/Editor/UserSettings/UserSettings.cs
|
||||
uploadId: 770587
|
||||
@@ -0,0 +1,76 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ingvar.LiveWatch.Editor
|
||||
{
|
||||
public static class UserSettingsProvider
|
||||
{
|
||||
[SettingsProvider]
|
||||
public static SettingsProvider CreateUserSettingsProvider()
|
||||
{
|
||||
var provider = new SettingsProvider("Preferences/Live Watch", SettingsScope.User)
|
||||
{
|
||||
label = "Live Watch",
|
||||
guiHandler = (searchContext) =>
|
||||
{
|
||||
SettingsGUI();
|
||||
},
|
||||
|
||||
keywords = new HashSet<string>(new[] { "Live", "Watch", "LiveWatch" })
|
||||
};
|
||||
|
||||
return provider;
|
||||
}
|
||||
|
||||
private static void SettingsGUI()
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
DrawShortcuts();
|
||||
}
|
||||
|
||||
private static void DrawShortcuts()
|
||||
{
|
||||
EditorGUILayout.Space(5);
|
||||
GUILayout.Label("Shortcuts", Styles.SettingsSubTitleText);
|
||||
EditorGUILayout.Space(5);
|
||||
|
||||
ModifierField("Cell Width Zoom In/Out", UserSettings.WidthZoomKeys);
|
||||
ModifierField("Cell Height Zoom In/Out", UserSettings.HeightZoomKeys);
|
||||
ModifierField("Values Scroll", UserSettings.ScrollValuesKeys);
|
||||
GUILayout.Space(5);
|
||||
KeyField("Flip Selection", UserSettings.FlipSelectionKey);
|
||||
KeyField("Expand selected variable", UserSettings.ExpandVariableKey);
|
||||
KeyField("Previous variable", UserSettings.NextVariableKey);
|
||||
KeyField("Next variable", UserSettings.PreviousVariableKey);
|
||||
KeyField("Previous value", UserSettings.PreviousValueKey);
|
||||
KeyField("Next value", UserSettings.NextValueKey);
|
||||
GUILayout.Space(5);
|
||||
|
||||
if (GUILayout.Button("Restore default shortcuts", GUILayout.Width(200)))
|
||||
{
|
||||
UserSettings.RestoreDefaultValues();
|
||||
}
|
||||
|
||||
void ModifierField(string labelText, EditorProperty<EventModifiers> property)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel(labelText);
|
||||
property.PropertyDrawer.Draw(GUILayout.Width(100));
|
||||
GUILayout.Space(20);
|
||||
GUILayout.Label("+", EditorStyles.boldLabel, GUILayout.Width(30));
|
||||
GUILayout.Label("Mouse Scroll Up/Down", EditorStyles.label, GUILayout.Width(150));
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
void KeyField(string labelText, EditorProperty<KeyCode> property)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PrefixLabel(labelText);
|
||||
property.PropertyDrawer.Draw(GUILayout.Width(100));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23db2225b4844147b8eb2afa45b9a830
|
||||
timeCreated: 1724578679
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 324001
|
||||
packageName: LiveWatch Lite | Debug with full history of changes
|
||||
packageVersion: 1.0.1
|
||||
assetPath: Assets/LiveWatchLite/Scripts/Editor/UserSettings/UserSettingsProvider.cs
|
||||
uploadId: 770587
|
||||
Reference in New Issue
Block a user