Rename editor namespaces.
This commit is contained in:
@@ -4,9 +4,8 @@ using System;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace Utilities.Extensions.UIToolkit
|
||||
namespace SerializableFunc.Editor.Extensions.DropdownField
|
||||
{
|
||||
public static class DropdownFieldExtensions
|
||||
{
|
||||
@@ -21,7 +20,7 @@ namespace Utilities.Extensions.UIToolkit
|
||||
|
||||
#region Generic Menu Assigning
|
||||
|
||||
public static void AssignGenericMenu(this DropdownField dropdownField,
|
||||
public static void AssignGenericMenu(this UnityEngine.UIElements.DropdownField dropdownField,
|
||||
Func<GenericMenu> genericMenuBuildingFunc)
|
||||
{
|
||||
Func<object> genericOSMenuFunc = () =>
|
||||
@@ -32,7 +31,7 @@ namespace Utilities.Extensions.UIToolkit
|
||||
|
||||
object boxedfunc = ConvertFuncToDesiredType(genericOSMenuFunc);
|
||||
|
||||
FieldInfo createMenuCallbackFieldInfo = typeof(DropdownField)
|
||||
FieldInfo createMenuCallbackFieldInfo = typeof(UnityEngine.UIElements.DropdownField)
|
||||
.GetField(CreateMenuCallback_Property_Name, BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
createMenuCallbackFieldInfo.SetValue(dropdownField, boxedfunc);
|
||||
@@ -102,7 +101,7 @@ namespace Utilities.Extensions.UIToolkit
|
||||
|
||||
#region Formatting Callback Assigning
|
||||
|
||||
public static void AssignFormattingCallback(this DropdownField dropdownField,
|
||||
public static void AssignFormattingCallback(this UnityEngine.UIElements.DropdownField dropdownField,
|
||||
Func<string, string> formattingCallback)
|
||||
{
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
@@ -112,10 +111,10 @@ namespace Utilities.Extensions.UIToolkit
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void AssignFormattingCallbackViaReflection(this DropdownField functionDropdown,
|
||||
private static void AssignFormattingCallbackViaReflection(this UnityEngine.UIElements.DropdownField functionDropdown,
|
||||
Func<string, string> formattingCallback)
|
||||
{
|
||||
PropertyInfo propertyInfo = typeof(DropdownField)
|
||||
PropertyInfo propertyInfo = typeof(UnityEngine.UIElements.DropdownField)
|
||||
.GetProperty(FormatSelectedValueCallback_Property_Name, BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
object[] args = new object[] { formattingCallback };
|
||||
@@ -4,15 +4,14 @@ using System.Collections;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
|
||||
namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
|
||||
namespace SerializableFunc.Editor.Extensions.SerializedProperty
|
||||
{
|
||||
public static class SerializedPropertyExtensions
|
||||
{
|
||||
static readonly Regex rgx = new Regex(@"\[\d+\]", RegexOptions.Compiled);
|
||||
|
||||
public static object GetBoxedValue(this SerializedProperty property)
|
||||
public static object GetBoxedValue(this UnityEditor.SerializedProperty property)
|
||||
{
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
#if UNITY_2023_2_OR_NEWER
|
||||
@@ -22,7 +21,7 @@ namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void SetBoxedValue(this SerializedProperty property, object value)
|
||||
public static void SetBoxedValue(this UnityEditor.SerializedProperty property, object value)
|
||||
{
|
||||
property.serializedObject.Update();
|
||||
#if UNITY_2023_2_OR_NEWER
|
||||
@@ -33,7 +32,7 @@ namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
|
||||
property.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public static T GetValue<T>(this SerializedProperty property) where T : class
|
||||
public static T GetValue<T>(this UnityEditor.SerializedProperty property) where T : class
|
||||
{
|
||||
object obj = property.serializedObject.targetObject;
|
||||
string path = property.propertyPath.Replace(".Array.data", string.Empty);
|
||||
@@ -53,7 +52,7 @@ namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
|
||||
return (T)obj;
|
||||
}
|
||||
|
||||
public static bool SetValue<T>(this SerializedProperty property, T value) where T : class
|
||||
public static bool SetValue<T>(this UnityEditor.SerializedProperty property, T value) where T : class
|
||||
{
|
||||
object obj = property.serializedObject.targetObject;
|
||||
string path = property.propertyPath.Replace(".Array.data", "");
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Utilities.Extensions.SystemExtensions
|
||||
namespace SerializableFunc.Editor.Extensions.TypeExtensions
|
||||
{
|
||||
public static class TypeExtensions
|
||||
{
|
||||
@@ -5,21 +5,21 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using SerializableFunc;
|
||||
using SerializableFunc.Editor.Extensions.DropdownField;
|
||||
using SerializableFunc.Editor.Extensions.SerializedProperty;
|
||||
using SerializableFunc.Editor.Extensions.TypeExtensions;
|
||||
using UnityEditor;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using Utilities.Extensions.SystemExtensions;
|
||||
using Utilities.Extensions.UIToolkit;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace UnityUtilities.SerializableDataHelpers.UnityEditorUtilities
|
||||
namespace SerializableFunc.Editor.PropertyDrawer
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(SerializableAction), true)]
|
||||
[CustomPropertyDrawer(typeof(SerializableFuncBase<>), true)]
|
||||
public class SerializableFuncBasePropertyDrawer : PropertyDrawer
|
||||
public class SerializableFuncBasePropertyDrawer : UnityEditor.PropertyDrawer
|
||||
{
|
||||
private const string Target_Function_Label = "Target Function";
|
||||
private const string Target_Object_Label = "Target Object";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "SerializableFunc.Editor",
|
||||
"rootNamespace": "",
|
||||
"rootNamespace": "SerializableFunc",
|
||||
"references": [
|
||||
"GUID:e72a8e3728c787f4fafc146b590e6be5"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user